Versions in this module Expand all Collapse all v0 v0.1.1 Jan 27, 2022 Changes in this version + const DefaultContextKey + var ErrTokenExpired = errors.New("token is expired") + var ErrTokenInvalid = errors.New("token is invalid") + var ErrTokenMissing = errors.New("required authorization token not found") + var NewToken = jwt.New + var NewTokenWithClaims = jwt.NewWithClaims + var SigningMethodES256 = jwt.SigningMethodES256 + var SigningMethodES384 = jwt.SigningMethodES384 + var SigningMethodES512 = jwt.SigningMethodES512 + var SigningMethodHS256 = jwt.SigningMethodHS256 + var SigningMethodHS384 = jwt.SigningMethodHS384 + var SigningMethodHS512 = jwt.SigningMethodHS512 + func FromAuthHeader(ctx context.Context) (string, error) + func OnError(ctx context.Context, err error) + type Claims = jwt.Claims + type Config struct + ContextKey string + CredentialsOptional bool + EnableAuthOnOptions bool + ErrorHandler errorHandler + Expiration bool + Extractor TokenExtractor + SigningMethod jwt.SigningMethod + ValidationKeyGetter jwt.Keyfunc + type MapClaims = jwt.MapClaims + type Middleware struct + Config Config + func New(cfg ...Config) *Middleware + func (m *Middleware) CheckJWT(ctx context.Context) error + func (m *Middleware) Get(ctx context.Context) *jwt.Token + func (m *Middleware) Serve(ctx context.Context) + type Token = jwt.Token + type TokenExtractor func(context.Context) (string, error) + func FromFirst(extractors ...TokenExtractor) TokenExtractor + func FromParameter(param string) TokenExtractor