mirror of
https://github.com/tiennm99/ccs.git
synced 2026-10-13 06:15:03 +00:00
fix(cliproxy): redact generic token query params in oauth trace (#1364)
This commit is contained in:
1 parent
65ced77c4c
commit
9357f4df26
2 files changed
+8
No files matched your search
@@ -85,6 +85,13 @@ describe('redactString', () => {
|
|||||||
expect(out).not.toContain('AT_SECRET');
|
expect(out).not.toContain('AT_SECRET');
|
||||||
expect(out).toBe(`access_token=${REDACTED_PLACEHOLDER}&keep=1`);
|
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', () => {
|
describe('redactUrl', () => {
|
||||||
|
|||||||
@@ -10,6 +10,7 @@
|
|||||||
const SENSITIVE_QUERY_KEYS = [
|
const SENSITIVE_QUERY_KEYS = [
|
||||||
'code',
|
'code',
|
||||||
'state',
|
'state',
|
||||||
|
'token',
|
||||||
'access_token',
|
'access_token',
|
||||||
'refresh_token',
|
'refresh_token',
|
||||||
'id_token',
|
'id_token',
|
||||||
|
|||||||
Reference in new issue
Block a user