Skip to content

Commit 206c65c

Browse files
committed
Avoid credential-shaped test fixtures
1 parent 240d085 commit 206c65c

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

dungeon/tests/cli-launcher.mjs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,8 +134,11 @@ exit $LASTEXITCODE
134134
process.env.SEO_DUNGEON_ALLOW_NO_ORIGIN = '1';
135135
assert.equal(bridge.isAllowedOrigin(undefined), true);
136136

137+
const fakeOpenAiKey = 'sk-' + '1234567890abcdefghijklmnopqrstuvwxyz';
138+
const fakeGithubToken = 'ghp_' + '1234567890abcdefghijklmnopqrstuvwxyz123456';
139+
const fakeAwsKey = 'AKIA' + '1234567890ABCDEF';
137140
const redacted = bridge.redactSensitiveText(
138-
'api_key=sk-1234567890abcdefghijklmnopqrstuvwxyz token=ghp_1234567890abcdefghijklmnopqrstuvwxyz123456 AKIA1234567890ABCDEF'
141+
`api_key=${fakeOpenAiKey} token=${fakeGithubToken} ${fakeAwsKey}`
139142
);
140143
assert(!redacted.includes('abcdefghijklmnopqrstuvwxyz123456'), 'GitHub token should be redacted');
141144
assert(!redacted.includes('1234567890ABCDEF'), 'AWS key body should be redacted');

0 commit comments

Comments
 (0)