Problem
i added credential redaction to verbose HTTP dumps. It works for Authorization headers but misses both places where secrets actually appear.
Leak 1 Keycloak token response (keycloak_client.go:96)
The response body is JSON. The regex expects name=value (form encoding), so "access_token":"eyJ..." prints verbatim.
Leak 2 create-test request body (microcks_client.go:371)
OAuth2ClientContext is marshalled into the POST body. Fields clientSecret, password, and refreshToken aren't in the pattern at all.
The header redaction fires correctly, which is exactly what makes this easy to miss:
Authorization: [REDACTED] ← works
{"oAuth2Context":{"clientSecret":"SECRET","password":"SECRET",...}} ← leaks
Root Cause
// only matches name=value — never fires on JSON bodies
var sensitiveParamPattern = regexp.MustCompile(
`(?i)(access_token|refresh_token|id_token|code)=([^&\s]+)`,
)
Apply it alongside the existing patterns in redactSensitiveContent.
Reproduce
Drop into pkg/config/redact_probe_test.go and run go test ./pkg/config/ -run TestRedactProbe -v — 6 FAILs, all confirmed against the real function.
Problem
i added credential redaction to verbose HTTP dumps. It works for
Authorizationheaders but misses both places where secrets actually appear.Leak 1 Keycloak token response (
keycloak_client.go:96)The response body is JSON. The regex expects
name=value(form encoding), so"access_token":"eyJ..."prints verbatim.Leak 2 create-test request body (
microcks_client.go:371)OAuth2ClientContextis marshalled into the POST body. FieldsclientSecret,password, andrefreshTokenaren't in the pattern at all.The header redaction fires correctly, which is exactly what makes this easy to miss:
Root Cause
Apply it alongside the existing patterns in
redactSensitiveContent.Reproduce
Drop into
pkg/config/redact_probe_test.goand rungo test ./pkg/config/ -run TestRedactProbe -v— 6 FAILs, all confirmed against the real function.