Skip to content

Commit

Permalink
Check for full consistency
Browse files Browse the repository at this point in the history
Signed-off-by: Jonathan Marcantonio <jmarcant@redhat.com>
  • Loading branch information
lennysgarage committed Jan 30, 2025
1 parent 1c6b17e commit e9c6135
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions internal/data/spicedb_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1083,8 +1083,13 @@ func TestSpiceDbRepository_NewEnemyProblem_Failure(t *testing.T) {
Allowed: apiV1beta1.CheckResponse_ALLOWED_TRUE,
CheckedAt: resp.GetCheckedAt(), // returned zookie may not be same as created zookie.
}
// we technically dont have access, but according to zookie revision we do!
assert.Equal(t, &checkResponse, resp) // we expect true even with removed access.

if spiceDbRepo.fullyConsistent { // new enemy problem doesn't apply if we're fully consistent.
checkResponse.Allowed = apiV1beta1.CheckResponse_ALLOWED_FALSE
assert.Equal(t, &checkResponse, resp)
} else { // we technically dont have access, but according to zookie revision we do!
assert.Equal(t, &checkResponse, resp) // we expect true even with removed access.
}

// zed permission check rbac/workspace:test user_grant rbac/principal:u2 --explain
resp, err = spiceDbRepo.Check(ctx, &u2Check)
Expand Down

0 comments on commit e9c6135

Please sign in to comment.