@astram/core 0.1.0 → 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (142) hide show
  1. package/dist/admin/admin-service.d.ts +1 -1
  2. package/dist/admin/command/grants.js +3 -3
  3. package/dist/admin/command/grants.js.map +1 -1
  4. package/dist/admin/command/invitations.d.ts +2 -2
  5. package/dist/admin/command/invitations.js +8 -8
  6. package/dist/admin/command/invitations.js.map +1 -1
  7. package/dist/admin/command/service-accounts.d.ts +1 -1
  8. package/dist/admin/command/service-accounts.js +1 -1
  9. package/dist/admin/query/simulate.d.ts.map +1 -1
  10. package/dist/admin/query/simulate.js +4 -0
  11. package/dist/admin/query/simulate.js.map +1 -1
  12. package/dist/admin/safeguards-impl.d.ts +2 -2
  13. package/dist/admin/safeguards-impl.js +9 -9
  14. package/dist/admin/safeguards-impl.js.map +1 -1
  15. package/dist/admin/safeguards.d.ts +4 -4
  16. package/dist/admin/safeguards.js +4 -4
  17. package/dist/admin/types.d.ts +1 -1
  18. package/dist/admin/types.d.ts.map +1 -1
  19. package/dist/authentication/authenticator.d.ts +2 -2
  20. package/dist/authentication/authenticator.js +2 -2
  21. package/dist/authentication/authenticator.js.map +1 -1
  22. package/dist/authentication/credential-resolver.d.ts +1 -1
  23. package/dist/authorization/cross-tenant/grant-evaluator.d.ts +2 -2
  24. package/dist/authorization/cross-tenant/grant-evaluator.js +2 -2
  25. package/dist/authorization/decision-authority.d.ts +2 -2
  26. package/dist/authorization/decision-authority.d.ts.map +1 -1
  27. package/dist/authorization/decision-authority.js +11 -3
  28. package/dist/authorization/decision-authority.js.map +1 -1
  29. package/dist/authorization/errors.d.ts +37 -0
  30. package/dist/authorization/errors.d.ts.map +1 -1
  31. package/dist/authorization/errors.js +43 -0
  32. package/dist/authorization/errors.js.map +1 -1
  33. package/dist/authorization/gates/object-type.d.ts +2 -2
  34. package/dist/authorization/gates/object-type.d.ts.map +1 -1
  35. package/dist/authorization/gates/object-type.js +20 -7
  36. package/dist/authorization/gates/object-type.js.map +1 -1
  37. package/dist/authorization/gates/tenant.d.ts +3 -3
  38. package/dist/authorization/gates/tenant.js +7 -7
  39. package/dist/authorization/gates/tenant.js.map +1 -1
  40. package/dist/authorization/index.d.ts +23 -4
  41. package/dist/authorization/index.d.ts.map +1 -1
  42. package/dist/authorization/index.js +29 -4
  43. package/dist/authorization/index.js.map +1 -1
  44. package/dist/authorization/ports.d.ts +3 -3
  45. package/dist/authorization/reason-codes.d.ts +7 -1
  46. package/dist/authorization/reason-codes.d.ts.map +1 -1
  47. package/dist/authorization/reason-codes.js +9 -1
  48. package/dist/authorization/reason-codes.js.map +1 -1
  49. package/dist/authorization/record/owner-baseline.d.ts +43 -0
  50. package/dist/authorization/record/owner-baseline.d.ts.map +1 -0
  51. package/dist/authorization/record/owner-baseline.js +72 -0
  52. package/dist/authorization/record/owner-baseline.js.map +1 -0
  53. package/dist/authorization/record/permit-tier.d.ts.map +1 -1
  54. package/dist/authorization/record/permit-tier.js +16 -5
  55. package/dist/authorization/record/permit-tier.js.map +1 -1
  56. package/dist/identity/broker.d.ts +8 -8
  57. package/dist/identity/broker.d.ts.map +1 -1
  58. package/dist/identity/broker.js +8 -8
  59. package/dist/identity/broker.js.map +1 -1
  60. package/dist/identity/claim-mapper.d.ts +8 -8
  61. package/dist/identity/claim-mapper.d.ts.map +1 -1
  62. package/dist/identity/claim-mapper.js +4 -4
  63. package/dist/identity/index.d.ts +2 -2
  64. package/dist/identity/index.d.ts.map +1 -1
  65. package/dist/identity/internal-adapter.d.ts +12 -12
  66. package/dist/identity/internal-adapter.d.ts.map +1 -1
  67. package/dist/identity/internal-adapter.js +9 -9
  68. package/dist/identity/internal-adapter.js.map +1 -1
  69. package/dist/metadata/index.d.ts +43 -0
  70. package/dist/metadata/index.d.ts.map +1 -1
  71. package/dist/metadata/index.js +6 -0
  72. package/dist/metadata/index.js.map +1 -1
  73. package/dist/metadata/registry.d.ts.map +1 -1
  74. package/dist/metadata/registry.js +2 -1
  75. package/dist/metadata/registry.js.map +1 -1
  76. package/dist-cjs/admin/admin-service.js +159 -0
  77. package/dist-cjs/admin/command/grants.js +200 -0
  78. package/dist-cjs/admin/command/index.js +38 -0
  79. package/dist-cjs/admin/command/invitations.js +246 -0
  80. package/dist-cjs/admin/command/permissions.js +69 -0
  81. package/dist-cjs/admin/command/pipeline.js +110 -0
  82. package/dist-cjs/admin/command/policies.js +223 -0
  83. package/dist-cjs/admin/command/service-accounts.js +278 -0
  84. package/dist-cjs/admin/command/service.js +130 -0
  85. package/dist-cjs/admin/command/tiers.js +81 -0
  86. package/dist-cjs/admin/index.js +78 -0
  87. package/dist-cjs/admin/ports.js +41 -0
  88. package/dist-cjs/admin/query/audit-view.js +88 -0
  89. package/dist-cjs/admin/query/catalog.js +174 -0
  90. package/dist-cjs/admin/query/explain.js +149 -0
  91. package/dist-cjs/admin/query/index.js +74 -0
  92. package/dist-cjs/admin/query/simulate.js +98 -0
  93. package/dist-cjs/admin/safeguards-impl.js +322 -0
  94. package/dist-cjs/admin/safeguards.js +95 -0
  95. package/dist-cjs/admin/types.js +40 -0
  96. package/dist-cjs/audit/audit-recorder.js +269 -0
  97. package/dist-cjs/audit/canonicalize.js +176 -0
  98. package/dist-cjs/audit/errors.js +44 -0
  99. package/dist-cjs/audit/index.js +39 -0
  100. package/dist-cjs/audit/ports.js +27 -0
  101. package/dist-cjs/audit/sensitive.js +162 -0
  102. package/dist-cjs/audit/walk.js +123 -0
  103. package/dist-cjs/authentication/authenticator.js +210 -0
  104. package/dist-cjs/authentication/credential-resolver.js +21 -0
  105. package/dist-cjs/authentication/index.js +42 -0
  106. package/dist-cjs/authentication/password-hasher.js +21 -0
  107. package/dist-cjs/authentication/totp.js +155 -0
  108. package/dist-cjs/authorization/cross-tenant/grant-evaluator.js +167 -0
  109. package/dist-cjs/authorization/decision-authority.js +213 -0
  110. package/dist-cjs/authorization/default-gates.js +53 -0
  111. package/dist-cjs/authorization/delegation/operation-identity.js +226 -0
  112. package/dist-cjs/authorization/errors.js +110 -0
  113. package/dist-cjs/authorization/gates/object-type.js +192 -0
  114. package/dist-cjs/authorization/gates/tenant.js +89 -0
  115. package/dist-cjs/authorization/gates/wiring.js +59 -0
  116. package/dist-cjs/authorization/index.js +124 -0
  117. package/dist-cjs/authorization/ports.js +36 -0
  118. package/dist-cjs/authorization/reason-codes.js +117 -0
  119. package/dist-cjs/authorization/record/owner-baseline.js +74 -0
  120. package/dist-cjs/authorization/record/permit-tier.js +92 -0
  121. package/dist-cjs/authorization/record/rule-evaluator.js +128 -0
  122. package/dist-cjs/authorization/record/shares.js +110 -0
  123. package/dist-cjs/identity/broker.js +139 -0
  124. package/dist-cjs/identity/claim-mapper.js +51 -0
  125. package/dist-cjs/identity/index.js +39 -0
  126. package/dist-cjs/identity/internal-adapter.js +91 -0
  127. package/dist-cjs/index.js +63 -0
  128. package/dist-cjs/metadata/completeness.js +108 -0
  129. package/dist-cjs/metadata/dependencies.js +110 -0
  130. package/dist-cjs/metadata/index.js +76 -0
  131. package/dist-cjs/metadata/registry.js +207 -0
  132. package/dist-cjs/package.json +3 -0
  133. package/dist-cjs/risk/evaluator.js +63 -0
  134. package/dist-cjs/risk/index.js +35 -0
  135. package/dist-cjs/risk/risk-engine.js +290 -0
  136. package/dist-cjs/risk/signals.js +106 -0
  137. package/dist-cjs/risk/thresholds.js +63 -0
  138. package/dist-cjs/session/index.js +35 -0
  139. package/dist-cjs/session/lifetimes.js +70 -0
  140. package/dist-cjs/session/ports.js +23 -0
  141. package/dist-cjs/session/session-authority.js +398 -0
  142. package/package.json +13 -10
