Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrInvalidURL returned when input url has invalid format. ErrInvalidURL = errors.New("jwks: invalid url value or format") // ErrInvalidNumRetries returned when number of retries is zero. ErrInvalidNumRetries = errors.New("jwks: invalid number of retries") // ErrKeyIDNotProvided returned when input kid is not present. ErrKeyIDNotProvided = errors.New("jwks: kid is not provided") // ErrPublicKeyNotFound returned when no public key is found. ErrPublicKeyNotFound = errors.New("jwks: public key not found") )
View Source
var ( // ErrCacheNotFound returned when cache value not found. ErrCacheNotFound = errors.New("cache: value not found") )
Functions ¶
This section is empty.
Types ¶
type Manager ¶
type Manager struct {
// contains filtered or unexported fields
}
Manager fetches and returns JWK from public source.
func NewManager ¶
NewManager returns a new instance of Manager.
type Option ¶
type Option func(m *Manager)
Option is used for configuring key manager.
func WithHTTPClient ¶
WithHTTPClient sets custom http client. By default client with 1 sec timeout used.
func WithMaxRetries ¶
WithMaxRetries defines max retries count if request has been failed. Default is 2.
func WithUseCache ¶
WithUseCache defines useCache option. Default is true.
type TTLCache ¶
type TTLCache struct {
// contains filtered or unexported fields
}
TTLCache is a TTL bases in-memory cache.
func NewTTLCache ¶
NewTTLCache returns a new instance of ttl cache.
Click to show internal directories.
Click to hide internal directories.