Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( // Error is the default error class for the package. Error = errs.Class("sso") )
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct { Enabled bool `help:"whether SSO is enabled." default:"false"` OidcProviderInfos OidcProviderInfos `help:"semicolon-separated provider:client-id,client-secret,provider-url." default:""` EmailProviderMappings EmailProviderMappings `help:"semicolon-separated provider:email-regex as provided in oidc-provider-infos." default:""` }
Config is a configuration struct for SSO.
type EmailProviderMappings ¶
EmailProviderMappings is a map of sso provider to email regex.
func (*EmailProviderMappings) Set ¶
func (epm *EmailProviderMappings) Set(s string) error
Set email provider mappings to a provided parsed string.
func (*EmailProviderMappings) String ¶
func (epm *EmailProviderMappings) String() string
func (EmailProviderMappings) Type ¶
func (EmailProviderMappings) Type() string
Type returns the type of the pflag.Value.
type OidcProviderInfo ¶
OidcProviderInfo contains the information needed to connect to an OIDC provider.
type OidcProviderInfos ¶
type OidcProviderInfos struct {
Values map[string]OidcProviderInfo
}
OidcProviderInfos is a map of SSO providers to OIDC provider infos.
func (*OidcProviderInfos) Set ¶
func (si *OidcProviderInfos) Set(s string) error
Set OIDC provider infos to the parsed string.
func (*OidcProviderInfos) String ¶
func (si *OidcProviderInfos) String() string
func (OidcProviderInfos) Type ¶
func (OidcProviderInfos) Type() string
Type returns the type of the pflag.Value.
type OidcSetup ¶
type OidcSetup struct { Config oauth2.Config Verifier *goOIDC.IDTokenVerifier }
OidcSetup contains the configuration and verifier for an OIDC provider.
type OidcSsoClaims ¶
type OidcSsoClaims struct { Sub string `json:"sub"` Email string `json:"email"` Name string `json:"name"` }
OidcSsoClaims holds info for OIDC token claims.
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
Service is a Service for managing SSO.
func NewService ¶
NewService creates a new Service.
func (*Service) GetOidcSetupByProvider ¶
GetOidcSetupByProvider returns the OIDC setup for the given provider.
func (*Service) GetProviderByEmail ¶
GetProviderByEmail returns the provider for the given email.
func (*Service) Initialize ¶
Initialize initializes the OIDC providers.
func (*Service) InitializeRoutes ¶
InitializeRoutes provides a routingFn with configured providers to configure the routes for sso.