@@ -0,0 +1,72 @@
1
+ /**
2
+ * The FRAMEWORK-OWNED record-permit BASELINE (gate 6, design §5.2) — a PURE,
3
+ * declaration-driven permit source computed IN CORE (no DB, no rows, no adapter).
4
+ *
5
+ * This replaces the app-supplied "no rule = allow" fail-open smell with a baseline
6
+ * the framework OWNS and the app cannot weaken. It is derived entirely from the
7
+ * object type's ACCESS POSTURE (design §3, threaded onto the {@link ObjectTypeDescriptor}
8
+ * by the registry bridge) and, for owned types, ONE decision attribute the ENGINE
9
+ * supplies (`ownerId` — the existing record's owner column, fetched tenant-scoped by
10
+ * the engine BEFORE `decide()`; core never touches the DB — ADR-0003).
11
+ *
12
+ * The three postures (design §5.2):
13
+ * - `owned` → allow IFF `attributes.ownerId === principal.id` (STRICT ===).
14
+ * The DAC owner baseline: a principal passes for their OWN records.
15
+ * A missing/mismatched/undefined `ownerId` does NOT allow.
16
+ * - `system` → allow. Identity/infra (company/user/role): the object-type grant
17
+ * (gate 5) already governs; the record tier adds no narrowing.
18
+ * - `tenantScoped` → allow. The tenant gate (gate 3) already isolated the record to the
19
+ * actor's tenant; the record baseline adds no further narrowing.
20
+ * - (no access declared / unknown type) → does NOT allow (fail-CLOSED). A rule/share
21
+ * must permit it; the baseline never manufactures an allow for an
22
+ * un-declared type.
23
+ *
24
+ * The baseline is a WIDENING source: it is UNIONed with the admin policy + shares in the
25
+ * permit tier (deny-wins is unchanged — an explicit admin deny still overrides it).
26
+ *
27
+ * PURE + zero-dep (ADR-0003): reads only the resolved descriptor from the registry, the
28
+ * principal, and `ctx.context.attributes`. No I/O.
29
+ */
30
+ /**
31
+ * Compute the framework-owned record-permit baseline for this record+principal.
32
+ *
33
+ * Returns `true` when the baseline affirmatively permits (owner match / system /
34
+ * tenantScoped), `false` otherwise (no framework baseline — the policy/share must
35
+ * permit). NEVER throws — it is a pure comparison over already-resolved inputs.
36
+ *
37
+ * @param ctx the shared gate context (record-level resource; `ctx.deps.registry`
38
+ * resolves the descriptor's access posture; `ctx.context.attributes.ownerId` is the
39
+ * engine-supplied owner of the existing row for `owned` types).
40
+ */
41
+ export function evaluateOwnerBaseline(ctx) {
42
+ const descriptor = ctx.deps.registry.resolveObjectType(ctx.resource.typeKey);
43
+ const access = descriptor?.access;
44
+ // No access posture on the type ⇒ NO framework baseline. Fail-closed: the baseline
45
+ // does not allow; a rule/share must permit (never invent an allow for an undeclared
46
+ // type — that would be the old fail-open hole).
47
+ if (!access)
48
+ return false;
49
+ // system / tenantScoped ⇒ grant-governed at the record tier (gate 5 / gate 3 already
50
+ // did the governing). The baseline allows; nothing further to narrow here.
51
+ if (access.system === true)
52
+ return true;
53
+ if (access.tenantScoped === true && access.owned !== true)
54
+ return true;
55
+ // owned ⇒ DAC owner baseline: allow ONLY the principal that owns the record. STRICT
56
+ // ===: a missing or non-matching ownerId does NOT allow, and a non-string attribute
57
+ // cannot masquerade as a match. The ownerId (and the principal id) MUST be a NON-EMPTY
58
+ // string — an empty-string identity ('') must never self-authorize: `'' === ''` would
59
+ // otherwise fail OPEN (a principal.id='' reading a record whose owner column is ''/coerced
60
+ // to '' would be permitted). Defense-in-depth: the HTTP layer already rejects empty ids,
61
+ // but this security primitive must not depend on that — it fails closed on empty identity.
62
+ if (access.owned === true) {
63
+ const ownerId = ctx.context.attributes?.ownerId;
64
+ return (typeof ownerId === 'string' &&
65
+ ownerId.length > 0 &&
66
+ ownerId === ctx.principal.id);
67
+ }
68
+ // owned:false, tenantScoped:false, system:false — an explicitly ungoverned posture.
69
+ // No baseline permit (fail-closed).
70
+ return false;
71
+ }
72
+ //# sourceMappingURL=owner-baseline.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"owner-baseline.js","sourceRoot":"","sources":["../../../src/authorization/record/owner-baseline.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AAIH;;;;;;;;;;GAUG;AACH,MAAM,UAAU,qBAAqB,CAAC,GAAgB;IACpD,MAAM,UAAU,GAAG,GAAG,CAAC,IAAI,CAAC,QAAQ,CAAC,iBAAiB,CAAC,GAAG,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC;IAC7E,MAAM,MAAM,GAAG,UAAU,EAAE,MAAM,CAAC;IAClC,mFAAmF;IACnF,oFAAoF;IACpF,gDAAgD;IAChD,IAAI,CAAC,MAAM;QAAE,OAAO,KAAK,CAAC;IAE1B,qFAAqF;IACrF,2EAA2E;IAC3E,IAAI,MAAM,CAAC,MAAM,KAAK,IAAI;QAAE,OAAO,IAAI,CAAC;IACxC,IAAI,MAAM,CAAC,YAAY,KAAK,IAAI,IAAI,MAAM,CAAC,KAAK,KAAK,IAAI;QAAE,OAAO,IAAI,CAAC;IAEvE,oFAAoF;IACpF,oFAAoF;IACpF,uFAAuF;IACvF,sFAAsF;IACtF,2FAA2F;IAC3F,yFAAyF;IACzF,2FAA2F;IAC3F,IAAI,MAAM,CAAC,KAAK,KAAK,IAAI,EAAE,CAAC;QAC1B,MAAM,OAAO,GAAG,GAAG,CAAC,OAAO,CAAC,UAAU,EAAE,OAAO,CAAC;QAChD,OAAO,CACL,OAAO,OAAO,KAAK,QAAQ;YAC3B,OAAO,CAAC,MAAM,GAAG,CAAC;YAClB,OAAO,KAAK,GAAG,CAAC,SAAS,CAAC,EAAE,CAC7B,CAAC;IACJ,CAAC;IAED,oFAAoF;IACpF,oCAAoC;IACpC,OAAO,KAAK,CAAC;AACf,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"permit-tier.d.ts","sourceRoot":"","sources":["../../../src/authorization/record/permit-tier.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAyCG;AAEH,OAAO,KAAK,EAA4B,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAKzF,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,oCAAoC,CAAC;AAEtF;;;;;;;;;;GAUG;AACH,wBAAgB,sBAAsB,CACpC,OAAO,GAAE,2BAAgC,GACxC,cAAc,CAuBhB"}
1
+ {"version":3,"file":"permit-tier.d.ts","sourceRoot":"","sources":["../../../src/authorization/record/permit-tier.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAyCG;AAEH,OAAO,KAAK,EAA4B,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAMzF,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,oCAAoC,CAAC;AAEtF;;;;;;;;;;GAUG;AACH,wBAAgB,sBAAsB,CACpC,OAAO,GAAE,2BAAgC,GACxC,cAAc,CAkChB"}
@@ -43,6 +43,7 @@
43
43
  import { gateAllow, gateDeny } from '../decision-authority.js';
44
44
  import { denyExplicitPolicy, denyNoRecordPermit } from '../reason-codes.js';
45
45
  import { evaluateRecordPolicy } from './rule-evaluator.js';
46
+ import { evaluateOwnerBaseline } from './owner-baseline.js';
46
47
  import { evaluateRecordShare } from './shares.js';
47
48
  /**
48
49
  * Build the FINAL gate-6 {@link RecordPermitFn} — the composed policy ∪ share
@@ -65,14 +66,24 @@ export function createRecordPermitGate(options = {}) {
65
66
  if (policy.explicitDeny) {
66
67
  return gateDeny(denyExplicitPolicy());
67
68
  }
68
- // 3. UNION — policy allow ∪ share/cross-tenant-grant permit. The share is only
69
- // consulted now that the policy did not explicitly deny. A transient throw
70
- // from the share evaluator PROPAGATES (not caught).
69
+ // 3. FRAMEWORK-OWNED BASELINE (design §5.2) — the declaration-driven owner/system/
70
+ // tenantScoped permit computed IN CORE (pure, no DB, cannot be swapped/weakened).
71
+ // A widening source unioned with policy + share. Evaluated AFTER the explicit-deny
72
+ // short-circuit so an admin deny still wins over the owner's own record. Pure —
73
+ // never throws.
74
+ const baseline = evaluateOwnerBaseline(ctx);
75
+ if (policy.allow || baseline) {
76
+ return gateAllow();
77
+ }
78
+ // 4. UNION — policy allow ∪ baseline ∪ share/cross-tenant-grant permit. The share is
79
+ // only consulted now that neither the policy nor the baseline permitted (and the
80
+ // policy did not explicitly deny). A transient throw from the share evaluator
81
+ // PROPAGATES (not caught).
71
82
  const share = await evaluateRecordShare(ctx, options);
72
- if (policy.allow || share) {
83
+ if (share) {
73
84
  return gateAllow();
74
85
  }
75
- // 4. No permit from any source ⇒ a normal `no_record_permit` deny input.
86
+ // 5. No permit from any source ⇒ a normal `no_record_permit` deny input.
76
87
  return gateDeny(denyNoRecordPermit());
77
88
  };
78
89
  }
@@ -1 +1 @@
1
- {"version":3,"file":"permit-tier.js","sourceRoot":"","sources":["../../../src/authorization/record/permit-tier.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAyCG;AAGH,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AAC/D,OAAO,EAAE,kBAAkB,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AAC5E,OAAO,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAC;AAC3D,OAAO,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;AAGlD;;;;;;;;;;GAUG;AACH,MAAM,UAAU,sBAAsB,CACpC,UAAuC,EAAE;IAEzC,OAAO,KAAK,UAAU,YAAY,CAAC,GAAgB;QACjD,gFAAgF;QAChF,mEAAmE;QACnE,MAAM,MAAM,GAAG,MAAM,oBAAoB,CAAC,GAAG,CAAC,CAAC;QAE/C,8EAA8E;QAC9E,wEAAwE;QACxE,IAAI,MAAM,CAAC,YAAY,EAAE,CAAC;YACxB,OAAO,QAAQ,CAAC,kBAAkB,EAAE,CAAC,CAAC;QACxC,CAAC;QAED,+EAA+E;QAC/E,8EAA8E;QAC9E,uDAAuD;QACvD,MAAM,KAAK,GAAG,MAAM,mBAAmB,CAAC,GAAG,EAAE,OAAO,CAAC,CAAC;QACtD,IAAI,MAAM,CAAC,KAAK,IAAI,KAAK,EAAE,CAAC;YAC1B,OAAO,SAAS,EAAE,CAAC;QACrB,CAAC;QAED,yEAAyE;QACzE,OAAO,QAAQ,CAAC,kBAAkB,EAAE,CAAC,CAAC;IACxC,CAAC,CAAC;AACJ,CAAC"}
1
+ {"version":3,"file":"permit-tier.js","sourceRoot":"","sources":["../../../src/authorization/record/permit-tier.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAyCG;AAGH,OAAO,EAAE,SAAS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20
20
  * tenant; a missing/empty tenant REJECTS (§2/§7.3, tenant is the boundary).
21
- * 2. SUPERUSER SAFETY — `isPlatformSuperuser` defaults `false` and is honored
22
- * ONLY from a mapper's trusted `trustedSuperuserSignal`; an attacker-supplied
21
+ * 2. ROOT SAFETY — `isRoot` defaults `false` and is honored
22
+ * ONLY from a mapper's trusted `trustedRootSignal`; an attacker-supplied
23
23
  * `superuser`/`isPlatformSuperuser` claim can never flip it (default-deny).
24
24
  *
25
25
  * ADR-0003: framework-agnostic — no framework / HTTP / DB imports.
@@ -36,22 +36,22 @@ export interface CreateIdentityBrokerOptions {
36
36
  * Explicit set of claim mappers (IdP adapters) to register. When provided, the
37
37
  * broker uses EXACTLY these — the built-in Internal adapter is NOT auto-added
38
38
  * (so a deployment can opt out of it). When omitted, a single Internal adapter
39
- * is registered by default (see {@link internalSuperuserIds}).
39
+ * is registered by default (see {@link internalRootIds}).
40
40
  */
41
41
  readonly mappers?: readonly IdentityClaimMapper[];
42
42
  /**
43
- * SUPERUSER SAFETY allowlist for the DEFAULT Internal adapter (only used when
44
- * `mappers` is omitted). Server-side trusted ids that are platform superusers.
45
- * Default: empty ⇒ no superusers (default-deny).
43
+ * ROOT SAFETY allowlist for the DEFAULT Internal adapter (only used when
44
+ * `mappers` is omitted). Server-side trusted ids that are roots.
45
+ * Default: empty ⇒ no roots (default-deny).
46
46
  */
47
- readonly internalSuperuserIds?: readonly string[];
47
+ readonly internalRootIds?: readonly string[];
48
48
  }
