Commit 7fb436c
authored
fix(authz)!: make the
Follow-up to #3559, which read ADR-0105 D12 as "the `group` wall ships open" and
made the posture self-activating — it never probed for @objectstack/organizations.
That turned `group` into a free multi-org path around the `isolated` gate
(ADR-0081 D2), leaving the WEAKER isolation as the free one, and it opened a
silent-degradation hole: `os serve` still gated the enterprise package load on
OS_MULTI_ORG_ENABLED, so OS_TENANCY_POSTURE=group skipped both the load and the
ADR-0093 D5 fail-fast.
The distinction missed: open code is not free activation. The wall's
implementation has always lived in open packages — equally true of `isolated`,
whose Layer 0 wall sits in plugin-security gated on a service the enterprise
package registers. Cloud ADR-0016's 铁律 guarantees a deployment RUNNING a
multi-org shape is safe; that is satisfied by REFUSING to run one unwalled, not
by giving the posture away.
- tenancy-service: `group` probes `org-scoping` exactly like `isolated`; without
it the posture resolves to `single` + `degraded`.
- serve.ts: the ADR-0093 D5 boot guard keys off the resolved POSTURE, with
posture-aware messaging. A `group` request without the runtime now refuses to
boot unless OS_ALLOW_DEGRADED_TENANCY=1.
- New seam: `org-scoping` may declare `supportedPostures`
(`OrgScopingEntitlement`); the open side honours it and fails closed on
anything unlisted. Whether `group` and `isolated` are one commercial tier or
two is packaging policy, which belongs to the commercial runtime rather than
hard-coded in open core. Omitting it entitles every walled posture.
- `organization_id` STAMPING returns to the enterprise runtime. #3559 moved it
into the open engine, removing the closed package's only load-bearing runtime
duty — a five-line forged `org-scoping` registration would then have produced a
fully working multi-org deployment. Back where it was, a forged registration
yields NULL-org rows the wall hides. Write-side VALIDATION stays open and
unchanged, bulk-insert coverage included: rejecting a forged organization_id is
a security property, not a packaging one.
- Default-org bootstrap returns to `single`-only (ADR-0081 D1).
- Documents OS_TENANCY_POSTURE in the environment-variables reference.
Operator note: OS_TENANCY_POSTURE=group without the enterprise runtime now
refuses to boot rather than silently running single-org.group posture an entitlement again — ADR-0105 D12 correction (#3570)1 parent 48d5a1c commit 7fb436c
12 files changed
Lines changed: 330 additions & 129 deletions
File tree
- .changeset
- content/docs/deployment
- packages
- cli/src/commands
- plugins
- plugin-auth/src
- plugin-security/src
- qa/dogfood/test
- spec
- src/security
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
79 | 79 | | |
80 | 80 | | |
81 | 81 | | |
82 | | - | |
| 82 | + | |
| 83 | + | |
83 | 84 | | |
84 | 85 | | |
85 | 86 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
12 | | - | |
| 12 | + | |
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
| |||
1588 | 1588 | | |
1589 | 1589 | | |
1590 | 1590 | | |
1591 | | - | |
| 1591 | + | |
| 1592 | + | |
| 1593 | + | |
| 1594 | + | |
| 1595 | + | |
| 1596 | + | |
| 1597 | + | |
| 1598 | + | |
1592 | 1599 | | |
1593 | 1600 | | |
1594 | 1601 | | |
| |||
1612 | 1619 | | |
1613 | 1620 | | |
1614 | 1621 | | |
1615 | | - | |
1616 | | - | |
1617 | | - | |
| 1622 | + | |
| 1623 | + | |
| 1624 | + | |
| 1625 | + | |
1618 | 1626 | | |
1619 | 1627 | | |
1620 | | - | |
| 1628 | + | |
1621 | 1629 | | |
1622 | 1630 | | |
1623 | 1631 | | |
| |||
1629 | 1637 | | |
1630 | 1638 | | |
1631 | 1639 | | |
1632 | | - | |
1633 | | - | |
1634 | | - | |
| 1640 | + | |
| 1641 | + | |
| 1642 | + | |
1635 | 1643 | | |
1636 | 1644 | | |
1637 | 1645 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
| 14 | + | |
14 | 15 | | |
15 | 16 | | |
16 | 17 | | |
| |||
283 | 284 | | |
284 | 285 | | |
285 | 286 | | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
286 | 299 | | |
287 | 300 | | |
288 | 301 | | |
| |||
552 | 565 | | |
553 | 566 | | |
554 | 567 | | |
555 | | - | |
556 | | - | |
557 | | - | |
558 | | - | |
559 | | - | |
560 | | - | |
561 | | - | |
562 | | - | |
563 | | - | |
564 | | - | |
565 | | - | |
566 | | - | |
| 568 | + | |
| 569 | + | |
| 570 | + | |
| 571 | + | |
| 572 | + | |
| 573 | + | |
| 574 | + | |
567 | 575 | | |
568 | 576 | | |
569 | 577 | | |
| |||
Lines changed: 106 additions & 11 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
61 | 61 | | |
62 | 62 | | |
63 | 63 | | |
64 | | - | |
65 | | - | |
66 | | - | |
67 | | - | |
68 | | - | |
69 | | - | |
70 | | - | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
71 | 74 | | |
72 | 75 | | |
73 | | - | |
74 | 76 | | |
75 | | - | |
76 | 77 | | |
77 | 78 | | |
78 | | - | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
79 | 93 | | |
80 | 94 | | |
81 | 95 | | |
82 | | - | |
| 96 | + | |
83 | 97 | | |
84 | 98 | | |
85 | 99 | | |
| |||
169 | 183 | | |
170 | 184 | | |
171 | 185 | | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
0 commit comments