feat: add all-repositories option to installation-policy - #62
Open
portswigger-amason wants to merge 1 commit into
Open
feat: add all-repositories option to installation-policy#62portswigger-amason wants to merge 1 commit into
portswigger-amason wants to merge 1 commit into
Conversation
By default an installation-policy mints a token scoped to the requested repository. Add an opt-in `all-repositories = true` that mints an installation-wide token instead, while still applying the policy's permissions. This enables reading organization-level resources (such as org-owned packages) that a single-repository token cannot access. repository/repositories remains required and is still used for the authorization match; only the minted token's repository scope changes.
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.
By default an
[[installation-policy]]mints a token scoped to the requested repository. That can't read organization-level resources (e.g. org-owned container packages), which require an installation-wide token.This adds an opt-in
all-repositories = trueto[[installation-policy]]: when set, idcat omitsrepositoriesfrom the installation-token request, minting an installation-wide token, while still applying the policy'spermissions. So you can grant, say, org-widepackages: readwithout also widening the permission set.repository/repositoriesis still required and still used for the authorization match; only the minted token's repository scope changes.false— existing policies are unaffected.RepoScope::All+ non-empty permissions already serializes to an org-wide, permission-scoped request.Covered by a new unit test (
authorize_github_app_returns_all_repos_when_installation_policy_opts_in); README andidcat.toml.exampleupdated.