Browse Source
Move authorization middleware to dedicated middlewares package
feature/add-rate-limiting
Fabian Vowie
3 years ago
No known key found for this signature in database
GPG Key ID: C27317C33B27C410
3 changed files with
4 additions and
4 deletions
-
main.go
-
middlewares/authorization.go
-
middlewares/authorization_test.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) |
|
|
|
|
|
@ -1,4 +1,4 @@ |
|
|
|
package auth |
|
|
|
package middlewares |
|
|
|
|
|
|
|
import ( |
|
|
|
"net/http" |
|
|
@ -1,4 +1,4 @@ |
|
|
|
package auth |
|
|
|
package middlewares |
|
|
|
|
|
|
|
import ( |
|
|
|
"net/http" |