docs(authz): Wave 0 permission storage DDL spike - #666
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Co-authored-by: Silvan <adlerhurst@users.noreply.github.com>
Co-authored-by: Silvan <adlerhurst@users.noreply.github.com>
Co-authored-by: Silvan <adlerhurst@users.noreply.github.com>
Co-authored-by: Silvan <adlerhurst@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
Adds a new API design doc that captures the Wave 0 “permission storage” DDL spike for the portable relational FGA core, then threads that reference into the API design index and ADR 032/033 follow-ups to anchor future implementation work (notably #422 migrations).
Changes:
- Introduces
docs/design/api/permission-storage.mddocumenting locked DDL/storage decisions (D1–D13), strawman schema, and query sketches. - Links the new design doc from
docs/design/api/README.mdto include it in the suggested reading order. - Updates ADR 032 and ADR 033 follow-ups to point implementers at the Wave 0 storage doc and #422.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| docs/design/api/README.md | Adds the new permission-storage doc to the API design index/reading order. |
| docs/design/api/permission-storage.md | New Wave 0 storage/DDL spike doc with locked decisions, schema strawman, and illustrative SQL. |
| docs/adrs/033-internal-permission-management.md | Follow-up section now references the Wave 0 storage doc and links to #422. |
| docs/adrs/032-permission-catalogs.md | Follow-up section now references the Wave 0 storage doc and links to #422/#333 context. |
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
livio-a
left a comment
There was a problem hiding this comment.
Review: Wave 0 permission storage DDL spike — reviewed alongside the rest of the stack (#677, #758).
Well-reasoned spike at the right altitude — freezing tables/PKs/indexes/dual-write rules as locked decisions D1–D13 is exactly the right output for Wave 0, and the implementation in #677 tracks it closely. Two notes, both doc-level:
-
This doc is partially superseded by #677 and reads that way in isolation. #677 reverses D5 (it does create
authz_expression_edges+authz_relation_references, which D5 here says to defer until #421) and changes relation identity to(catalog_id, object_type, relation). #677 updatespermission-storage.mdto match, so head stays consistent — but a reader landing on this PR's version sees the pre-revision D5/identity. Worth a one-line "superseded by #677 for D5 / relation identity," or squashing the doc evolution so the frozen decisions and their revisions land together. -
[NIT] Illustrative check SQL contradicts the D13 home-project note. The single-resource check example hardcodes
e.project_id = a.project_idfor the team-membershipEXISTS, while the D13 discussion a few lines down states membership edges for a foreign team principal live in the principal's home project, nota.project_id. It's labeled illustrative, but the two passages read as directly contradictory — a half-sentence caveat on the example would remove the trap for whoever writes the Wave 1 resolver.
Align check SQL with D13 via principal_home_project_id, single-source catalog tables (D14), tighter DDL CHECKs, and supersede authz.md / ADR follow-ups that still pointed at team_memberships checks and delegation/expression-edge tables. Co-authored-by: Silvan <adlerhurst@users.noreply.github.com>
Summary
Adds the Wave 0 design spike for portable FGA relational storage (ADR 032–033 / epic #419): locked decisions D1–D14, Postgres/Spanner-oriented DDL strawman, dual-write membership edges, check/list SQL sketches, end-to-end narrative, and a #333 cross-project grant depiction (foreign user/team principal on the protected
project_id).Links the doc from the API design index and points ADR 032/033 follow-ups at it so #422 can implement migrations without re-litigating the schema shape.
Validation
$principal_home_project_id, relations+closure only (D14), tighter DDL CHECKs,authz.md/ ADR follow-up alignmentRelease notes / changeset
No changeset required — no shipped behavior changed (docs only).
Notes
internal/authz/*, resolver (Permission Resolver & SQL List Predicate Injection #423), OpenFGA compiler (OpenFGA Parser, IR & Profile Compiler #421), implementing [ARCH-ADR] Define Architecture for Cross-Project Identity and Collaboration #333 product/identity