Skip to content

feat: add all-repositories option to installation-policy - #62

Open
portswigger-amason wants to merge 1 commit into
mainfrom
installation-policy-all-repositories
Open

feat: add all-repositories option to installation-policy#62
portswigger-amason wants to merge 1 commit into
mainfrom
installation-policy-all-repositories

Conversation

@portswigger-amason

Copy link
Copy Markdown

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 = true to [[installation-policy]]: when set, idcat omits repositories from the installation-token request, minting an installation-wide token, while still applying the policy's permissions. So you can grant, say, org-wide packages: read without also widening the permission set.

  • repository/repositories is still required and still used for the authorization match; only the minted token's repository scope changes.
  • Defaults to false — existing policies are unaffected.
  • No change needed in the token-request builder: 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 and idcat.toml.example updated.

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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant