Update auf Skills
This commit is contained in:
@@ -214,7 +214,7 @@ func sanitizeValue(v any, max int) any {
|
||||
}
|
||||
}
|
||||
func secretKey(k string) bool {
|
||||
for _, s := range []string{"password", "passwd", "authorization", "api_key", "apikey", "secret", "bearer", "cookie"} {
|
||||
for _, s := range []string{"password", "passwd", "authorization", "api_key", "apikey", "secret", "token", "bearer", "cookie"} {
|
||||
if strings.Contains(k, s) {
|
||||
return true
|
||||
}
|
||||
|
||||
@@ -13,7 +13,7 @@ func TestLoggerWritesTraceAndRedactsSecrets(t *testing.T) {
|
||||
t.Fatal(err)
|
||||
}
|
||||
ctx := WithTrace(context.Background(), "trace_test")
|
||||
l.Record(ctx, "planner", "request", "input", "info", map[string]any{"message": "Montag Nudeln", "authorization": "Bearer secret"}, nil, 0)
|
||||
l.Record(ctx, "planner", "request", "input", "info", map[string]any{"message": "Montag Nudeln", "authorization": "Bearer secret", "enrollment_token": "mesh-bootstrap-secret", "access_token": "worker-session-secret"}, nil, 0)
|
||||
evs, err := l.Events(10)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
@@ -30,7 +30,7 @@ func TestLoggerWritesTraceAndRedactsSecrets(t *testing.T) {
|
||||
}
|
||||
b, _ := json.Marshal(ev.Data)
|
||||
s := string(b)
|
||||
if strings.Contains(s, "Bearer secret") || !strings.Contains(s, "REDACTED") {
|
||||
if strings.Contains(s, "Bearer secret") || strings.Contains(s, "mesh-bootstrap-secret") || strings.Contains(s, "worker-session-secret") || !strings.Contains(s, "REDACTED") {
|
||||
t.Fatalf("secret not redacted: %s", s)
|
||||
}
|
||||
if !strings.Contains(s, "Montag Nudeln") {
|
||||
|
||||
Reference in New Issue
Block a user