Browse Source

Move authorization middleware to dedicated middlewares package

feature/add-rate-limiting
Fabian Vowie 3 years ago
parent
commit
dcddb6ca45
No known key found for this signature in database GPG Key ID: C27317C33B27C410
  1. 4
      main.go
  2. 2
      middlewares/authorization.go
  3. 2
      middlewares/authorization_test.go

4
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)

2
auth/authorization.go → middlewares/authorization.go

@ -1,4 +1,4 @@
package auth
package middlewares
import (
"net/http"

2
auth/authorization_test.go → middlewares/authorization_test.go

@ -1,4 +1,4 @@
package auth
package middlewares
import (
"net/http"
Loading…
Cancel
Save