Repository navigation
[deployment] Remove hardcoded GitHub token from demo gallery - #22
Merged
Merged
Conversation
The gallery embedded a GitHub personal access token in front-end code, which shipped in the public JS bundle and granted write access to every public repo its owner could push to. The token has been revoked. The gallery only reads the public planimation/documentation repo, so no authentication is needed. It now makes a single unauthenticated Git Trees API request and loads files from raw.githubusercontent.com, which stays within the anonymous rate limit (previously 21 API calls per open). Also adds a CI secret-scan workflow that rejects GitHub token prefixes (including tokens split across concatenated strings) and runs gitleaks. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> (cherry picked from commit 12e51eb)
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.
Cherry-pick of the main fix onto
deployment.Summary
DemoCards.jsxandDemoCard.jsx. It was shipped in the public JS bundle and reported by the university security team. The token has already been revoked.planimation/documentationrepo, so it now uses one unauthenticated Git Trees API request plusraw.githubusercontent.comfile fetches. That is 1 API call per gallery open instead of 21, which stays within the 60/hour anonymous limit.Secret scanworkflow: it fails on GitHub token prefixes (including split strings like"ghp_…" + "…") and runs gitleaks on the working tree.Test plan
npm run buildsucceeds;build/contains noghp_/github_pat_🤖 Generated with Claude Code