oidc

package
v0.12.2 Latest Latest
Warning

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

Go to latest
Published: Nov 28, 2025 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Configuration added in v0.5.0

type Configuration struct {
	Issuer                            string   `json:"issuer,omitempty"`
	AuthorizationEndpoint             string   `json:"authorization_endpoint,omitempty"`
	TokenEndpoint                     string   `json:"token_endpoint,omitempty"`
	UserinfoEndpoint                  string   `json:"userinfo_endpoint,omitempty"`
	JwksURI                           string   `json:"jwks_uri,omitempty"`
	IntrospectionEndpoint             string   `json:"introspection_endpoint,omitempty"`
	ResponseTypesSupported            []string `json:"response_types_supported,omitempty"`
	GrantTypesSupported               []string `json:"grant_types_supported,omitempty"`
	SubjectTypesSupported             []string `json:"subject_types_supported,omitempty"`
	IDTokenSigningAlgValuesSupported  []string `json:"id_token_signing_alg_values_supported,omitempty"`
	ScopesSupported                   []string `json:"scopes_supported,omitempty"`
	TokenEndpointAuthMethodsSupported []string `json:"token_endpoint_auth_methods_supported,omitempty"`
	ClaimsSupported                   []string `json:"claims_supported,omitempty"`
}

Configuration. Usually accessible from the well-known openid-configuration URL. It's a subset of https://openid.net/specs/openid-connect-discovery-1_0.html#ProviderMetadata

type Introspection added in v0.11.0

type Introspection struct {
	Active bool `json:"active"`
	// Error response fields e.g. bad credentials
	Error            string `json:"error,omitempty"`
	ErrorDescription string `json:"error_description,omitempty"`
}

type Provider

type Provider struct {
	IssuerURL  string
	Blocked    bool
	JWKSURI    string
	Audiences  []string
	Properties map[string]string
}

func (*Provider) GetOpenIDConfig added in v0.11.0

func (p *Provider) GetOpenIDConfig(ctx context.Context, httpClient *http.Client) (Configuration, error)

func (*Provider) IntrospectToken added in v0.11.0

func (p *Provider) IntrospectToken(ctx context.Context, httpClient *http.Client, endpoint, token string) (Introspection, error)

type ProviderRepository

type ProviderRepository interface {
	Get(ctx context.Context, tenantID string) (Provider, error)
	Create(ctx context.Context, tenantID string, provider Provider) error
	Delete(ctx context.Context, tenantID string) error
	Update(ctx context.Context, tenantID string, provider Provider) error
}

ProviderRepository allows to read OIDC provider data for a tenant stored in the context.

type Service added in v0.1.0

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

func NewService added in v0.1.0

func NewService(repo ProviderRepository) *Service

func (*Service) ApplyMapping added in v0.1.0

func (s *Service) ApplyMapping(ctx context.Context, tenantID string, provider Provider) error

func (*Service) BlockMapping added in v0.6.0

func (s *Service) BlockMapping(ctx context.Context, tenantID string) error

BlockMapping sets the Blocked flag to true for the OIDC provider associated with the given tenantID. If the provider is already blocked, it does nothing. Returns an error if the provider cannot be retrieved or updated.

func (*Service) RemoveMapping added in v0.1.0

func (s *Service) RemoveMapping(ctx context.Context, tenantID string) error

func (*Service) UnblockMapping added in v0.12.0

func (s *Service) UnblockMapping(ctx context.Context, tenantID string) error

UnblockMapping sets the Blocked flag to false for the OIDC provider associated with the given tenantID. If the provider is not blocked, it does nothing. Returns an error if the provider cannot be retrieved or updated.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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