Skip to content

Commit 2ceb783

Browse files
authored
Merge branch 'main' into claude/ci-affected-rung2
2 parents 3d35bf4 + 35d287f commit 2ceb783

63 files changed

Lines changed: 6859 additions & 395 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.changeset/authz-mvp-storage.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@zitadel/server": minor
3+
---
4+
5+
Add authorization MVP storage: resource_scope_index, system catalog seed, assignments, membership edges, and dual-write hooks.

docs/adrs/032-permission-catalogs.md

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -398,11 +398,19 @@ policies without reintroducing hard-coded levels and special cases.
398398
## Follow-ups
399399

400400
1. Design relational migrations for catalogs, permission/relation
401-
definitions, expression edges, and assignments shared by both catalogs.
402-
(Catalog-specific tables — `resource_scope_index` and app grants — are
401+
definitions, expression edges / relation references, and assignments
402+
shared by both catalogs.
403+
Wave 0 DDL spike and locked decisions:
404+
[`docs/design/api/permission-storage.md`](../design/api/permission-storage.md)
405+
(implementation tracked by [issue #422](https://github.com/zitadel/nextgen/issues/422)).
406+
Wave 1 (#422) ships `authz_expression_edges` + `authz_relation_references`
407+
as compiled #720 storage (superseding the Wave 0 D5/D14 “relations+closure
408+
only” deferral for MVP); bundle tables remain unfilled by the v1 mapper.
409+
Catalog-specific tables — `resource_scope_index` and app grants — are
403410
tracked in [ADR 033](033-internal-permission-management.md) and
404411
[ADR 034](034-external-permission-management.md); staff/support grant
405-
tables are tracked by [issue #333](https://github.com/zitadel/nextgen/issues/333).)
412+
product is tracked by [issue #333](https://github.com/zitadel/nextgen/issues/333)
413+
(storage depiction in the Wave 0 / Wave 1 doc).
406414
2. Add resolver conformance tests that compare single-resource checks and
407415
list predicates across PostgreSQL and Spanner.
408416
3. Validate the Leopard-style flattening approach for relation closure

docs/adrs/033-internal-permission-management.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -267,7 +267,10 @@ scoped SQL query against data we already own.
267267
types. Canonical names live in
268268
[`docs/design/api/system-permission-catalog.md`](../design/api/system-permission-catalog.md).
269269
2. Design relational migrations for `resource_scope_index` and agent
270-
delegation tables.
270+
delegation columns on `authz_assignments` (D2 — not sibling delegation
271+
tables). Wave 0 DDL spike and locked decisions:
272+
[`docs/design/api/permission-storage.md`](../design/api/permission-storage.md)
273+
(implementation tracked by [issue #422](https://github.com/zitadel/nextgen/issues/422)).
271274
3. Update OpenAPI security declarations to use the final permission names.
272275
4. Define agent delegation schema, audit record shape, and denial
273276
explanation fields.

docs/adrs/047-dialect-id-generation.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ the dialect generator is the only mint path, not that create always overwrites.
6464
| user TOTP row | `utotp` |
6565
| user recovery codes row | `urc` |
6666
| user passkey row | `upk` |
67+
| authz assignment | `asgn` |
6768

6869
Existing style mix (`brnd` / `flowdef` / `enc_key` / `upw`) stays until a
6970
dedicated rename PR. Do not add more without the selection rules below.

docs/design/api/README.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,9 @@ Individual decisions are marked inline in each doc:
3030
4. [`conventions.md`](conventions.md) — IDs, errors, pagination, idempotency A/B split, capabilities split, header-based versioning.
3131
5. [`authn-and-auth-flows.md`](authn-and-auth-flows.md) — auth_attempts state machine, OIDC adapter, SSR handoff.
3232
6. [`authz.md`](authz.md) — credential × scope × permission.
33-
7. [`security-and-origins.md`](security-and-origins.md) — environment-gated origin wildcards, CORS, CSRF.
34-
8. [`resource-map.md`](resource-map.md) — the full endpoint surface grouped by concern.
33+
7. [`permission-storage.md`](permission-storage.md) — Wave 0 relational DDL for catalogs, assignments, membership edges, and `resource_scope_index` (feeds issue #422).
34+
8. [`security-and-origins.md`](security-and-origins.md) — environment-gated origin wildcards, CORS, CSRF.
35+
9. [`resource-map.md`](resource-map.md) — the full endpoint surface grouped by concern.
3536

3637
## Sibling doc sets
3738

docs/design/api/authz.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ Permission is denied before any resource content is fetched. Enumeration oracles
2727

2828
| Principal | Identifier | Scope semantics |
2929
|---|---|---|
30-
| **user** (user token) | `user_id` | Resolved against `team_memberships` and project grants for the project the user lives in. |
30+
| **user** (user token) | `user_id` | FGA membership checks use `authz_membership_edges` (dual-written from `team_memberships`); see D3 in [`permission-storage.md`](permission-storage.md). Roster/`team_memberships` stay lifecycle-adjacent only. |
3131
| **`sk_proj_…`** (claimed) | `project_id`, `team_id` (owning team) | Project-wide. |
3232
| **`sk_proj_…`** (pre-claim) | `project_id`, `pre_claim: true` | Project-wide against an unclaimed project. |
3333
| **`sk_proj_…`** (origin-scoped) | `project_id`, `origin_patterns` | Project-wide, gated on request `Origin` matching a pattern. |
@@ -73,8 +73,8 @@ marks that user as team-owned.
7373

7474
The decision engine answers `can principal P perform action A on resource R?` considering:
7575

76-
- Direct permission grants.
77-
- Role assignments through team_memberships.
76+
- Direct permission grants (`authz_assignments`).
77+
- Team usersets via `authz_membership_edges` and relation closure (see [`permission-storage.md`](permission-storage.md)); `team_memberships` is roster/lifecycle only, not the check fact source.
7878
- Credential-class allowlists (especially `sk_team_`).
7979
- Resource-scope constraints (`origin_patterns`, project/team boundary, etc.).
8080

@@ -97,3 +97,4 @@ Both "ID does not exist" and "authorisation fails" return **404 Not Found**. Thi
9797
- [`url-architecture.md`](url-architecture.md) — scope resolution that runs before the permission check
9898
- [`resource-map.md`](resource-map.md) — endpoint surface inventory
9999
- [`system-permission-catalog.md`](system-permission-catalog.md) — canonical permission names, bundles, and per-resource permission matrix
100+
- [`permission-storage.md`](permission-storage.md) — Wave 0 relational DDL, dual-write membership edges, and check SQL shape

0 commit comments

Comments
 (0)