Repository navigation
PLAT-711: Require a non-empty permissions table in installation-policy - #65
Merged
Merged
Conversation
Every [[installation-policy]] must now declare a permissions table naming at least one GitHub permission. Previously the table defaulted to empty, which meant the minted token carried the App's full installation permissions — the opposite of least privilege, and easy to get by omission rather than by choice. A missing table is now a deserialization error; an explicitly empty one is rejected by validate(), since allowing it would preserve exactly the silent full-permissions behaviour this change removes. Config fixtures, idcat.toml.example and the README are updated to match.
nresare
force-pushed
the
require-installation-policy-permissions
branch
from
August 18, 2026 15:11
43b1ce5 to
11da3d7
Compare
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.
What
permissionsis now a required, non-empty table on every[[installation-policy]].#[serde(default)]frompermissionsonRawInstallationPolicyConfig, so a policy without the table fails to parse withmissing field `permissions`.validate()check rejecting an explicitly empty table:installation-policy for github-app '…' repository '…' role '…' must define at least one permission.Why
The table down-scopes what a minted token can do. With
default, omitting it meant the token carried the App's full installation permissions — so the least-privilege path was opt-in, and the broad one was what you got by forgetting.I made it non-empty rather than merely present: a required-but-empty table would still mean "full installation permissions", preserving exactly the silent behaviour this change is meant to remove.
Breaking change
This is a breaking config change. Any existing
[[installation-policy]]without apermissionstable will fail to start with a parse error naming the missing field, and will need a table added before deploying this version.Notes for reviewers
rejects_installation_policy_without_permissionsandrejects_installation_policy_with_empty_permissionsreplaceinstallation_policy_permissions_default_empty_when_absent; every other config fixture gained apermissionsentry.authorize_github_app_*tests insrc/service.rsbuildInstallationPolicyConfigstructs directly withpermissions: BTreeMap::new(). That state is no longer reachable from config, but the tests exercise the authorization path and pass as-is. Happy to update them if you'd rather they reflect the new invariant.cargo test(63 passed),cargo clippy --all-targetsandcargo fmt --checkare clean.