From 05e9af089c3041fa162e4dca3b1c5906496e8e90 Mon Sep 17 00:00:00 2001 From: Tobi Smethurst <31960611+tsmethurst@users.noreply.github.com> Date: Fri, 23 Jul 2021 10:36:28 +0200 Subject: 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 --- internal/config/default.go | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) (limited to 'internal/config/default.go') 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"}, } } -- cgit v1.2.3