49
49
  /**
50
50
  * Wire the mapper registry + adapters and return an object implementing the
51
51
  * frozen {@link IdentityBroker}. This is the engine's public entry point.
52
52
  *
53
53
  * - No `mappers` given ⇒ registers ONE reference Internal adapter (canonical
54
- * claim shape) with the given (default empty) superuser allowlist.
54
+ * claim shape) with the given (default empty) root allowlist.
55
55
  * - `mappers` given ⇒ registers exactly those (the seam future protocol adapters
56
56
  * plug into). Duplicate sources fail-closed at registration.
57
57
  */
@@ -1 +1 @@
1
- {"version":3,"file":"broker.d.ts","sourceRoot":"","sources":["../../src/identity/broker.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AAEH,OAAO,EACL,KAAK,mBAAmB,EAEzB,MAAM,mBAAmB,CAAC;AAE3B,OAAO,EAEL,KAAK,cAAc,EAGpB,MAAM,YAAY,CAAC;AAYpB,2EAA2E;AAC3E,qBAAa,0BAA2B,SAAQ,KAAK;gBACvC,OAAO,EAAE,MAAM;CAI5B;AA8FD,gDAAgD;AAChD,MAAM,WAAW,2BAA2B;IAC1C;;;;;OAKG;IACH,QAAQ,CAAC,OAAO,CAAC,EAAE,SAAS,mBAAmB,EAAE,CAAC;IAClD;;;;OAIG;IACH,QAAQ,CAAC,oBAAoB,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;CACnD;AAED;;;;;;;;GAQG;AACH,wBAAgB,oBAAoB,CAClC,OAAO,GAAE,2BAAgC,GACxC,cAAc,CAkBhB"}
1
+ {"version":3,"file":"broker.d.ts","sourceRoot":"","sources":["../../src/identity/broker.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AAEH,OAAO,EACL,KAAK,mBAAmB,EAEzB,MAAM,mBAAmB,CAAC;AAE3B,OAAO,EAEL,KAAK,cAAc,EAGpB,MAAM,YAAY,CAAC;AAYpB,2EAA2E;AAC3E,qBAAa,0BAA2B,SAAQ,KAAK;gBACvC,OAAO,EAAE,MAAM;CAI5B;AA8FD,gDAAgD;AAChD,MAAM,WAAW,2BAA2B;IAC1C;;;;;OAKG;IACH,QAAQ,CAAC,OAAO,CAAC,EAAE,SAAS,mBAAmB,EAAE,CAAC;IAClD;;;;OAIG;IACH,QAAQ,CAAC,eAAe,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;CAC9C;AAED;;;;;;;;GAQG;AACH,wBAAgB,oBAAoB,CAClC,OAAO,GAAE,2BAAgC,GACxC,cAAc,CAkBhB"}
@@ -18,8 +18,8 @@
18
18
  * Two security invariants, both fail-closed:
19
19
  * 1. TENANT-BINDING — every Principal MUST be bound to exactly one non-empty
20
20
  * tenant; a missing/empty tenant REJECTS (§2/§7.3, tenant is the boundary).
21
- * 2. SUPERUSER SAFETY — `isPlatformSuperuser` defaults `false` and is honored
22
- * ONLY from a mapper's trusted `trustedSuperuserSignal`; an attacker-supplied
21
+ * 2. ROOT SAFETY — `isRoot` defaults `false` and is honored
22
+ * ONLY from a mapper's trusted `trustedRootSignal`; an attacker-supplied
23
23
  * `superuser`/`isPlatformSuperuser` claim can never flip it (default-deny).
24
24
  *
25
25
  * ADR-0003: framework-agnostic — no framework / HTTP / DB imports.
@@ -86,17 +86,17 @@ class BrokerImpl {
86
86
  const kind = this.resolveKind(candidate.kind, id, source);
87
87
  // roleIds — default to []; freeze a defensive copy so the Principal is immutable.
88
88
  const roleIds = Object.freeze([...(candidate.roleIds ?? [])]);
89
- // isPlatformSuperuser — SUPERUSER SAFETY: default-deny. Honored ONLY from the
89
+ // isRoot — ROOT SAFETY: default-deny. Honored ONLY from the
90
90
  // mapper's TRUSTED signal (an allowlisted, first-party path). We NEVER read
91
91
  // any raw claim here, so an attacker-controllable `superuser`/`isPlatformSuperuser`
92
92
  // claim cannot influence this value.
93
- const isPlatformSuperuser = candidate.trustedSuperuserSignal === true;
93
+ const isRoot = candidate.trustedRootSignal === true;
94
94
  return Object.freeze({
95
95
  kind,
96
96
  id,
97
97
  tenantId,
98
98
  roleIds,
99
- isPlatformSuperuser,
99
+ isRoot,
100
100
  });
101
101
  }
102
102
  /** Resolve + validate the principal kind (default `user`, reject unknown). */
@@ -114,15 +114,15 @@ class BrokerImpl {
114
114
  * frozen {@link IdentityBroker}. This is the engine's public entry point.
115
115
  *
116
116
  * - No `mappers` given ⇒ registers ONE reference Internal adapter (canonical
117
- * claim shape) with the given (default empty) superuser allowlist.
117
+ * claim shape) with the given (default empty) root allowlist.
118
118
  * - `mappers` given ⇒ registers exactly those (the seam future protocol adapters
119
119
  * plug into). Duplicate sources fail-closed at registration.
120
120
  */
121
121
  export function createIdentityBroker(options = {}) {
122
122
  const registry = new IdentityClaimMapperRegistry();
123
123
  if (options.mappers === undefined) {
124
- registry.register(createInternalIdentityAdapter(options.internalSuperuserIds !== undefined
125
- ? { superuserIds: options.internalSuperuserIds }
124
+ registry.register(createInternalIdentityAdapter(options.internalRootIds !== undefined
125
+ ? { rootIds: options.internalRootIds }
126
126
  : {}));
127
127
  }
128
128
  else {
@@ -1 +1 @@
1
- {"version":3,"file":"broker.js","sourceRoot":"","sources":["../../src/identity/broker.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AAEH,OAAO,EAEL,2BAA2B,GAC5B,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,6BAA6B,EAAE,MAAM,uBAAuB,CAAC;AAQtE,iFAAiF;AACjF,MAAM,qBAAqB,GAA+B,IAAI,GAAG,CAAgB;IAC/E,MAAM;IACN,YAAY;IACZ,iBAAiB;CAClB,CAAC,CAAC;AAEH,8DAA8D;AAC9D,MAAM,sBAAsB,GAAkB,MAAM,CAAC;AAErD,2EAA2E;AAC3E,MAAM,OAAO,0BAA2B,SAAQ,KAAK;IACnD,YAAY,OAAe;QACzB,KAAK,CAAC,OAAO,CAAC,CAAC;QACf,IAAI,CAAC,IAAI,GAAG,4BAA4B,CAAC;IAC3C,CAAC;CACF;AAED;;;GAGG;AACH,MAAM,UAAU;IACe;IAA7B,YAA6B,QAAqC;QAArC,aAAQ,GAAR,QAAQ,CAA6B;IAAG,CAAC;IAEtE,KAAK,CAAC,SAAS,CAAC,SAAoC;QAClD,8EAA8E;QAC9E,0EAA0E;QAC1E,sEAAsE;QACtE,2EAA2E;QAC3E,IAAI,SAAS,KAAK,IAAI,IAAI,OAAO,SAAS,KAAK,QAAQ,EAAE,CAAC;YACxD,MAAM,IAAI,0BAA0B,CAClC,4EAA4E,CAC7E,CAAC;QACJ,CAAC;QAED,4EAA4E;QAC5E,MAAM,EAAE,MAAM,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AAW,CACjB,aAAiC,EACjC,EAAU,EACV,MAAc;QAEd,IAAI,aAAa,KAAK,SAAS;YAAE,OAAO,sBAAsB,CAAC;QAC/D,IAAI,CAAC,qBAAqB,CAAC,GAAG,CAAC,aAA8B,CAAC,EAAE,CAAC;YAC/D,MAAM,IAAI,0BAA0B,CAClC,yBAAyB,EAAE,WAAW,MAAM,uBAAuB,aAAa,wDAAwD,CACzI,CAAC;QACJ,CAAC;QACD,OAAO,aAA8B,CAAC;IACxC,CAAC;CACF;AAmBD;;;;;;;;GAQG;AACH,MAAM,UAAU,oBAAoB,CAClC,UAAuC,EAAE;IAEzC,MAAM,QAAQ,GAAG,IAAI,2BAA2B,EAAE,CAAC;IAEnD,IAAI,OAAO,CAAC,OAAO,KAAK,SAAS,EAAE,CAAC;QAClC,QAAQ,CAAC,QAAQ,CACf,6BAA6B,CAC3B,OAAO,CAAC,eAAe,KAAK,SAAS;YACnC,CAAC,CAAC,EAAE,OAAO,EAAE,OAAO,CAAC,eAAe,EAAE;YACtC,CAAC,CAAC,EAAE,CACP,CACF,CAAC;IACJ,CAAC;SAAM,CAAC;QACN,KAAK,MAAM,MAAM,IAAI,OAAO,CAAC,OAAO,EAAE,CAAC;YACrC,QAAQ,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;QAC5B,CAAC;IACH,CAAC;IAED,OAAO,IAAI,UAAU,CAAC,QAAQ,CAAC,CAAC;AAClC,CAAC"}
@@ -3,8 +3,8 @@
3
3
  * seam that turns a source's opaque, provider-native claims into a set of
4
4
  * *candidate* principal fields the normalization core then validates + binds.
5
5
  *
6
- * This is the seam the 7 deferred protocol adapters (OIDC / SAML / LDAP / Entra
7
- * / Cognito / Okta / Google) will each implement — ONE `IdentityClaimMapper` per
6
+ * This is the seam the 7 deferred protocol adapters (OIDC / SAML / LDAP-based
7
+ * external IdPs) will each implement — ONE `IdentityClaimMapper` per
8
8
  * source. It is deliberately MINIMAL (ADR-0023 §7 Rule of Three): a `source`
9
9
  * discriminator + a pure `map()` + a tiny registry. It grows an abstraction only
10
10
  * when a third concrete need appears.
@@ -12,8 +12,8 @@
12
12
  * SCOPE: claim → candidate fields ONLY. A mapper does NOT verify the assertion
13
13
  * (authenticity is Authentication's job, step 5), does NOT enforce invariants
14
14
  * (the core does — a mapper may legitimately produce an incomplete candidate, and
15
- * the core fail-closes on it), and does NOT decide the superuser flag from
16
- * attacker-controllable claims (see {@link CandidatePrincipalFields.trustedSuperuserSignal}).
15
+ * the core fail-closes on it), and does NOT decide the root flag from
16
+ * attacker-controllable claims (see {@link CandidatePrincipalFields.trustedRootSignal}).
17
17
  *
18
18
  * ADR-0003: framework-agnostic — no framework / HTTP / DB imports here.
19
19
  */
@@ -38,16 +38,16 @@ export interface CandidatePrincipalFields {
38
38
  /** Candidate role/group ids. Absent ⇒ the core defaults to `[]`. */
39
39
  readonly roleIds?: readonly string[];
40
40
  /**
41
- * SUPERUSER SAFETY (security-critical). A mapper sets this to `true` ONLY when
41
+ * ROOT SAFETY (security-critical). A mapper sets this to `true` ONLY when
42
42
  * its OWN, trusted, explicitly-designed path establishes that the assertion is
43
- * the platform superuser — e.g. the first-party Internal provider honoring a
43
+ * the root — e.g. the first-party Internal provider honoring a
44
44
  * signal on ITS trusted source. An external protocol adapter (OIDC/SAML/…) must
45
45
  * NEVER derive this from a caller-supplied claim like `superuser:true`; it must
46
46
  * leave this `undefined`/`false`. The core defaults the resulting Principal's
47
- * `isPlatformSuperuser` to `false` and only ever honors THIS explicit field —
47
+ * `isRoot` to `false` and only ever honors THIS explicit field —
48
48
  * so an attacker-controllable claim can never flip it (default-deny).
49
49
  */
50
- readonly trustedSuperuserSignal?: boolean;
50
+ readonly trustedRootSignal?: boolean;
51
51
  }
52
52
  /**
53
53
  * A single IdP adapter: maps one `source`'s native claims to
@@ -1 +1 @@
1
- {"version":3,"file":"claim-mapper.d.ts","sourceRoot":"","sources":["../../src/identity/claim-mapper.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAk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,QAAQ,CAAC,EAAE,MAAM,CAAC;IAC3B;;;OAGG;IACH,QAAQ,CAAC,IAAI,CAAC,EAAE,aAAa,GAAG,MAAM,CAAC;IACvC,oEAAoE;IACpE,QAAQ,CAAC,OAAO,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IACrC;;;;;;;;;OASG;IACH,QAAQ,CAAC,iBAAiB,CAAC,EAAE,OAAO,CAAC;CACtC;AAED;;;;GAIG;AACH,MAAM,WAAW,mBAAmB;IAClC,oEAAoE;IACpE,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB;;;;OAIG;IACH,GAAG,CAAC,MAAM,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,GAAG,wBAAwB,CAAC;CAC1E;AAED;;;;;GAKG;AACH,qBAAa,2BAA2B;IACtC,OAAO,CAAC,QAAQ,CAAC,OAAO,CAA0C;IAElE;;;;OAIG;IACH,QAAQ,CAAC,MAAM,EAAE,mBAAmB,GAAG,IAAI;IAa3C,6EAA6E;IAC7E,OAAO,CAAC,MAAM,EAAE,MAAM,GAAG,mBAAmB,GAAG,SAAS;CAGzD"}
@@ -3,8 +3,8 @@
3
3
  * seam that turns a source's opaque, provider-native claims into a set of
4
4
  * *candidate* principal fields the normalization core then validates + binds.
5
5
  *
6
- * This is the seam the 7 deferred protocol adapters (OIDC / SAML / LDAP / Entra
7
- * / Cognito / Okta / Google) will each implement — ONE `IdentityClaimMapper` per
6
+ * This is the seam the 7 deferred protocol adapters (OIDC / SAML / LDAP-based
7
+ * external IdPs) will each implement — ONE `IdentityClaimMapper` per
8
8
  * source. It is deliberately MINIMAL (ADR-0023 §7 Rule of Three): a `source`
9
9
  * discriminator + a pure `map()` + a tiny registry. It grows an abstraction only
10
10
  * when a third concrete need appears.
@@ -12,8 +12,8 @@
12
12
  * SCOPE: claim → candidate fields ONLY. A mapper does NOT verify the assertion
13
13
  * (authenticity is Authentication's job, step 5), does NOT enforce invariants
14
14
  * (the core does — a mapper may legitimately produce an incomplete candidate, and
15
- * the core fail-closes on it), and does NOT decide the superuser flag from
16
- * attacker-controllable claims (see {@link CandidatePrincipalFields.trustedSuperuserSignal}).
15
+ * the core fail-closes on it), and does NOT decide the root flag from
16
+ * attacker-controllable claims (see {@link CandidatePrincipalFields.trustedRootSignal}).
17
17
  *
18
18
  * ADR-0003: framework-agnostic — no framework / HTTP / DB imports here.
19
19
  */
@@ -34,10 +34,10 @@ export interface Principal {
34
34
  /** Roles / groups this principal belongs to, by stable id. */
35
35
  readonly roleIds: readonly string[];
36
36
  /**
37
- * The platform superuser bypasses the tenant gate (§7.3). Ordinary principals
37
+ * The root identity bypasses the tenant gate (§7.3). Ordinary principals
38
38
  * are `false`. Defaulting/enforcement is a later layer's concern.
39
39
  */
40
- readonly isPlatformSuperuser: boolean;
40
+ readonly isRoot: boolean;
41
41
  }
42
42
  /** A raw assertion from some external IdP, prior to normalization. */
43
43
  export interface ExternalIdentityAssertion {
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/identity/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,0EAA0E;AAC1E,MAAM,MAAM,aAAa,GAAG,MAAM,GAAG,YAAY,GAAG,iBAAiB,CAAC;AAEtE,2EAA2E;AAC3E,MAAM,WAAW,MAAM;IACrB,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,kEAAkE;IAClE,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;CAC9B;AAED;;;GAGG;AACH,MAAM,WAAW,SAAS;IACxB,QAAQ,CAAC,IAAI,EAAE,aAAa,CAAC;IAC7B,iEAAiE;IACjE,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,8EAA8E;IAC9E,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,8DAA8D;IAC9D,QAAQ,CAAC,OAAO,EAAE,SAAS,MAAM,EAAE,CAAC;IACpC;;;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,MAAM,CAAC;IACxB,oFAAoF;IACpF,QAAQ,CAAC,MAAM,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;CACpD;AAED;;;GAGG;AACH,MAAM,WAAW,cAAc;IAC7B,wEAAwE;IACxE,SAAS,CAAC,SAAS,EAAE,yBAAyB,GAAG,OAAO,CAAC,SAAS,CAAC,CAAC;CACrE;AAKD,cAAc,mBAAmB,CAAC;AAElC,cAAc,uBAAuB,CAAC;AAEtC,cAAc,aAAa,CAAC"}
@@ -3,7 +3,7 @@
3
3
  * provider** (Shield's own first-party IdP path).
4
4
  *
5
5
  * It expects a CANONICAL claim shape (`id`, `tenantId`, `kind`, `roleIds`, and a
6
- * superuser signal) and maps it 1:1 to {@link CandidatePrincipalFields}. This is
6
+ * root signal) and maps it 1:1 to {@link CandidatePrincipalFields}. This is
7
7
  * the "own IdP" path AND the shape the future protocol adapters target: an OIDC /
8
8
  * SAML / LDAP adapter's job is to translate its provider-native claims INTO this
9
9
  * canonical shape, then this same normalization guarantees apply.
@@ -12,10 +12,10 @@
12
12
  * EXACT SAME `map()` as a `user` — there is no "is-this-a-machine" branch. Kind
13
13
  * is carried through as data.
14
14
  *
15
- * SUPERUSER SAFETY (security-critical). This adapter is the ONE trusted path that
16
- * may propose the platform-superuser flag, and it does so ONLY via an EXPLICIT,
15
+ * ROOT SAFETY (security-critical). This adapter is the ONE trusted path that
16
+ * may propose the root flag, and it does so ONLY via an EXPLICIT,
17
17
  * ALLOWLISTED mechanism: the Internal source is configured with the exact set of
18
- * canonical ids that ARE platform superusers (`superuserIds`). The flag is set
18
+ * canonical ids that ARE roots (`rootIds`). The flag is set
19
19
  * `true` iff the asserted `id` is in that allowlist — it is NEVER read from a
20
20
  * caller-supplied `superuser` / `isPlatformSuperuser` claim. So even on this
21
21
  * trusted source, an attacker who can influence claim VALUES cannot flip it
@@ -27,25 +27,25 @@
27
27
  import { type IdentityClaimMapper } from './claim-mapper.js';
28
28
  /** The canonical `source` id for Shield's first-party Internal provider. */
29
29
  export declare const INTERNAL_IDENTITY_SOURCE = "internal";
30
- /** Configuration for the Internal adapter — the trusted superuser allowlist. */
30
+ /** Configuration for the Internal adapter — the trusted root allowlist. */
31
31
  export interface InternalAdapterConfig {
32
32
  /**
33
- * SUPERUSER SAFETY: the explicit, server-side allowlist of canonical principal
34
- * ids that ARE platform superusers on the Internal source. The ONLY way the
35
- * `isPlatformSuperuser` flag is ever set. Default: empty ⇒ nobody is a
36
- * superuser (default-deny). An external claim never contributes to this set.
33
+ * ROOT SAFETY: the explicit, server-side allowlist of canonical principal
34
+ * ids that ARE roots on the Internal source. The ONLY way the
35
+ * `isRoot` flag is ever set. Default: empty ⇒ nobody is a
36
+ * root (default-deny). An external claim never contributes to this set.
37
37
  */
38
- readonly superuserIds?: readonly string[];
38
+ readonly rootIds?: readonly string[];
39
39
  /**
40
40
  * Optional override of the `source` this adapter answers to (defaults to
41
41
  * {@link INTERNAL_IDENTITY_SOURCE}). Lets a deployment name its own IdP while
42
- * reusing the canonical-shape mapping + trusted superuser path.
42
+ * reusing the canonical-shape mapping + trusted root path.
43
43
  */
44
44
  readonly source?: string;
45
45
  }
46
46
  /**
47
47
  * Build the reference Internal adapter. It maps the canonical claim shape 1:1
48
- * and — via the trusted, allowlisted mechanism only — proposes the superuser
48
+ * and — via the trusted, allowlisted mechanism only — proposes the root
49
49
  * signal. It performs NO verification (auth's job) and enforces NO invariants
50
50
  * (the core does): a missing `id`/`tenantId` is returned absent so the core
51
51
  * fail-closes uniformly.
@@ -1 +1 @@
1
- {"version":3,"file":"internal-adapter.d.ts","sourceRoot":"","sources":["../../src/identity/internal-adapter.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AAEH,OAAO,EAEL,KAAK,mBAAmB,EACzB,MAAM,mBAAmB,CAAC;AAE3B,4EAA4E;AAC5E,eAAO,MAAM,wBAAwB,aAAa,CAAC;AAEnD,gFAAgF;AAChF,MAAM,WAAW,qBAAqB;IACpC;;;;;OAKG;IACH,QAAQ,CAAC,YAAY,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IAC1C;;;;OAIG;IACH,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC;CAC1B;AAoBD;;;;;;GAMG;AACH,wBAAgB,6BAA6B,CAC3C,MAAM,GAAE,qBAA0B,GACjC,mBAAmB,CAmCrB"}
1
+ {"version":3,"file":"internal-adapter.d.ts","sourceRoot":"","sources":["../../src/identity/internal-adapter.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AAEH,OAAO,EAEL,KAAK,mBAAmB,EACzB,MAAM,mBAAmB,CAAC;AAE3B,4EAA4E;AAC5E,eAAO,MAAM,wBAAwB,aAAa,CAAC;AAEnD,2EAA2E;AAC3E,MAAM,WAAW,qBAAqB;IACpC;;;;;OAKG;IACH,QAAQ,CAAC,OAAO,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IACrC;;;;OAIG;IACH,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC;CAC1B;AAoBD;;;;;;GAMG;AACH,wBAAgB,6BAA6B,CAC3C,MAAM,GAAE,qBAA0B,GACjC,mBAAmB,CAmCrB"}
@@ -3,7 +3,7 @@
3
3
  * provider** (Shield's own first-party IdP path).
4
4
  *
5
5
  * It expects a CANONICAL claim shape (`id`, `tenantId`, `kind`, `roleIds`, and a
6
- * superuser signal) and maps it 1:1 to {@link CandidatePrincipalFields}. This is
6
+ * root signal) and maps it 1:1 to {@link CandidatePrincipalFields}. This is
7
7
  * the "own IdP" path AND the shape the future protocol adapters target: an OIDC /
8
8
  * SAML / LDAP adapter's job is to translate its provider-native claims INTO this
9
9
  * canonical shape, then this same normalization guarantees apply.
@@ -12,10 +12,10 @@
12
12
  * EXACT SAME `map()` as a `user` — there is no "is-this-a-machine" branch. Kind
13
13
  * is carried through as data.
14
14
  *
15
- * SUPERUSER SAFETY (security-critical). This adapter is the ONE trusted path that
16
- * may propose the platform-superuser flag, and it does so ONLY via an EXPLICIT,
15
+ * ROOT SAFETY (security-critical). This adapter is the ONE trusted path that
16
+ * may propose the root flag, and it does so ONLY via an EXPLICIT,
17
17
  * ALLOWLISTED mechanism: the Internal source is configured with the exact set of
18
- * canonical ids that ARE platform superusers (`superuserIds`). The flag is set
18
+ * canonical ids that ARE roots (`rootIds`). The flag is set
19
19
  * `true` iff the asserted `id` is in that allowlist — it is NEVER read from a
20
20
  * caller-supplied `superuser` / `isPlatformSuperuser` claim. So even on this
21
21
  * trusted source, an attacker who can influence claim VALUES cannot flip it
@@ -47,7 +47,7 @@ function asStrArray(value) {
47
47
  }
48
48
  /**
49
49
  * Build the reference Internal adapter. It maps the canonical claim shape 1:1
50
- * and — via the trusted, allowlisted mechanism only — proposes the superuser
50
+ * and — via the trusted, allowlisted mechanism only — proposes the root
51
51
  * signal. It performs NO verification (auth's job) and enforces NO invariants
52
52
  * (the core does): a missing `id`/`tenantId` is returned absent so the core
53
53
  * fail-closes uniformly.
@@ -56,7 +56,7 @@ export function createInternalIdentityAdapter(config = {}) {
56
56
  const source = config.source ?? INTERNAL_IDENTITY_SOURCE;
57
57
  // Snapshot the allowlist into a Set at construction — it is SERVER-SIDE trusted
58
58
  // config, never influenced by an assertion's claims.
59
- const superuserIds = new Set(config.superuserIds ?? []);
59
+ const rootIds = new Set(config.rootIds ?? []);
60
60
  return {
61
61
  source,
62
62
  map(claims) {
@@ -66,16 +66,16 @@ export function createInternalIdentityAdapter(config = {}) {
66
66
  // the allowed PrincipalKind set and rejects an unrecognized value.
67
67
  const kind = asStr(claims.kind);
68
68
  const roleIds = asStrArray(claims.roleIds);
69
- // SUPERUSER SAFETY: the flag comes SOLELY from the server-side allowlist
69
+ // ROOT SAFETY: the flag comes SOLELY from the server-side allowlist
70
70
  // keyed by the asserted (trusted) id — NEVER from claims.superuser /
71
71
  // claims.isPlatformSuperuser. Those attacker-controllable claims are
72
72
  // deliberately ignored here; the core also defaults the flag false.
73
- const trustedSuperuserSignal = id !== undefined && superuserIds.has(id);
73
+ const trustedRootSignal = id !== undefined && rootIds.has(id);
74
74
  // Build with only the keys we actually have present — under
75
75
  // `exactOptionalPropertyTypes` an optional field must be OMITTED (not set
76
76
  // to `undefined`). A missing id/tenantId is returned absent so the core
77
77
  // fail-closes uniformly.
78
- const candidate = { roleIds, trustedSuperuserSignal };
78
+ const candidate = { roleIds, trustedRootSignal };
79
79
  return {
80
80
  ...candidate,
81
81
  ...(id !== undefined ? { id } : {}),
@@ -1 +1 @@
1
- {"version":3,"file":"internal-adapter.js","sourceRoot":"","sources":["../../src/identity/internal-adapter.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AAOH,4EAA4E;AAC5E,MAAM,CAAC,MAAM,wBAAwB,GAAG,UAAU,CAAC;AAmBnD,kEAAkE;AAClE,SAAS,KAAK,CAAC,KAAc;IAC3B,IAAI,OAAO,KAAK,KAAK,QAAQ;QAAE,OAAO,SAAS,CAAC;IAChD,MAAM,OAAO,GAAG,KAAK,CAAC,IAAI,EAAE,CAAC;IAC7B,OAAO,OAAO,CAAC,MAAM,KAAK,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,OAAO,CAAC;AACpD,CAAC;AAED,+EAA+E;AAC/E,SAAS,UAAU,CAAC,KAAc;IAChC,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC;QAAE,OAAO,EAAE,CAAC;IACrC,MAAM,GAAG,GAAa,EAAE,CAAC;IACzB,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE,CAAC;QACzB,MAAM,CAAC,GAAG,KAAK,CAAC,IAAI,CAAC,CAAC;QACtB,IAAI,CAAC,KAAK,SAAS;YAAE,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IACnC,CAAC;IACD,OAAO,GAAG,CAAC;AACb,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,6B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C,QAAQ,CAAC,CAAC;YACxC,2EAA2E;YAC3E,mEAAmE;YACnE,MAAM,IAAI,GAAG,KAAK,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;YAChC,MAAM,OAAO,GAAG,UAAU,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;YAE3C,oEAAoE;YACpE,qEAAqE;YACrE,qEAAqE;YACrE,oEAAoE;YACpE,MAAM,iBAAiB,GAAG,EAAE,KAAK,SAAS,IAAI,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;YAE9D,4DAA4D;YAC5D,0EAA0E;YAC1E,wEAAwE;YACxE,yBAAyB;YACzB,MAAM,SAAS,GAA6B,EAAE,OAAO,EAAE,iBAAiB,EAAE,CAAC;YAC3E,OAAO;gBACL,GAAG,SAAS;gBACZ,GAAG,CAAC,EAAE,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;gBACnC,GAAG,CAAC,QAAQ,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,QAAQ,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;gBAC/C,GAAG,CAAC,IAAI,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;aACxC,CAAC;QACJ,CAAC;KACF,CAAC;AACJ,CAAC"}
@@ -29,12 +29,43 @@ export interface FieldDescriptor {
29
29
  */
30
30
  readonly referencesTypeKey?: string;
31
31
  }
32
+ /**
33
+ * The record-tier ACCESS POSTURE of an object type — the framework-owned data
34
+ * governance declaration (design §3 "access-declaration model"), surfaced to Core so
35
+ * the record-permit baseline (gate 6) can branch on it WITHOUT the app supplying a
36
+ * fail-open adapter. Mirrors `@astram/engine`'s `AccessDeclaration`, but Core carries
37
+ * ONLY the three posture flags it needs to compute the baseline (no column/trusted
38
+ * concerns — those are the engine's chokepoint-1 job).
39
+ *
40
+ * The bridge that builds the registry from the engine registrations threads the
41
+ * engine's `access` onto this field (see the astram3 `module-registry.bridge`). A
42
+ * descriptor with NO `access` (a legacy/dynamic type that hasn't declared one) is
43
+ * treated by the baseline as "no framework baseline" — it does NOT owner/system-allow,
44
+ * so a rule/share must permit it (fail-CLOSED, never fail-open).
45
+ */
46
+ export interface RecordAccessPosture {
47
+ /** person-owned (DAC): the record-permit baseline allows only the owning principal. */
48
+ readonly owned?: boolean;
49
+ /** tenant-isolated: the tenant gate (gate 3) already isolates; the record baseline
50
+ * adds no further narrowing → grant-governed within the tenant. */
51
+ readonly tenantScoped?: boolean;
52
+ /** identity/infra type (company/user/role): grant-governed → the record baseline
53
+ * allows once the object-type grant (gate 5) has passed. */
54
+ readonly system?: boolean;
55
+ }
32
56
  /** An object type a module declares to the Core (§5, "Module model"). */
33
57
  export interface ObjectTypeDescriptor {
34
58
  /** Stable object-type key (never a table/route name) (§5.2). */
35
59
  readonly typeKey: string;
36
60
  readonly label: string;
37
61
  readonly fields: readonly FieldDescriptor[];
62
+ /**
63
+ * OPTIONAL record-tier access posture (design §3). Threaded from the engine's
64
+ * `AccessDeclaration` by the registry bridge; consumed by the record-permit
65
+ * baseline in gate 6 (`permit-tier.ts`). Absent ⇒ no framework baseline for the
66
+ * type (fail-closed — a rule/share must permit; the baseline never owner/system-allows).
67
+ */
68
+ readonly access?: RecordAccessPosture;
38
69
  }
39
70
  /**
40
71
  * A supporting read-only dependency (§5.3): a subordinate lookup auto-permitted
@@ -49,6 +80,11 @@ export interface SupportingDependency {
49
80
  */
50
81
  readonly neverAutoGrant: boolean;
51
82
  }
83
+ /** A capability's plane: `control` = governs who-may-act (identity/access admin);
84
+ * `data` = acts on tenant business content. Default `data` (fail-safe: root is
85
+ * denied the data plane, so an unclassified capability is denied to root). */
86
+ export type CapabilityPlane = 'control' | 'data';
87
+ export declare const DEFAULT_CAPABILITY_PLANE: CapabilityPlane;
52
88
  /**
53
89
  * An action a module exposes, bound to a stable permission identity (§5.2) and
54
90
  * classified by its access tier (§6). Absence of a classification ⇒ Gated/Deny
@@ -64,6 +100,8 @@ export interface ActionDescriptor {
64
100
  * unclassified action as Gated (never silently open).
65
101
  */
66
102
  readonly tier?: AccessTier;
103
+ /** Control vs data plane (§0/§2). Omit → `data` (denied to root by construction). */
104
+ readonly plane?: CapabilityPlane;
67
105
  /** Read-only lookups this action requires to function (§5.3). */
68
106
  readonly supportingDependencies?: readonly SupportingDependency[];
69
107
  }
@@ -85,6 +123,9 @@ export interface ModuleMetadata {
85
123
  * re-implementing the `?? 'gated'` default, so the default can never drift.
86
124
  */
87
125
  export declare function resolveTier(action: ActionDescriptor): AccessTier;
126
+ /** Resolve an action's plane, defaulting to `data` (fail-safe). Single source —
127
+ * never re-derive elsewhere. */
128
+ export declare function resolvePlane(action: ActionDescriptor): CapabilityPlane;
88
129
  /**
89
130
  * Derive an action's stable permission identity (ADR-0010) within its owning
90
131
  * module: `moduleKey:typeKey:actionKey`. PURE — wraps {@link derivePermissionKey}
@@ -112,6 +153,8 @@ export interface RegisteredAction {
112
153
  readonly permissionKey: PermissionKey;
113
154
  /** Resolved baseline tier (never undefined — `gated` when unclassified). */
114
155
  readonly tier: AccessTier;
156
+ /** Resolved plane (never undefined — `data` when unclassified). */
157
+ readonly plane: CapabilityPlane;
115
158
  }
116
159
  /**
117
160
  * Module Registry seam — the Core's intake for module metadata, both at
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/metadata/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,EAGL,KAAK,UAAU,EACf,KAAK,aAAa,EACnB,MAAM,2BAA2B,CAAC;AAGnC,cAAc,mBAAmB,CAAC;AAKlC,cAAc,eAAe,CAAC;AAK9B,cAAc,mBAAmB,CAAC;AAElC,8EAA8E;AAC9E,MAAM,WAAW,eAAe;IAC9B,iEAAiE;IACjE,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,KAAK,EAAE,MAAM,CA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registry.js';
25
25
  // functions that derive the read-only lookups a permission implies from an
26
26
  // object type's reference fields, honoring the neverAutoGrant escape hatch.
27
27
  export * from './dependencies.js';
28
+ export const DEFAULT_CAPABILITY_PLANE = 'data';
28
29
  /**
29
30
  * Resolve an action's baseline access tier (§6, ADR-0004): the action's own
30
31
  * `tier`, or `gated` when omitted — the fail-closed default. PURE. This is the
@@ -35,6 +36,11 @@ export * from './dependencies.js';
35
36
  export function resolveTier(action) {
36
37
  return action.tier ?? DEFAULT_ACCESS_TIER;
37
38
  }
39
+ /** Resolve an action's plane, defaulting to `data` (fail-safe). Single source —
40
+ * never re-derive elsewhere. */
41
+ export function resolvePlane(action) {
42
+ return action.plane ?? DEFAULT_CAPABILITY_PLANE;
43
+ }
38
44
  /**
39
45
  * Derive an action's stable permission identity (ADR-0010) within its owning
40
46
  * module: `moduleKey:typeKey:actionKey`. PURE — wraps {@link derivePermissionKey}
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/metadata/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,EACL,mBAAmB,EACnB,mBAAmB,GAGpB,MAAM,2BAA2B,CAAC;AAEnC,iFAAiF;AACjF,cAAc,mBAAmB,CAAC;AAElC,4EAA4E;AAC5E,+EAA+E;AAC/E,oCAAoC;AACpC,cAAc,eAAe,CAAC;AAE9B,gFAAgF;AAChF,2EAA2E;AAC3E,4EAA4E;AAC5E,cAAc,mBAAmB,CAAC;AAkElC;;;;;;GAMG;AACH,MAAM,UAAU,WAAW,CAAC,MAAwB;IAClD,OAAO,MAAM,CAAC,IAAI,IAAI,mBAAmB,CAAC;AAC5C,CAAC;AAED;;;;;;;;;GASG;AACH,MAAM,UAAU,0BAA0B,CACxC,SAAiB,EACjB,MAAwB;IAExB,OAAO,mBAAmB,CAAC,SAAS,EAAE,MAAM,CAAC,OAAO,EAAE,MAAM,CAAC,SAAS,CAAC,CAAC;AAC1E,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/metadata/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,EACL,mBAAmB,EACnB,mBAAmB,GAGpB,MAAM,2BAA2B,CAAC;AAEnC,iFAAiF;AACjF,cAAc,mBAAmB,CAAC;AAElC,4EAA4E;AAC5E,+EAA+E;AAC/E,oCAAoC;AACpC,cAAc,eAAe,CAAC;AAE9B,gFAAgF;AAChF,2EAA2E;AAC3E,4EAA4E;AAC5E,cAAc,mBAAmB,CAAC;AAyElC,MAAM,CAAC,MAAM,wBAAwB,GAAoB,MAAM,CAAC;AAkChE;;;;;;GAMG;AACH,MAAM,UAAU,WAAW,CAAC,MAAwB;IAClD,OAAO,MAAM,CAAC,IAAI,IAAI,mBAAmB,CAAC;AAC5C,CAAC;AAED;iCACiC;AACjC,MAAM,UAAU,YAAY,CAAC,MAAwB;IACnD,OAAO,MAAM,CAAC,KAAK,IAAI,wBAAwB,CAAC;AAClD,CAAC;AAED;;;;;;;;;GASG;AACH,MAAM,UAAU,0BAA0B,CACxC,SAAiB,EACjB,MAAwB;IAExB,OAAO,mBAAmB,CAAC,SAAS,EAAE,MAAM,CAAC,OAAO,EAAE,MAAM,CAAC,SAAS,CAAC,CAAC;AAC1E,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"registry.d.ts","sourceRoot":"","sources":["../../src/metadata/registry.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAGH,OAAO,EAKL,KAAK,cAAc,EAGpB,MAAM,YAAY,CAAC;AAqOpB;;;GAGG;AACH,wBAAgB,oBAAoB,IAAI,cAAc,CAErD"}
1
+ {"version":3,"file":"registry.d.ts","sourceRoot":"","sources":["../../src/metadata/registry.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAGH,OAAO,EAML,KAAK,cAAc,EAGpB,MAAM,YAAY,CAAC;AAsOpB;;;GAGG;AACH,wBAAgB,oBAAoB,IAAI,cAAc,CAErD"}