diff options
author | 2021-07-23 10:36:28 +0200 | |
---|---|---|
committer | 2021-07-23 10:36:28 +0200 | |
commit | 05e9af089c3041fa162e4dca3b1c5906496e8e90 (patch) | |
tree | 6972d56a2ab5b5216ba7ec7c951605a775ac1c18 /internal/config/default.go | |
parent | lil webfingy fix (#106) (diff) | |
download | gotosocial-05e9af089c3041fa162e4dca3b1c5906496e8e90.tar.xz |
Oidc (#109)
* add oidc config
* inching forward with oidc idp
* lil webfingy fix
* bit more progress
* further oidc
* oidc now working
* document dex config
* replace broken images
* add additional credits
* tiny doc update
* update
* add oidc config
* inching forward with oidc idp
* bit more progress
* further oidc
* oidc now working
* document dex config
* replace broken images
* add additional credits
* tiny doc update
* update
* document
* docs + comments
Diffstat (limited to 'internal/config/default.go')
-rw-r--r-- | internal/config/default.go | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/internal/config/default.go b/internal/config/default.go index 099eead1c..61940eff4 100644 --- a/internal/config/default.go +++ b/internal/config/default.go @@ -1,5 +1,7 @@ package config +import "github.com/coreos/go-oidc/v3/oidc" + // TestDefault returns a default config for testing func TestDefault() *Config { defaults := GetTestDefaults() @@ -52,6 +54,15 @@ func TestDefault() *Config { CertDir: defaults.LetsEncryptCertDir, EmailAddress: defaults.LetsEncryptEmailAddress, }, + OIDCConfig: &OIDCConfig{ + Enabled: defaults.OIDCEnabled, + IDPName: defaults.OIDCIdpName, + SkipVerification: defaults.OIDCSkipVerification, + Issuer: defaults.OIDCIssuer, + ClientID: defaults.OIDCClientID, + ClientSecret: defaults.OIDCClientSecret, + Scopes: defaults.OIDCScopes, + }, } } @@ -107,6 +118,15 @@ func Default() *Config { CertDir: defaults.LetsEncryptCertDir, EmailAddress: defaults.LetsEncryptEmailAddress, }, + OIDCConfig: &OIDCConfig{ + Enabled: defaults.OIDCEnabled, + IDPName: defaults.OIDCIdpName, + SkipVerification: defaults.OIDCSkipVerification, + Issuer: defaults.OIDCIssuer, + ClientID: defaults.OIDCClientID, + ClientSecret: defaults.OIDCClientSecret, + Scopes: defaults.OIDCScopes, + }, } } @@ -157,6 +177,14 @@ func GetDefaults() Defaults { LetsEncryptEnabled: true, LetsEncryptCertDir: "/gotosocial/storage/certs", LetsEncryptEmailAddress: "", + + OIDCEnabled: false, + OIDCIdpName: "", + OIDCSkipVerification: false, + OIDCIssuer: "", + OIDCClientID: "", + OIDCClientSecret: "", + OIDCScopes: []string{oidc.ScopeOpenID, "profile", "email", "groups"}, } } @@ -204,5 +232,13 @@ func GetTestDefaults() Defaults { LetsEncryptEnabled: false, LetsEncryptCertDir: "", LetsEncryptEmailAddress: "", + + OIDCEnabled: false, + OIDCIdpName: "", + OIDCSkipVerification: false, + OIDCIssuer: "", + OIDCClientID: "", + OIDCClientSecret: "", + OIDCScopes: []string{oidc.ScopeOpenID, "profile", "email", "groups"}, } } |