Repository navigation
test: build fake token fixtures at run time and block whole tokens in CI - #464
Merged
Merged
Conversation
Scrubber fixtures held whole token-shaped strings (GitHub, Google, Stripe, npm, GitLab, Slack, Discord). They are fake, but GitHub secret scanning raised a public-leak alert and they invite a closer look at the repo. - fakeSecret(prefix, body) helpers in core and desktop tests build each value at run time, so the source never holds a whole token. - scripts/check-token-literals.mjs fails the validate job when a tracked file contains one, printing file, line and kind but never the value. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
GitHub secret scanning opened a public-leak alert (Google API key) on a scrubber test fixture. None of the fixtures are real credentials, but whole token-shaped strings in a public repo look like leaks to scanners and to anyone probing the repo.
What
fakeSecret(prefix, body)test helpers (packages/core/__tests__/helpers/fake-secret.ts,apps/desktop/src/test-utils/fake-secret.ts) build each fake token at run time. Tests see the same strings; the source never holds a whole one.scripts/check-token-literals.mjsruns in thevalidatejob and fails on any whole token in tracked files. It reports file, line and kind, never the value.Verification
After merge
The old strings stay in git history, so alert #1 stays open until closed by hand: close it as Used in tests. Rewriting public history is not worth it; forks and caches already have it.
🤖 Generated with Claude Code