From 60f719400ea5c2961a5f86d7f881a1d11b9d531c Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 5 Jun 2026 18:48:43 +0000 Subject: [PATCH] chore: optimize sanitize field normalization --- pkg/api/config/config.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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",