diff --git a/auth/config/config.go b/auth/config/config.go index cf3db725d..dc2ddd41d 100644 --- a/auth/config/config.go +++ b/auth/config/config.go @@ -207,8 +207,8 @@ type UserAuthConfig struct { // Possibly add basicAuth & SAML/p support. // Secret names, defaults are set in DefaultConfig variable above but are possible to override through configs. - CookieHashKeySecretName string `json:"cookie_hash_key_secret_name" pflag:",OPTIONAL: Secret name to use for cookie hash key."` - CookieBlockKeySecretName string `json:"cookie_block_key_secret_name" pflag:",OPTIONAL: Secret name to use for cookie block key."` + CookieHashKeySecretName string `json:"cookieHashKeySecretName" pflag:",OPTIONAL: Secret name to use for cookie hash key."` + CookieBlockKeySecretName string `json:"cookieBlockKeySecretName" pflag:",OPTIONAL: Secret name to use for cookie block key."` } type OpenIDOptions struct { diff --git a/auth/config/config_flags.go b/auth/config/config_flags.go index abb6a00e2..7393422fe 100755 --- a/auth/config/config_flags.go +++ b/auth/config/config_flags.go @@ -53,8 +53,8 @@ func (cfg Config) GetPFlagSet(prefix string) *pflag.FlagSet { cmdFlags.String(fmt.Sprintf("%v%v", prefix, "userAuth.openId.clientSecretFile"), DefaultConfig.UserAuth.OpenID.DeprecatedClientSecretFile, "") cmdFlags.String(fmt.Sprintf("%v%v", prefix, "userAuth.openId.baseUrl"), DefaultConfig.UserAuth.OpenID.BaseURL.String(), "") cmdFlags.StringSlice(fmt.Sprintf("%v%v", prefix, "userAuth.openId.scopes"), []string{}, "") - cmdFlags.String(fmt.Sprintf("%v%v", prefix, "userAuth.cookie_hash_key_secret_name"), DefaultConfig.UserAuth.CookieHashKeySecretName, "OPTIONAL: Secret name to use for cookie hash key.") - cmdFlags.String(fmt.Sprintf("%v%v", prefix, "userAuth.cookie_block_key_secret_name"), DefaultConfig.UserAuth.CookieBlockKeySecretName, "OPTIONAL: Secret name to use for cookie block key.") + cmdFlags.String(fmt.Sprintf("%v%v", prefix, "userAuth.cookieHashKeySecretName"), DefaultConfig.UserAuth.CookieHashKeySecretName, "OPTIONAL: Secret name to use for cookie hash key.") + cmdFlags.String(fmt.Sprintf("%v%v", prefix, "userAuth.cookieBlockKeySecretName"), DefaultConfig.UserAuth.CookieBlockKeySecretName, "OPTIONAL: Secret name to use for cookie block key.") cmdFlags.String(fmt.Sprintf("%v%v", prefix, "appAuth.selfAuthServer.issuer"), DefaultConfig.AppAuth.SelfAuthServer.Issuer, "Defines the issuer to use when issuing and validating tokens. The default value is https:///") cmdFlags.String(fmt.Sprintf("%v%v", prefix, "appAuth.selfAuthServer.accessTokenLifespan"), DefaultConfig.AppAuth.SelfAuthServer.AccessTokenLifespan.String(), "Defines the lifespan of issued access tokens.") cmdFlags.String(fmt.Sprintf("%v%v", prefix, "appAuth.selfAuthServer.refreshTokenLifespan"), DefaultConfig.AppAuth.SelfAuthServer.RefreshTokenLifespan.String(), "Defines the lifespan of issued access tokens.") diff --git a/auth/config/config_flags_test.go b/auth/config/config_flags_test.go index 11aa3689c..b01217867 100755 --- a/auth/config/config_flags_test.go +++ b/auth/config/config_flags_test.go @@ -363,10 +363,10 @@ func TestConfig_SetFlags(t *testing.T) { } }) }) - t.Run("Test_userAuth.cookie_hash_key_secret_name", func(t *testing.T) { + t.Run("Test_userAuth.cookieHashKeySecretName", func(t *testing.T) { t.Run("DefaultValue", func(t *testing.T) { // Test that default value is set properly - if vString, err := cmdFlags.GetString("userAuth.cookie_hash_key_secret_name"); err == nil { + if vString, err := cmdFlags.GetString("userAuth.cookieHashKeySecretName"); err == nil { assert.Equal(t, string(DefaultConfig.UserAuth.CookieHashKeySecretName), vString) } else { assert.FailNow(t, err.Error()) @@ -376,8 +376,8 @@ func TestConfig_SetFlags(t *testing.T) { t.Run("Override", func(t *testing.T) { testValue := "1" - cmdFlags.Set("userAuth.cookie_hash_key_secret_name", testValue) - if vString, err := cmdFlags.GetString("userAuth.cookie_hash_key_secret_name"); err == nil { + cmdFlags.Set("userAuth.cookieHashKeySecretName", testValue) + if vString, err := cmdFlags.GetString("userAuth.cookieHashKeySecretName"); err == nil { testDecodeJson_Config(t, fmt.Sprintf("%v", vString), &actual.UserAuth.CookieHashKeySecretName) } else { @@ -385,10 +385,10 @@ func TestConfig_SetFlags(t *testing.T) { } }) }) - t.Run("Test_userAuth.cookie_block_key_secret_name", func(t *testing.T) { + t.Run("Test_userAuth.cookieBlockKeySecretName", func(t *testing.T) { t.Run("DefaultValue", func(t *testing.T) { // Test that default value is set properly - if vString, err := cmdFlags.GetString("userAuth.cookie_block_key_secret_name"); err == nil { + if vString, err := cmdFlags.GetString("userAuth.cookieBlockKeySecretName"); err == nil { assert.Equal(t, string(DefaultConfig.UserAuth.CookieBlockKeySecretName), vString) } else { assert.FailNow(t, err.Error()) @@ -398,8 +398,8 @@ func TestConfig_SetFlags(t *testing.T) { t.Run("Override", func(t *testing.T) { testValue := "1" - cmdFlags.Set("userAuth.cookie_block_key_secret_name", testValue) - if vString, err := cmdFlags.GetString("userAuth.cookie_block_key_secret_name"); err == nil { + cmdFlags.Set("userAuth.cookieBlockKeySecretName", testValue) + if vString, err := cmdFlags.GetString("userAuth.cookieBlockKeySecretName"); err == nil { testDecodeJson_Config(t, fmt.Sprintf("%v", vString), &actual.UserAuth.CookieBlockKeySecretName) } else {