This commit is contained in:
2024-07-19 17:04:42 +02:00
commit 5e0d0ec69f
71 changed files with 3316 additions and 0 deletions

View File

@@ -0,0 +1,16 @@
package middleware
import (
"mangezmieux-backend/internal/injector"
"mangezmieux-backend/internal/jwt"
)
const AuthenticationMiddlewareKey = "AuthenticationMiddleware"
const IntrospectServiceKey = "AuthCli"
func Setup(inj *injector.Injector) {
jwtService := injector.Get[*jwt.Service](inj, jwt.JWTKey)
introspectService := injector.Get[IntrospectService](inj, IntrospectServiceKey)
inj.Set(AuthenticationMiddlewareKey, GetAuthenticationMiddleware(introspectService, jwtService))
}