Replace PAT auth with GitHub App for production servers#39
Merged
jonathonbyrdziak merged 1 commit intomasterfrom Mar 20, 2026
Merged
Replace PAT auth with GitHub App for production servers#39jonathonbyrdziak merged 1 commit intomasterfrom
jonathonbyrdziak merged 1 commit intomasterfrom
Conversation
GitHub Apps belong to the org, not an individual. When a developer leaves, access stays intact — no more production outages from revoked personal tokens. Flow: CLI generates a pre-configured manifest URL → user clicks to create app → installs on repo → provides App ID + private key → CLI generates JWT, verifies installation, and configures git credentials. Adds GitHubApp helper with JWT signing, installation token generation, and credential management. Tokens auto-expire (1 hour) and can be refreshed via GitHubApp::refreshGitCredentials(). Co-Authored-By: Claude Opus 4.6 <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.
Summary
GitHubApphelper handles JWT signing, installation token generation, and credential refreshFlow
protocol init→ production → enter private repo URL → access failshttps://github.com/organizations/{org}/settings/apps/new?manifest=...~/.protocol/.node/(github-app.json + github-app.pem, 0600)Files
src/Helpers/GitHubApp.php— JWT, installation tokens, credential managementsrc/Commands/ProtocolInit.php—flowGitAuthuses GitHub App instead of PATTest plan
protocol init→ production → private repo URL the server can't access~/.protocol/.node/github-app.jsonand.pem🤖 Generated with Claude Code