Versions in this module Expand all Collapse all v0 v0.1.0 Jun 30, 2026 Changes in this version + var ErrForbidden = errors.New("authz: forbidden") + var ErrUnauthenticated = errors.New("authz: unauthenticated") + func HasAllScopes(p Principal, scopes ...string) bool + func HasAnyScope(p Principal, scopes ...string) bool + func HasScope(p Principal, scope string) bool + type Authorizer struct + func New(extract Extractor) (*Authorizer, error) + func (a *Authorizer) Principal(ctx context.Context) (Principal, bool) + func (a *Authorizer) RequireAllScopes(scopes ...string) func(http.Handler) http.Handler + func (a *Authorizer) RequireAnyScope(scopes ...string) func(http.Handler) http.Handler + func (a *Authorizer) RequireScope(scope string) func(http.Handler) http.Handler + type Extractor func(ctx context.Context) (Principal, bool) + type Principal interface + Roles func() []string + Scopes func() []string + Subject func() string