handler

package
v0.11.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 13, 2026 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidToken = errors.New("invalid token")
	ErrNoProvider   = errors.New("no provider")
)

Functions

This section is empty.

Types

type OIDC

type OIDC struct {
	// contains filtered or unexported fields
}

OIDC tracks the set of identity providers to support multi tenancy.

func NewOIDC

func NewOIDC(opts ...OIDCOption) (*OIDC, error)

NewOIDC creates a new handler and applies the given options.

func (*OIDC) ParseAndValidate

func (handler *OIDC) ParseAndValidate(ctx context.Context, rawToken, tenantID string, userclaims any, useCache bool) error

func (*OIDC) ProviderFor

func (handler *OIDC) ProviderFor(ctx context.Context, issuer, jwksURI, tenantID string) (*oidc.Provider, error)

ProviderFor returns the provider for the given issuer/jwksURI.

func (*OIDC) RegisterStaticProvider

func (handler *OIDC) RegisterStaticProvider(provider *oidc.Provider)

RegisterStaticProvider registers a provider with the handler.

type OIDCOption

type OIDCOption func(*OIDC) error

OIDCOption is used to configure a handler.

func WithFeatureGates

func WithFeatureGates(fg *commoncfg.FeatureGates) OIDCOption

func WithIssuerClaimKeys

func WithIssuerClaimKeys(issuerClaimKeys ...string) OIDCOption

WithIssuerClaimKeys configures the behavior of a certain provider.

func WithProviderCacheExpiration

func WithProviderCacheExpiration(expiration, cleanup time.Duration) OIDCOption

WithProviderCacheExpiration configures the expiration of cached providers.

func WithSessionManager

func WithSessionManager(sm *session.Manager) OIDCOption

func WithStaticProvider

func WithStaticProvider(provider *oidc.Provider) OIDCOption

WithStaticProvider registers the given provider.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL