# git-host access policy. # # One file, read by the receive hook on every push and by nothing that serves # reads. The deployed copy is mounted read-only - a ConfigMap - so changes are # made to the copy in git and rolled out; `git-authz grant`, `revoke` and # `protect` edit a source copy and refuse, with an explanation, when pointed at # the read-only one. # # [ ... ] # # Levels stack: admin implies force implies write, and every rule for a user # counts, so the strongest match wins. There is no 'deny': access is taken # away by deleting the rule that gave it. # # A ref pattern is a glob in which '*' crosses '/'. "main", "heads/main" and # "refs/heads/main" name the same branch; a bare name is always a branch, so a # tag has to be written "refs/tags/v1" or "tags/v1". With no patterns at all # the rule covers the whole repository, refs included. # # '@all' means everyone this policy already names somewhere. It is not a # wildcard for anonymous users: nobody reaches it who has no rule of their own. # What costs an extra level to move. A write on these needs force, a force # needs admin, and refs outside refs/heads and refs/tags need admin regardless. set protected-refs refs/heads/main refs/tags/* # The account for break-glass and for the refs nobody else should touch: it is # unscoped, so it covers the whole repository including refs/notes and friends. alice * admin # Default for everyone the policy knows: their own branches, anywhere. Reads # are open, so this is about writing, and there is no rule here to be the # fall-through for someone the policy has never mentioned. @all * write refs/heads/* # Contributor on team: feature branches only. bob team write refs/heads/feature/* # Senior on team: may rewrite his feature branches and delete them. carol team force refs/heads/feature/* # Maintainer of team: everything, including main, tags, and deletions. dave team admin # Team A's repository, with an unrelated ACL. erin secrets admin