Repository navigation
test(e2e): org delete leaves no access and no live policy - #2021
Conversation
After DeleteOrganization, nobody who had access can get the org, its projects or a resource inside one, no live policy is left on them or names the deleted group or service user, and the rows stay marked deleted.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
No actionable comments were generated in the recent review.
|
| Layer / File(s) | Summary |
|---|---|
Create principals and verify pre-deletion access test/e2e/regression/api_test.go |
Creates enabled and disabled projects, a resource, users, a group, and a service user. Adds policies and checks expected access before deletion. |
Verify post-deletion cleanup test/e2e/regression/api_test.go |
Checks that subjects lose access, live policies and group relations are removed, and organization, project, group, service-user, and resource records remain marked deleted. |
Priority:
Estimated code review effort: 3 (Moderate) | ~20 minutes
Change: Other
Possibly related PRs
- raystack/frontier#2022: Adds policy cleanup and regression coverage for deleted-user authorization state.
Suggested reviewers: rohilsurana
Merge Risk: 
Minimal · up to 14683
-
No actionable merge-blocking issue was established; the organization-deletion test is ready for normal merge checks.
Pre-merge checks: 
2
- Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
Comment @coderabbitai help to get the list of available commands.
Coverage Report for CI Build 40485784633Warning Build has drifted: This PR's base is out of sync with its target branch, so coverage data may include unrelated changes. Coverage increased (+0.007%) to 55.736%Details
Uncovered ChangesNo uncovered changes found. Coverage Regressions68 previously-covered lines in 2 files lost coverage.
Coverage Stats
💛 - Coveralls |
The access check now includes the group, and the group's relations are listed before and after the delete. No relation may be left on the group, which also catches member tuples left behind when only the member policies are removed.
Summary
Adds an e2e test for the organization delete. After
DeleteOrganization, nobody who had access can get the org, its projects or a resource inside one; no live policy is left on them; no live policy names the deleted group or service user; and the rows stay withdeleted_atset. Test only.Changes
test/e2e/regression/api_test.go:TestOrganizationDeleteLeavesNoAccessAndNoLivePolicy.Technical Details
compute/orderresource in the enabled project, a group and a service user. Users get access through the org owner role, the org viewer role, a direct project policy, the group, and a role on the resource; the service user through a project policy.CheckFederatedResourcePermission. With ids it asks SpiceDB only, so a deleted object answers false.TestPATOfDeletedOrgStopsAuthenticatinginpat_test.gocovers it.Test Plan
go test ./test/e2e/...passes.golangci-lint run ./test/e2e/regression/...reports no issues.