vole
Site
Clone
Read only, no credentials:
https://rodent.software/vole.git
Write over SSH with a registered key:
git clone ssh://git@rodent.software/vole.git
Self-hosted forge that lives in your Git repo.
Name role capabilities consistently
cc5123a549d8d0991e74a88fff8208b5071d1192 · Keenan Nemetz · 1d ago · parent 648cd81b
server/admin_web_test.go +5−5
| @@ -64,7 +64,7 @@ func TestRepositoryAccessSettings(t *testing.T) { | |||
| 64 | 64 | if err != nil { | |
| 65 | 65 | t.Fatal(err) | |
| 66 | 66 | } | |
| 67 | if acl.Default != "read" { | ||
| 67 | if acl.Default != "reader" { | ||
| 68 | 68 | t.Fatalf("default role = %q", acl.Default) | |
| 69 | 69 | } | |
| 70 | 70 | if got := acl.RequiredApprovals(); got != 2 { | |
| @@ -79,14 +79,14 @@ func TestRepositoryAccessSettings(t *testing.T) { | |||
| 79 | 79 | if got := strings.Join(acl.Protected, ","); got != "refs/heads/main,refs/heads/release/*" { | |
| 80 | 80 | t.Fatalf("protected = %q", got) | |
| 81 | 81 | } | |
| 82 | if acl.Entries[f.ownerID] != "admin" || acl.Entries[f.writerID] != "maintain" { | ||
| 82 | if acl.Entries[f.ownerID] != "admin" || acl.Entries[f.writerID] != "maintainer" { | ||
| 83 | 83 | t.Fatalf("entries = %v", acl.Entries) | |
| 84 | 84 | } | |
| 85 | 85 | entry, err := f.srv.Index.Get(f.repo) | |
| 86 | 86 | if err != nil { | |
| 87 | 87 | t.Fatal(err) | |
| 88 | 88 | } | |
| 89 | if entry.ACLDefault != "read" || entry.ACLPrincipals != 2 { | ||
| 89 | if entry.ACLDefault != "reader" || entry.ACLPrincipals != 2 { | ||
| 90 | 90 | t.Fatalf("index entry = %+v", entry) | |
| 91 | 91 | } | |
| 92 | 92 | audit, err := os.ReadFile(f.cfg.AuditLog()) | |
| @@ -295,7 +295,7 @@ func TestRepositoryAccessRequiresInstanceAdmin(t *testing.T) { | |||
| 295 | 295 | if err != nil { | |
| 296 | 296 | t.Fatal(err) | |
| 297 | 297 | } | |
| 298 | if acl.Default == "read" { | ||
| 298 | if acl.Default == "reader" { | ||
| 299 | 299 | t.Fatal("rejected save changed the default role") | |
| 300 | 300 | } | |
| 301 | 301 | } | |
| @@ -388,7 +388,7 @@ func TestRepositoryAccessListsOnlyExplicitAccountsAndCanAddOne(t *testing.T) { | |||
| 388 | 388 | t.Fatal(err) | |
| 389 | 389 | } | |
| 390 | 390 | if acl.Entries["carol"] != access.Contribute.String() { | |
| 391 | t.Fatalf("carol entry = %q, want contribute", acl.Entries["carol"]) | ||
| 391 | t.Fatalf("carol entry = %q, want contributor", acl.Entries["carol"]) | ||
| 392 | 392 | } | |
| 393 | 393 | _, body = f.browserGet(t, "/"+f.repo+"/settings?tab=access", cookie) | |
| 394 | 394 | if !strings.Contains(body, `name="role:carol"`) { | |