fix(cliproxy): redact generic token query params in oauth trace (#1364)

This commit is contained in:
Kai (Tam Nhu) Tran
2026-05-23 21:39:05 -04:00
committed by GitHub
parent 65ced77c4c
commit 9357f4df26
2 changed files with 8 additions and 0 deletions
@@ -85,6 +85,13 @@ describe('redactString', () => {
expect(out).not.toContain('AT_SECRET');
expect(out).toBe(`access_token=${REDACTED_PLACEHOLDER}&keep=1`);
});
test('redacts ampersand-delimited generic token query params', () => {
const out = redactString('access_token=AT_SECRET&token=TOKEN_SECRET');
expect(out).not.toContain('AT_SECRET');
expect(out).not.toContain('TOKEN_SECRET');
expect(out).toBe(`access_token=${REDACTED_PLACEHOLDER}&token=${REDACTED_PLACEHOLDER}`);
});
});
describe('redactUrl', () => {
@@ -10,6 +10,7 @@
const SENSITIVE_QUERY_KEYS = [
'code',
'state',
'token',
'access_token',
'refresh_token',
'id_token',