Documentation ¶
Index ¶
- Variables
- func KeyFunc(jwks *JSONWebKeySet) func(token *jwt.Token) (interface{}, error)
- type Client
- func (c *Client) GetSigningKey(kid string) (*JSONWebKey, error)
- func (c *Client) IsValid(tokenString string) (bool, *jwt.Token, error)
- func (c *Client) KeySet() *JSONWebKeySet
- func (c *Client) Keys() []JSONWebKey
- func (c *Client) Parse(tokenString string) (*jwt.Token, error)
- func (c *Client) Start() error
- func (c *Client) Stop()
- type ClientOptions
- type JSONWebKey
- type JSONWebKeySet
- type Logger
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrKidNotFound = errors.New("kid was not found in the jwks")
ErrKidNotFound kid was not found
Functions ¶
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client fetches a JWKS from specified endpoint
func NewClient ¶
func NewClient(endpoint string, options *ClientOptions) *Client
NewClient creates a new JWKS client
func (*Client) GetSigningKey ¶
func (c *Client) GetSigningKey(kid string) (*JSONWebKey, error)
GetSigningKey gets the verification key
type ClientOptions ¶
type ClientOptions struct { Insecure bool CacheTimeout *time.Duration RequestTimeout *time.Duration Logger Logger }
ClientOptions options for client
type JSONWebKey ¶
type JSONWebKey struct { Kid string `json:"kid"` Kty string `json:"kty"` Alg string `json:"alg"` Use string `json:"use"` X5c []string `json:"x5c"` X5t string `json:"x5t"` N string `json:"n"` E string `json:"e"` }
JSONWebKey a json web key
func GetSigningKey ¶
func GetSigningKey(kid string, jwks *JSONWebKeySet) (*JSONWebKey, error)
GetSigningKey gets the signing key from the kid
type JSONWebKeySet ¶
type JSONWebKeySet struct {
Keys []JSONWebKey `json:"keys"`
}
JSONWebKeySet a json web key set
Click to show internal directories.
Click to hide internal directories.