diff options
Diffstat (limited to 'utils/config.go')
-rw-r--r-- | utils/config.go | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/utils/config.go b/utils/config.go index e8fa9a477..6a428a5c1 100644 --- a/utils/config.go +++ b/utils/config.go @@ -32,6 +32,15 @@ type ServiceSettings struct { StorageDirectory string } +type SSOSetting struct { + Allow bool + Secret string + Id string + AuthEndpoint string + TokenEndpoint string + UserApiEndpoint string +} + type SqlSettings struct { DriverName string DataSource string @@ -109,6 +118,7 @@ type Config struct { EmailSettings EmailSettings PrivacySettings PrivacySettings TeamSettings TeamSettings + SSOSettings map[string]SSOSetting } func (o *Config) ToJson() string { @@ -243,3 +253,14 @@ func IsS3Configured() bool { return true } + +func GetAllowedAuthServices() []string { + authServices := []string{} + for name, service := range Cfg.SSOSettings { + if service.Allow { + authServices = append(authServices, name) + } + } + + return authServices +} |