Versions in this module Expand all Collapse all v1 v1.1.1 May 30, 2019 Changes in this version + var ErrInvalidAlgorithm = errors.New("algorithm is invalid") + var ErrInvalidContentType = errors.New("should have a JSON content type for JWKS endpoint") + var ErrKeyExpired = errors.New("key exists but is expired") + var ErrNilRequest = errors.New("Request nil") + var ErrNoJWTHeaders = errors.New("No headers in the token") + var ErrNoKeyFound = errors.New("no Keys has been found") + var ErrTokenNotFound = errors.New("Token not found") + var MaxCacheSizeNoCheck = -1 + var MaxKeyAgeNoCheck = time.Duration(-1) + func FromHeader(r *http.Request) (*jwt.JSONWebToken, error) + func FromParams(r *http.Request) (*jwt.JSONWebToken, error) + type Configuration struct + func NewConfiguration(provider SecretProvider, audience []string, issuer string, ...) Configuration + func NewConfigurationTrustProvider(provider SecretProvider, audience []string, issuer string) Configuration + type JWKClient struct + func NewJWKClient(options JWKClientOptions, extractor RequestTokenExtractor) *JWKClient + func NewJWKClientWithCache(options JWKClientOptions, extractor RequestTokenExtractor, keyCacher KeyCacher) *JWKClient + func (j *JWKClient) GetKey(ID string) (jose.JSONWebKey, error) + func (j *JWKClient) GetSecret(r *http.Request) (interface{}, error) + type JWKClientOptions struct + Client *http.Client + URI string + type JWKS struct + Keys []jose.JSONWebKey + type JWTValidator struct + func NewValidator(config Configuration, extractor RequestTokenExtractor) *JWTValidator + func (v *JWTValidator) Claims(r *http.Request, token *jwt.JSONWebToken, values ...interface{}) error + func (v *JWTValidator) ValidateRequest(r *http.Request) (*jwt.JSONWebToken, error) + func (v *JWTValidator) ValidateRequestWithLeeway(r *http.Request, leeway time.Duration) (*jwt.JSONWebToken, error) + type KeyCacher interface + Add func(keyID string, webKeys []jose.JSONWebKey) (*jose.JSONWebKey, error) + Get func(keyID string) (*jose.JSONWebKey, error) + func NewMemoryKeyCacher(maxKeyAge time.Duration, maxCacheSize int) KeyCacher + type RequestTokenExtractor interface + Extract func(r *http.Request) (*jwt.JSONWebToken, error) + func FromMultiple(extractors ...RequestTokenExtractor) RequestTokenExtractor + type RequestTokenExtractorFunc func(r *http.Request) (*jwt.JSONWebToken, error) + func (f RequestTokenExtractorFunc) Extract(r *http.Request) (*jwt.JSONWebToken, error) + type SecretProvider interface + GetSecret func(r *http.Request) (interface{}, error) + func NewKeyProvider(key interface{}) SecretProvider + type SecretProviderFunc func(*http.Request) (interface{}, error) + func (f SecretProviderFunc) GetSecret(r *http.Request) (interface{}, error)