Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewContextWithScopes ¶
func ScopeMatch ¶
func ScopesMatch ¶
Types ¶
type ClaimsAuthoriser ¶
type ClaimsAuthoriser struct {
Predicate jwt.ClaimPredicate
}
ClaimsAuthoriser checks if the request satisfies a claim predicate.
type Handler ¶
type Handler struct {
// contains filtered or unexported fields
}
Handler handles JWT authentication and sets the authenticated principal in the context.
func NewHandler ¶
func NewHandler(validator jwt.TokenValidator, cookieName string, opts ...jwtmiddleware.Option) *Handler
NewHandler creates a JWT authentication handler. All log output uses the request-scoped zerolog context logger so entries automatically carry request_id, principal, and other fields injected by upstream middleware.
func (*Handler) WithRequireToken ¶ added in v0.8.0
WithRequireToken configures whether Wrap rejects a request with 401 when no bearer token or cookie is presented at all, instead of passing it through unauthenticated. Defaults to false, preserving this handler's pass-through behavior for chained/optional use (e.g. as one of several providers). Callers that use this handler as a server's sole auth gate should opt in.
type ResourceAuthoriser ¶
ResourceAuthoriser handles resource-level permissions (scopes).