Sign in

Search issue titles and bodies, change requests and comments. Private repositories you cannot read are not included.

vole
Clone

Read only, no credentials:

https://rodent.software/vole.git

Write over SSH with a registered key:

git clone ssh://git@rodent.software:2222/vole.git

A free and open-source forge that lives in your Git repo.

Refuse a protected-ref pattern that can never match

93c7cae8ebb7d6d853dca476851e2bd0cbe10079 · Keenan Nemetz · 21h ago · parent 2c988ecd

Refuse a protected-ref pattern that can never match

acl protect stored any string: refs/head/main read like a protected branch in
acl show while the hook compared it against refs/heads/main and matched
nothing, so approvals and required checks were off on the branch everything
lands on.

Validate the pattern in forge/access, where the rule is stored, and call it
from both acl protect add|set and the repository settings form. Only the two
shapes IsProtected understands are accepted, exact ref and one trailing
wildcard, the ref part must be a name git could store, and a singular
category is named as the typo it is.

cmd/vole/acl.go +7

@@ -280,6 +280,13 @@ func cmdACL(args []string) error {
280 280 printProtected(a, m.Name)
281 281 return nil
282 282 }
283 // A pattern IsProtected cannot match protects nothing, so it is refused
284 // before it is stored and echoed back by `acl show` as if it worked.
285 if action == "add" || action == "set" {
286 if err := access.ValidateProtectedPatterns(values); err != nil {
287 return err
288 }
289 }
283 290 switch action {
284 291 case "clear":
285 292 a.Protected = nil