Versions in this module Expand all Collapse all v0 v0.1.0 Jun 16, 2022 Changes in this version + const RoleAdmin + const RoleUser + var ErrForbidden = errors.New("attempted action is not allowed") + func SetClaims(ctx context.Context, claims Claims) context.Context + type Auth struct + func New(activeKID string, keyLookup KeyLookup) (*Auth, error) + func (a *Auth) GenerateToken(claims Claims) (string, error) + func (a *Auth) ValidateToken(tokenStr string) (Claims, error) + type Claims struct + Roles []string + func GetClaims(ctx context.Context) (Claims, error) + func (c Claims) Authorized(roles ...string) bool + type KeyLookup interface + PrivateKey func(kid string) (*rsa.PrivateKey, error) + PublicKey func(kid string) (*rsa.PublicKey, error)