Documentation
¶
Index ¶
- Variables
- type Configurer
- type OptionJWK
- type OptionParser
- type Provider
- func (p *Provider) ActiveProvider() (Configurer, error)
- func (p *Provider) GetJwks(ctx context.Context, opts ...OptionJWK) (*keyfunc.JWKS, error)
- func (p *Provider) Parser(ctx context.Context, opts ...OptionParser) (func(string, jwt.Claims) (*jwt.Token, error), func(), error)
- func (p *Provider) RoundTripper(ctx context.Context, transport http.RoundTripper) (http.RoundTripper, error)
- func (p *Provider) RoundTripperMust(ctx context.Context, transport http.RoundTripper) http.RoundTripper
- func (p Provider) SetActiveProvider(name string) *Provider
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrTokenInvalid = fmt.Errorf("token is invalid")
Functions ¶
This section is empty.
Types ¶
type Configurer ¶
type Configurer interface {
Config() (*clientcredentials.Config, error)
// CertURL returns the certificate URL and the public key-id.
CertURL() (string, error)
}
type OptionJWK ¶
type OptionJWK func(options *optionsJWK)
func WithRefreshErrorHandler ¶
func WithRefreshInterval ¶ added in v0.2.0
WithRefreshInterval sets the refresh interval for the jwt.Keyfunc default is 5 minutes.
func WithRefreshUnknownKID ¶ added in v0.2.0
type OptionParser ¶
type OptionParser func(options *optionsParser)
func WithJwt ¶
func WithJwt() OptionParser
type Provider ¶
func (*Provider) ActiveProvider ¶
func (p *Provider) ActiveProvider() (Configurer, error)
ActiveProvider returns the active provider or the first provider if none is active.
func (*Provider) Parser ¶
func (p *Provider) Parser(ctx context.Context, opts ...OptionParser) (func(string, jwt.Claims) (*jwt.Token, error), func(), error)
Parser returns a function to parse a token and a function to stop the background refresh certs.
func (*Provider) RoundTripper ¶
func (p *Provider) RoundTripper(ctx context.Context, transport http.RoundTripper) (http.RoundTripper, error)
RoundTripper returns a new RoundTripper that adds an OAuth2 Authorization header.
func (*Provider) RoundTripperMust ¶
func (p *Provider) RoundTripperMust(ctx context.Context, transport http.RoundTripper) http.RoundTripper
func (Provider) SetActiveProvider ¶
SetActiveProvider return the provider with the given name as active without modifying the original provider.
Click to show internal directories.
Click to hide internal directories.