Skip to content

[M2.3d4d] Generated route/role matrix and tenant acceptance checkpoint - #116

Merged
samuelmbabhazi merged 5 commits into
mainfrom
feat/m2.3d4d-route-role-matrix
Nov 5, 2026
Merged

samuelmbabhazi merged 5 commits into
mainfrom
feat/m2.3d4d-route-role-matrix

Conversation

@samuelmbabhazi

Copy link
Copy Markdown
Collaborator

What changed

M2.3d4d: a route and role matrix generated from the registered routes, plus the tenant acceptance checkpoint for M2.3d.

  • testing/route-inventory.ts. Lists every registered route with its anonymous, account or tenant declaration and its bearer opt-in. app.http.spec.ts now uses it.
  • testing/tenant-personas.ts. The 11 actors of the tenant fixture (owner, admin, member, project and environment admin, developer and viewer, the narrowed restrictedAdmin, outsider) are expressed as domain memberships. The fixture gains a session post helper.
  • route-role-matrix.spec.ts (unit, no database):
    • Every tenant route's permission@scope must appear in an independent copy of the SPEC 7 table. The domain policy's decision must match it for every actor. A new route with an unreviewed pair fails.
    • Bearer opt-in must equal the route permission and never reaches member or binding routes.
    • It regenerates docs/generated/route-role-matrix.md and fails on any difference. Reviewers see access changes as a document diff. Prettier ignores the file because it is generated.
  • route-role-matrix.integration.spec.ts:
    • Replays every registered tenant route for every actor through the real guards and the restricted PostgreSQL role, and checks no audit row is written: an allowed GET answers 200, an allowed POST with an empty body answers 400, and a denial answers 404.
    • Routes that combine another organization's id with fixture project or environment ids answer 404.
  • SPEC and PLAN. The SPEC references the matrix. M2.3d4d, M2.3d4 and M2.3d are ticked.

How it was tested

  • The unit specs pass, and the generated matrix was reviewed (excerpt below).
  • Not run locally: the integration test (no Docker). It runs in CI-1.
  • Local gate passes.
| GET  | /organizations/:organizationId/projects/:projectId/environments/:environmentId/bindings | member.manage @ environment | - | yes | yes | no | yes | no | no | yes | no | no | no | no |

Security considerations

  • Authorization changes now show up as a reviewable diff.
  • Bearer access to privilege-changing routes is structurally forbidden by a test.

@samuelmbabhazi
samuelmbabhazi merged commit d0b7d99 into main Nov 5, 2026
@samuelmbabhazi
samuelmbabhazi deleted the feat/m2.3d4d-route-role-matrix branch November 5, 2026 15:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant