feat: tok mint — generate GitHub App installation tokens locally#480
Merged
Conversation
Adds tok mint subcommand to generate short-lived ghs_ tokens from a GitHub App stored in Keychain. Includes: - _tok_mint(): main function with --org, --dry-run, --verbose flags - _tok_mint_jwt(): RS256 JWT signing via openssl dgst -sha256 -sign - _tok_mint_setup(): interactive wizard for Keychain credential storage - Help text, man page, completions, and full documentation - All 14 existing tok tests continue to pass Closes #479
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
Adds
tok mint— generate short-livedghs_GitHub App installation tokens from Keychain-stored credentials. Closes #479.Changes
Core (
lib/dispatchers/tok-dispatcher.zsh)tok mint— readsgithub_app_id+github_app_private_keyfrom Keychain, builds RS256 JWT, resolves org installation, exchanges forghs_token--org ORG— target org (default:Data-Wise)--dry-run— decode JWT without exchanging--verbose/-v— print token preview + expirationtok mint setup— interactive wizard: prompt for App ID + PEM path, validate viaGET /app, store in Keychain_tok_mint_jwt()— RS256 JWT signing viaopenssl dgst -sha256 -signDocs & Help
docs/help/QUICK-REFERENCE.md— mint sectiondocs/reference/MASTER-DISPATCHER-GUIDE.md— GitHub App Token Minting sectiondocs/reference/REFCARD-TOKEN-SECRETS.md— mint command + quick workflowdocs/guides/TOKEN-COOKBOOK.md— Recipe 11docs/guides/TOKEN-MANAGEMENT-COMPLETE.md— Section 2.3docs/CHANGELOG.md— unreleased entryman/man1/tok.1— full man page sectionsTesting