From dcddb6ca45e7eae6df5f3f64bb6bf5dda97126d1 Mon Sep 17 00:00:00 2001 From: Fabian Vowie Date: Sun, 23 Jan 2022 16:28:28 +0100 Subject: [PATCH] Move authorization middleware to dedicated middlewares package --- main.go | 4 ++-- {auth => middlewares}/authorization.go | 2 +- {auth => middlewares}/authorization_test.go | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) rename {auth => middlewares}/authorization.go (96%) rename {auth => middlewares}/authorization_test.go (98%) diff --git a/main.go b/main.go index 33cf1f7..792defd 100644 --- a/main.go +++ b/main.go @@ -4,7 +4,7 @@ import ( "encoding/json" "net/http" - "github.com/geplauder/lithium/auth" + "github.com/geplauder/lithium/middlewares" "github.com/geplauder/lithium/pipelines" "github.com/geplauder/lithium/settings" "github.com/geplauder/lithium/storage" @@ -60,7 +60,7 @@ func main() { pipes := pipelines.LoadPipelines() - authMiddleware := auth.CreateAuthenticationMiddleware(appSettings.Token) + authMiddleware := middlewares.CreateAuthenticationMiddleware(appSettings.Token) r := mux.NewRouter() r.Use(authMiddleware.Middleware) diff --git a/auth/authorization.go b/middlewares/authorization.go similarity index 96% rename from auth/authorization.go rename to middlewares/authorization.go index 8d3a14d..14f515e 100644 --- a/auth/authorization.go +++ b/middlewares/authorization.go @@ -1,4 +1,4 @@ -package auth +package middlewares import ( "net/http" diff --git a/auth/authorization_test.go b/middlewares/authorization_test.go similarity index 98% rename from auth/authorization_test.go rename to middlewares/authorization_test.go index 36075ea..b5c1da3 100644 --- a/auth/authorization_test.go +++ b/middlewares/authorization_test.go @@ -1,4 +1,4 @@ -package auth +package middlewares import ( "net/http"