diff options
author | =Corey Hulen <corey@hulen.com> | 2015-07-23 09:22:17 -0800 |
---|---|---|
committer | =Corey Hulen <corey@hulen.com> | 2015-07-23 09:22:17 -0800 |
commit | 8d9449c068902f51a97e7a6605cd226bf4a26f2e (patch) | |
tree | eade41f7f9138de4f156016af9476486c227abec /utils | |
parent | c277a98b5d88c81df39f8e33ef1286f72ac04014 (diff) | |
parent | a9d48ff994cd2d03f8e1b2438e50fc6dd0d9bdc2 (diff) | |
download | chat-8d9449c068902f51a97e7a6605cd226bf4a26f2e.tar.gz chat-8d9449c068902f51a97e7a6605cd226bf4a26f2e.tar.bz2 chat-8d9449c068902f51a97e7a6605cd226bf4a26f2e.zip |
Merge branch 'master' into mm-1420
Diffstat (limited to 'utils')
-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 +} |