Skip to content

Commit 7ba52a5

Browse files
committed
test: document synthetic-JWT source pattern in redactSensitive test
Clarify that the JWT string in the redactor test is intentionally fake and is built from parts so the assembled token never appears as a source literal (to satisfy pre-commit secret scanners). Co-authored-by: Isaac Signed-off-by: samikshya-chand_data <samikshya.chand@databricks.com>
1 parent 00a62e8 commit 7ba52a5

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

tests/unit/telemetry/telemetryUtils.test.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -191,8 +191,11 @@ describe('redactSensitive', () => {
191191
});
192192

193193
it('redacts realistic JWT', () => {
194-
// Built from parts so the full token never appears as a source literal —
195-
// otherwise secret scanners flag the test file itself.
194+
// This is NOT a real token — it's a synthetic JWT-shaped string built
195+
// from harmless segments purely to exercise the regex. Constructed by
196+
// string concatenation so the assembled token never appears as a
197+
// source literal (otherwise pre-commit secret scanners, rightly, flag
198+
// the test file itself).
196199
const header = `${'eyJ'}hbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9`;
197200
const payload = `${'eyJ'}zdWIiOiJ0ZXN0LXN1YmplY3QifQ`;
198201
const signature = 'Ab-123_xyz456_abcDEF789';

0 commit comments

Comments
 (0)