Documentation ¶
Overview ¶
Package jwks provides helpers for working with json key sets.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type KeyProvider ¶
type KeyProvider interface { // allow users to stop any background process in a key provider. io.Closer // LookupKey should return a PublicKey based on the given key ID. Return an error if not // found or any other error. LookupKey(ctx context.Context, kid string) (*rsa.PublicKey, error) // Fetch returns the full KeySet as a cloned keyset, any modifcations are only applied locally. Fetch(ctx context.Context) (KeySet, error) }
KeyProvider provides an interface to lookup keys based on a key ID. Providers may have a background process to refresh keys and allows it to be closed.
func NewCachingOIDCJWKKeyProvider ¶
func NewCachingOIDCJWKKeyProvider(ctx context.Context, baseURL string) (KeyProvider, error)
NewCachingOIDCJWKKeyProvider creates a CachingKeyProvider based on the auth0 url and starts the auto refresh. must call CachingKeyProvider.Stop() to stop background goroutine. Use {baseUrl}.well-known/jwks.json.
func NewStaticJWKKeyProvider ¶
func NewStaticJWKKeyProvider(keyset KeySet) KeyProvider
NewStaticJWKKeyProvider create static key provider based on the keyset given.
Click to show internal directories.
Click to hide internal directories.