34 lines
912 B
Go
Raw Normal View History

2025-02-21 18:42:56 +01:00
package config
type Auth struct {
2025-02-22 09:42:15 +01:00
Providers AuthProviders `envPrefix:"PROVIDERS_"`
2025-02-21 18:42:56 +01:00
}
type AuthProviders struct {
Google OAuth2Provider `envPrefix:"GOOGLE_"`
Github OAuth2Provider `envPrefix:"GITHUB_"`
2025-02-22 09:42:15 +01:00
Gitea GiteaProvider `envPrefix:"GITEA_"`
2025-02-21 18:42:56 +01:00
OIDC OIDCProvider `envPrefix:"OIDC_"`
}
type OAuth2Provider struct {
Key string `env:"KEY,expand"`
Secret string `env:"SECRET,expand"`
2025-02-22 09:42:15 +01:00
Scopes []string `env:"SCOPES,expand"`
2025-02-21 18:42:56 +01:00
}
type OIDCProvider struct {
OAuth2Provider
DiscoveryURL string `env:"DISCOVERY_URL,expand"`
Icon string `env:"ICON,expand" envDefault:"fa-passport"`
Label string `env:"LABEL,expand" envDefault:"OpenID Connect"`
}
2025-02-22 09:42:15 +01:00
type GiteaProvider struct {
OAuth2Provider
TokenURL string `env:"TOKEN_URL,expand"`
AuthURL string `env:"AUTH_URL,expand"`
ProfileURL string `env:"PROFILE_URL,expand"`
Label string `env:"LABEL,expand" envDefault:"Gitea"`
}