Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DefaultOAuthDisplayName ¶ added in v0.1.1
DefaultOAuthDisplayName returns the login button label for a provider.
func NormalizeOAuthProviderID ¶ added in v0.1.1
Types ¶
type Config ¶
type Config struct {
OAuth OAuthConfig
// AppOrigin is the public URL of the frontend (e.g. http://localhost:5173). When set, invite URLs and OAuth redirects use it; non-API requests to this server return 401 Unauthorized.
AppOrigin string
}
func LoadFromEnv ¶
func LoadFromEnv() *Config
func (*Config) EnabledOAuthProviders ¶
EnabledOAuthProviders returns the list of provider IDs that are configured and enabled.
func (*Config) OAuthProvider ¶
func (c *Config) OAuthProvider(providerID string) *OAuthProviderConfig
OAuthProvider returns the config for a provider ID, or nil if not configured.
type OAuthClientMTLSConfig ¶ added in v0.1.1
type OAuthConfig ¶
type OAuthConfig struct {
Providers map[string]OAuthProviderConfig
}
type OAuthProviderConfig ¶
type OAuthProviderConfig struct {
ClientID string
ClientSecret string // #nosec G117 -- OAuth client secret from config, not logged
Scopes []string
AuthURL string
TokenURL string
UserInfoURL string
UserIDClaim string // JSON claim for provider user id; default "sub"
EmailClaim string // JSON claim for email; default "email"
EmailsURL string // Optional second URL returning a JSON array when email is not on userinfo (e.g. GitHub /user/emails)
EmailsPrimaryClaim string // Claim on array entries marking the preferred email; default "primary"
EmailVerifiedClaim string // Userinfo claim that must be true when email comes from userinfo (e.g. email_verified)
EmailsVerifiedClaim string // Emails-list entry claim that must be true (e.g. verified on GitHub /user/emails)
AllowEmailMatch bool // Allow signing in to an existing account by email alone; default false
DisplayName string // Login/signup button label; default derived from provider id
ClientMTLS OAuthClientMTLSConfig
}
func (OAuthProviderConfig) BuildHTTPClient ¶ added in v0.1.1
func (p OAuthProviderConfig) BuildHTTPClient() (*http.Client, error)
func (OAuthProviderConfig) Enabled ¶ added in v0.1.1
func (p OAuthProviderConfig) Enabled() bool
Click to show internal directories.
Click to hide internal directories.