Repository navigation
feat: let --permissions name any permission GitHub has - #89
Merged
Merged
Conversation
--permissions accepted only the names InstallationPermissions has a field for, so a permission GitHub added since, such as installation_repositories, could not be requested from the CLI. Every name now goes through InstallationPermissions.Other. The list was a guard against GitHub ignoring a name it does not know and minting a token with every permission. Tested against a real App, it does not: an unknown name gets a 422, even beside valid ones, and the CLI exits 2 with GitHub's message. AGENTS.md now points exit code 5 at --owner too.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #89 +/- ##
==========================================
- Coverage 97.74% 97.71% -0.03%
==========================================
Files 8 8
Lines 797 787 -10
==========================================
- Hits 779 769 -10
Misses 18 18 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
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
githubauth token --permissionsnarrows a token to less than the App was granted. It accepted only the permission names the library has a struct field for, so a permission GitHub added since, such asinstallation_repositories, could not be requested from the CLI. Every name now goes to GitHub throughInstallationPermissions.Other, added in #88.What this does
--permissionspull_requests:readinstallation_repositories:writepull_request:read(typo)Changes
--permissionssends every name throughOther. The empty-list andname:levelchecks stay.AGENTS.mdpoints exit code 5 at--owneras well as--installation.Rationale
The name list guarded against GitHub ignoring a name it does not know and minting a token with every permission. Against a real App it does not:
pull_request,nonsense_xyz, andnonsense_xyzbeside the validpull_requestsall got a 422, and no token was minted.🤖 Generated with Claude Code