fix(phase-1): redact API key query params from log output and add mutex thread-safety to providers map

This commit is contained in:
newkirk
2026-07-21 13:18:31 -04:00
parent 84a18f5866
commit 42b70621a1
6 changed files with 277 additions and 17 deletions
+9
View File
@@ -5,11 +5,20 @@ import (
"encoding/json"
"fmt"
"io"
"regexp"
"strings"
"gophergate/internal/models"
)
var keySanitizeRegex = regexp.MustCompile(`(?i)(key|api_key|secret)=[^&]+`)
// SanitizeURL strips sensitive key query parameters from URLs before logging.
func SanitizeURL(rawURL string) string {
return keySanitizeRegex.ReplaceAllString(rawURL, "$1=REDACTED")
}
func sanitizeFunctionName(name string) string {
var sb strings.Builder
for _, ch := range name {