[agent/codex:gpt-5.4-mini] Read ~/spec/code/core/go/log/RFC.md fully. Find ONE feature ... #17
2 changed files with 4 additions and 4 deletions
2
log.go
2
log.go
|
|
@ -489,7 +489,7 @@ func Security(msg string, keyvals ...any) {
|
|||
func shouldRedact(key any, redactKeys []string) bool {
|
||||
keyStr := fmt.Sprintf("%v", key)
|
||||
for _, redactKey := range redactKeys {
|
||||
if strings.EqualFold(redactKey, keyStr) {
|
||||
if redactKey == keyStr {
|
||||
return true
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -170,7 +170,7 @@ func TestLogger_Redaction_Good(t *testing.T) {
|
|||
}
|
||||
}
|
||||
|
||||
func TestLogger_Redaction_Good_CaseInsensitiveKeys(t *testing.T) {
|
||||
func TestLogger_Redaction_Bad_CaseMismatchNotRedacted(t *testing.T) {
|
||||
var buf bytes.Buffer
|
||||
l := New(Options{
|
||||
Level: LevelInfo,
|
||||
|
|
@ -181,8 +181,8 @@ func TestLogger_Redaction_Good_CaseInsensitiveKeys(t *testing.T) {
|
|||
l.Info("login", "PASSWORD", "secret123")
|
||||
|
||||
output := buf.String()
|
||||
if !strings.Contains(output, "PASSWORD=\"[REDACTED]\"") {
|
||||
t.Errorf("expected case-insensitive redaction, got %q", output)
|
||||
if !strings.Contains(output, "PASSWORD=\"secret123\"") {
|
||||
t.Errorf("expected case-mismatched key to remain visible, got %q", output)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue