further oidc

This commit is contained in:
tsmethurst 2021-07-22 11:52:17 +02:00
commit 81206d93f3
14 changed files with 227 additions and 70 deletions

View file

@ -275,10 +275,6 @@ func (c *Config) ParseCLIFlags(f KeyedFlags, version string) error {
c.OIDCConfig.Enabled = f.Bool(fn.OIDCEnabled)
}
if c.OIDCConfig.IDPID == "" || f.IsSet(fn.OIDCIdpID) {
c.OIDCConfig.IDPID = f.String(fn.OIDCIdpID)
}
if c.OIDCConfig.IDPName == "" || f.IsSet(fn.OIDCIdpName) {
c.OIDCConfig.IDPName = f.String(fn.OIDCIdpName)
}
@ -372,7 +368,6 @@ type Flags struct {
LetsEncryptEmailAddress string
OIDCEnabled string
OIDCIdpID string
OIDCIdpName string
OIDCSkipVerification string
OIDCIssuer string
@ -429,7 +424,6 @@ type Defaults struct {
LetsEncryptEmailAddress string
OIDCEnabled bool
OIDCIdpID string
OIDCIdpName string
OIDCSkipVerification bool
OIDCIssuer string
@ -487,7 +481,6 @@ func GetFlagNames() Flags {
LetsEncryptEmailAddress: "letsencrypt-email",
OIDCEnabled: "oidc-enabled",
OIDCIdpID: "oidc-idp-id",
OIDCIdpName: "oidc-idp-name",
OIDCSkipVerification: "oidc-skip-verification",
OIDCIssuer: "oidc-issuer",
@ -546,7 +539,6 @@ func GetEnvNames() Flags {
LetsEncryptEmailAddress: "GTS_LETSENCRYPT_EMAIL",
OIDCEnabled: "GTS_OIDC_ENABLED",
OIDCIdpID: "GTS_OIDC_IDP_ID",
OIDCIdpName: "GTS_OIDC_IDP_NAME",
OIDCSkipVerification: "GTS_OIDC_SKIP_VERIFICATION",
OIDCIssuer: "GTS_OIDC_ISSUER",

View file

@ -56,7 +56,6 @@ func TestDefault() *Config {
},
OIDCConfig: &OIDCConfig{
Enabled: defaults.OIDCEnabled,
IDPID: defaults.OIDCIdpID,
IDPName: defaults.OIDCIdpName,
SkipVerification: defaults.OIDCSkipVerification,
Issuer: defaults.OIDCIssuer,
@ -121,7 +120,6 @@ func Default() *Config {
},
OIDCConfig: &OIDCConfig{
Enabled: defaults.OIDCEnabled,
IDPID: defaults.OIDCIdpID,
IDPName: defaults.OIDCIdpName,
SkipVerification: defaults.OIDCSkipVerification,
Issuer: defaults.OIDCIssuer,
@ -181,7 +179,6 @@ func GetDefaults() Defaults {
LetsEncryptEmailAddress: "",
OIDCEnabled: false,
OIDCIdpID: "",
OIDCIdpName: "",
OIDCSkipVerification: false,
OIDCIssuer: "",
@ -235,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"},
}
}

View file

@ -21,7 +21,6 @@ package config
// OIDCConfig contains configuration values for openID connect (oauth) authorization by an external service such as Dex.
type OIDCConfig struct {
Enabled bool `yaml:"enabled"`
IDPID string `yaml:"idpId"`
IDPName string `yaml:"idpName"`
SkipVerification bool `yaml:"skipVerification"`
Issuer string `yaml:"issuer"`