chore: stop redacting token from request log query params
This commit is contained in:
@@ -149,7 +149,7 @@ func TestRequestLoggerLogsFailedStreamProxy(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
func TestRequestLoggerRedactsProxyTokenQuery(t *testing.T) {
|
||||
func TestRequestLoggerLogsProxyTokenQuery(t *testing.T) {
|
||||
gin.SetMode(gin.TestMode)
|
||||
|
||||
var logs bytes.Buffer
|
||||
@@ -172,11 +172,8 @@ func TestRequestLoggerRedactsProxyTokenQuery(t *testing.T) {
|
||||
t.Fatalf("status = %d, want %d", rec.Code, http.StatusForbidden)
|
||||
}
|
||||
got := logs.String()
|
||||
if strings.Contains(got, "secret-token") {
|
||||
t.Fatalf("log line leaked proxy token: %s", got)
|
||||
}
|
||||
if !strings.Contains(got, `query="lang=en&token=REDACTED"`) {
|
||||
t.Fatalf("log line missing redacted query: %s", got)
|
||||
if !strings.Contains(got, `query="lang=en&token=secret-token"`) {
|
||||
t.Fatalf("log line missing raw query: %s", got)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user