Documentation
¶
Index ¶
- Constants
- func AdminOnly(next http.Handler) http.Handler
- func AuthMiddleware(next http.Handler, parseToken tokenParser, validate claimsValidator) http.Handler
- func Authenticated(next http.Handler) http.Handler
- func InitJWT(c *config.Jwt) error
- func RefreshFlow(next http.Handler) http.Handler
- func TenantOnly(next http.Handler) http.Handler
- func TenantOrAdminOnly(next http.Handler) http.Handler
- type Claims
- type Service
- type Tokens
Constants ¶
View Source
const ( AuthHeaderKey = "Authorization" BearerPrefix = "Bearer" AuthCtxKey authCtxKey = "ctx:auth-user" )
View Source
const ( AccessIssuer string = "auth-access" RefreshIssuer string = "auth-refresh" )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Claims ¶
type Claims struct {
*jwt.RegisteredClaims
// Application-specific claims
Role string `json:"role,omitempty"`
}
Claims represents all JWT claims used in the system.
Click to show internal directories.
Click to hide internal directories.