Documentation
¶
Overview ¶
Package auth is an auth util to decode and validate JWT tokens.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Auth ¶
type Auth interface { // AuthMiddleware is the auth function for the auth interceptor AuthMiddleware() authmiddleware.AuthFunc // GetToken is a function to get the token from the context GetToken(ctx context.Context) *Claims // StoreToken is a function to store the token in the context StoreToken(ctx context.Context, claims *Claims) context.Context // ValidatePermissions is a function to validate the permissions ValidatePermissions(ctx context.Context, permissions []string) error }
Auth is an interface for the auth middleware
type Claims ¶
type Claims struct { validator.RegisteredClaims CustomClaims }
Claims is a struct to hold the claims
type CustomClaims ¶
CustomClaims is a list of custom claims for the JWT token
type Opt ¶
type Opt func(*auth)
Opt is a function to set options for the auth middleware
func WithLogger ¶
WithLogger sets the logger for the auth middleware
Click to show internal directories.
Click to hide internal directories.