diff --git a/pkg/api/config/config.go b/pkg/api/config/config.go index a23c800a..5e75a30c 100644 --- a/pkg/api/config/config.go +++ b/pkg/api/config/config.go @@ -23,6 +23,7 @@ import ( var ( openIDSupportedProviders = [...]string{"google", "gitlab", "oidc"} //nolint: gochecknoglobals oauth2SupportedProviders = [...]string{"github"} //nolint: gochecknoglobals + sensitiveFieldNormalizer = strings.NewReplacer("_", "", "-", "") //nolint: gochecknoglobals ) const redactedSecret = "******" @@ -934,7 +935,7 @@ func redactSecretsInMap(values map[string]any) { } func isSensitiveFieldName(fieldName string) bool { - normalized := strings.NewReplacer("_", "", "-", "").Replace(strings.ToLower(fieldName)) + normalized := sensitiveFieldNormalizer.Replace(strings.ToLower(fieldName)) switch normalized { case "accesskey", "secretkey", "clientsecret", "password", "token", "authorization",