Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RequireRole ¶ added in v0.1.2
RequireRole returns a middleware that allows only requests whose JWT role is one of the provided allowed roles.
func UserFromContext ¶
func UserFromContext(ctx context.Context) (*security.RequestClaims, bool)
Types ¶
type ActiveChecker ¶ added in v0.1.2
ActiveChecker is implemented by the user service to verify a user is still active.
type AuthMiddleware ¶
type AuthMiddleware struct {
// contains filtered or unexported fields
}
func NewAuthMiddleware ¶
func NewAuthMiddleware(tokenSvc *security.TokenService, activeChecker ActiveChecker) *AuthMiddleware
Click to show internal directories.
Click to hide internal directories.