package
0.0.0-20240309073012-30139a74a392
Repository: https://github.com/garaekz/go-rest-api.git
Documentation: pkg.go.dev
# Functions
BearerHandler returns a Bearer token-based authentication middleware.
CurrentUser returns the user identity from the given context.
JWTHandler returns a JWT-based authentication middleware.
MockAuthHandler creates a mock authentication middleware for testing purpose.
MockAuthHeader returns an HTTP header that can pass the authentication check by MockAuthHandler.
NewService creates a new authentication service.
RegisterHandlers registers handlers for different HTTP requests.
WithUser returns a context that contains the user identity from the given JWT.