Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -118,4 +118,3 @@ func TestScopesKeepTheirResourceOwner(t *testing.T) {
}
}
}

12 changes: 12 additions & 0 deletions libraries/conformance/go/solution_principal.go
Original file line number Diff line number Diff line change
Expand Up @@ -462,6 +462,18 @@ func RunSolutionPrincipalTarget(t *testing.T, conn grpc.ClientConnInterface, des
sp.grant(t, A, "author", sp.person(t, f.Editor))
before := sp.must(t)(sp.through(t, f.Viewer, A, "store"))
unrelated := sp.must(t)(sp.through(t, f.Editor, A, "store"))
// A new grant, to the holder or to anyone else, leaves both valid.
sp.grant(t, A, "author", sp.person(t, f.Viewer))
sp.grant(t, A, "viewer", sp.person(t, f.Member))
for _, capability := range []protoreflect.Message{before, unrelated} {
if err := sp.check(capability); err != nil {
t.Fatalf("a new grant invalidated an existing capability: %v", err)
}
}
sp.revoke(t, A, "author", sp.person(t, f.Viewer))
sp.revoke(t, A, "viewer", sp.person(t, f.Member))
// Reissued, so the last-grant revoke below must kill a live capability.
before = sp.must(t)(sp.through(t, f.Viewer, A, "store"))
if !slices.Contains(sp.roleGrants(t, f.Admin, f.Organization, A), "viewer person "+sp.personID(t, f.Viewer)) {
t.Fatalf("ListRoleGrants does not show the grant: %v", sp.roleGrants(t, f.Admin, f.Organization, A))
}
Expand Down