chore: optimize sanitize field normalization

This commit is contained in:
copilot-swe-agent[bot]
2026-06-05 18:48:43 +00:00
committed by GitHub
parent cea72a4c08
commit 60f719400e
+2 -1
View File
@@ -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",