Repository navigation
feat(outside): allow exemptions in repo-level config - #932
Open
XakimovNosirbek wants to merge 2 commits into
Open
XakimovNosirbek wants to merge 2 commits into
XakimovNosirbek wants to merge 2 commits into
Conversation
Repo-level outside.yaml can now list exemptions. They only apply to that repository and are ignored when the org sets disableRepoOverride. Fixes ossf#525 Signed-off-by: XakimovNosirbek <68727555+XakimovNosirbek@users.noreply.github.com>
Signed-off-by: XakimovNosirbek <68727555+XakimovNosirbek@users.noreply.github.com>
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.
Fixes #525
Outside Collaborators exemptions can only be set in the org-level config today. In a loosely federated org, every exemption then has to go through the org admins, even though repo-level config can already override
pushAllowed/adminAllowed. #525 has a concrete case of exactly this.This adds
exemptionsto the repo-leveloutside.yaml:repofield. It is converted to an exemption for the current repository only, with the name escaped byglob.QuoteMeta, so a repo can't exempt users in other repos.mergeInRepoConfigpath as the other overrides, so it is ignored when the org setsdisableRepoOverride: true. That keeps the original intent of the comment this removes: an org that wants every exemption visible centrally can still enforce that.mergeConfignow copies the org slice before appending, so the org config isn't modified.Tests:
TestCheck: a repo-level exemption allows push, and is ignored withDisableRepoOverride.TestMergeConfigRepoExemptions: merged list, escaping of a repo name with glob characters, no match on another repo, and the org slice is left untouched.go test ./pkg/policies/outside/andgo vetpass.