@astram/guard 0.16.0 → 0.17.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 (29) hide show
  1. package/dist/authentication/argon2id-password-hasher.d.ts +3 -0
  2. package/dist/authentication/argon2id-password-hasher.d.ts.map +1 -1
  3. package/dist/authentication/argon2id-password-hasher.js +21 -0
  4. package/dist/authentication/credential-provisioner.d.ts +30 -0
  5. package/dist/authentication/credential-provisioner.d.ts.map +1 -0
  6. package/dist/authentication/credential-provisioner.js +16 -0
  7. package/dist/authentication/mariadb-credential-provisioner.d.ts +26 -0
  8. package/dist/authentication/mariadb-credential-provisioner.d.ts.map +1 -0
  9. package/dist/authentication/mariadb-credential-provisioner.js +72 -0
  10. package/dist/authz/operation-marker-check.d.ts +14 -0
  11. package/dist/authz/operation-marker-check.d.ts.map +1 -0
  12. package/dist/authz/operation-marker-check.js +25 -0
  13. package/dist/authz/wire-record-authorization.d.ts.map +1 -1
  14. package/dist/authz/wire-record-authorization.js +3 -2
  15. package/dist/config/reserved-principal-ids.d.ts +14 -0
  16. package/dist/config/reserved-principal-ids.d.ts.map +1 -0
  17. package/dist/config/reserved-principal-ids.js +24 -0
  18. package/dist/config/root-ids-from-env.d.ts +2 -0
  19. package/dist/config/root-ids-from-env.d.ts.map +1 -0
  20. package/dist/config/root-ids-from-env.js +41 -0
  21. package/dist/index.d.ts +5 -1
  22. package/dist/index.d.ts.map +1 -1
  23. package/dist/index.js +16 -4
  24. package/dist/internal.d.ts +1 -0
  25. package/dist/internal.d.ts.map +1 -1
  26. package/dist/internal.js +3 -1
  27. package/dist/module/shield.module.d.ts.map +1 -1
  28. package/dist/module/shield.module.js +4 -0
  29. package/package.json +3 -3
@@ -29,6 +29,9 @@ export interface Argon2idParams {
29
29
  readonly timeCost?: number;
30
30
  readonly parallelism?: number;
31
31
  }
32
+ /** `!locked:` + a real argon2id hash of 32 random bytes that are never kept. */
33
+ export declare function lockedPasswordHash(): Promise<string>;
34
+ export declare function isLockedHash(hash: string): boolean;
32
35
  /** The DI token consumers/ShieldModule bind the concrete hasher under. */
33
36
  export declare const SHIELD_PASSWORD_HASHER: unique symbol;
34
37
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"argon2id-password-hasher.d.ts","sourceRoot":"","sources":["../../src/authentication/argon2id-password-hasher.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAGH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAEnD;;;;;;;;;GASG;AACH,MAAM,WAAW,cAAc;IAC7B,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,CAAC;CAC/B;AAQD,0EAA0E;AAC1E,eAAO,MAAM,sBAAsB,eAAmC,CAAC;AAEvE;;;;GAIG;AACH,qBAAa,sBAAuB,YAAW,cAAc;IAC3D,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAuC;gBAEnD,MAAM,GAAE,cAAmB;IASvC,8EAA8E;IACxE,IAAI,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;IAK9C;;;;OAIG;IACG,MAAM,CAAC,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;CAQhE;AAED;;;;;GAKG;AACH,wBAAgB,sBAAsB,CAAC,MAAM,GAAE,cAAmB,GAAG;IACnE,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,sBAAsB,CAAC;CAClC,CAKA"}
1
+ {"version":3,"file":"argon2id-password-hasher.d.ts","sourceRoot":"","sources":["../../src/authentication/argon2id-password-hasher.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAIH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAEnD;;;;;;;;;GASG;AACH,MAAM,WAAW,cAAc;IAC7B,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,CAAC;CAC/B;AAWD,gFAAgF;AAChF,wBAAsB,kBAAkB,IAAI,OAAO,CAAC,MAAM,CAAC,CAM1D;AAED,wBAAgB,YAAY,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAElD;AAED,0EAA0E;AAC1E,eAAO,MAAM,sBAAsB,eAAmC,CAAC;AAEvE;;;;GAIG;AACH,qBAAa,sBAAuB,YAAW,cAAc;IAC3D,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAuC;gBAEnD,MAAM,GAAE,cAAmB;IASvC,8EAA8E;IACxE,IAAI,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;IAK9C;;;;OAIG;IACG,MAAM,CAAC,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;CAahE;AAED;;;;;GAKG;AACH,wBAAgB,sBAAsB,CAAC,MAAM,GAAE,cAAmB,GAAG;IACnE,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,sBAAsB,CAAC;CAClC,CAKA"}
@@ -49,13 +49,29 @@ var __importStar = (this && this.__importStar) || (function () {
49
49
  })();
50
50
  Object.defineProperty(exports, "__esModule", { value: true });
51
51
  exports.Argon2idPasswordHasher = exports.SHIELD_PASSWORD_HASHER = void 0;
52
+ exports.lockedPasswordHash = lockedPasswordHash;
53
+ exports.isLockedHash = isLockedHash;
52
54
  exports.argon2idHasherProvider = argon2idHasherProvider;
55
+ const node_crypto_1 = require("node:crypto");
53
56
  const argon2 = __importStar(require("argon2"));
54
57
  const DEFAULT_PARAMS = {
55
58
  memoryCost: 19_456,
56
59
  timeCost: 2,
57
60
  parallelism: 1,
58
61
  };
62
+ /** Prefix marking a credential nobody can authenticate against (set later via reset). */
63
+ const LOCKED_PREFIX = '!locked:';
64
+ /** `!locked:` + a real argon2id hash of 32 random bytes that are never kept. */
65
+ async function lockedPasswordHash() {
66
+ const hash = await argon2.hash((0, node_crypto_1.randomBytes)(32), {
67
+ type: argon2.argon2id,
68
+ ...DEFAULT_PARAMS,
69
+ });
70
+ return LOCKED_PREFIX + hash;
71
+ }
72
+ function isLockedHash(hash) {
73
+ return hash.startsWith(LOCKED_PREFIX);
74
+ }
59
75
  /** The DI token consumers/ShieldModule bind the concrete hasher under. */
60
76
  exports.SHIELD_PASSWORD_HASHER = Symbol('SHIELD_PASSWORD_HASHER');
61
77
  /**
@@ -85,6 +101,11 @@ class Argon2idPasswordHasher {
85
101
  */
86
102
  async verify(hash, plaintext) {
87
103
  try {
104
+ if (isLockedHash(hash)) {
105
+ // Real verify (no timing shortcut) on the remainder, then false regardless of the outcome.
106
+ await argon2.verify(hash.slice(LOCKED_PREFIX.length), plaintext);
107
+ return false;
108
+ }
88
109
  return await argon2.verify(hash, plaintext);
89
110
  }
90
111
  catch {
@@ -0,0 +1,30 @@
1
+ /**
2
+ * CredentialProvisioner — the INSERT-ONLY port that creates a login credential for a new principal
3
+ * (org bootstrap). It never updates or replaces an existing credential: a principal that already has
4
+ * one is refused with {@link CredentialExistsError}, so provisioning can never reset someone's password.
5
+ */
6
+ /** Caller-supplied SQL runner (a transaction connection's `query`); absent ⇒ the pool. */
7
+ export type CredentialQuery = (sql: string, params?: unknown[]) => Promise<unknown>;
8
+ export interface CredentialProvisionInput {
9
+ readonly principalId: string;
10
+ /** Login key (`ic_identity_hint`, the canonical email). */
11
+ readonly hint: string;
12
+ readonly tenantId: string;
13
+ }
14
+ export interface PasswordCredentialProvisionInput extends CredentialProvisionInput {
15
+ readonly password: string;
16
+ }
17
+ /** `none` = no credential row; `locked` = unusable placeholder hash; `usable` = a real password hash. */
18
+ export type CredentialState = 'none' | 'locked' | 'usable';
19
+ export interface CredentialProvisioner {
20
+ /** Insert a credential no password verifies against (set later via reset). */
21
+ provisionLocked(input: CredentialProvisionInput, query?: CredentialQuery): Promise<void>;
22
+ /** Insert an Argon2id credential for `password` (≥ 8 chars). */
23
+ provisionPassword(input: PasswordCredentialProvisionInput, query?: CredentialQuery): Promise<void>;
24
+ stateOf(principalId: string, query?: CredentialQuery): Promise<CredentialState>;
25
+ }
26
+ /** The principal or login hint already has a credential. Fixed message: no hint, no driver text. */
27
+ export declare class CredentialExistsError extends Error {
28
+ constructor();
29
+ }
30
+ //# sourceMappingURL=credential-provisioner.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"credential-provisioner.d.ts","sourceRoot":"","sources":["../../src/authentication/credential-provisioner.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,0FAA0F;AAC1F,MAAM,MAAM,eAAe,GAAG,CAAC,GAAG,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,OAAO,EAAE,KAAK,OAAO,CAAC,OAAO,CAAC,CAAC;AAEpF,MAAM,WAAW,wBAAwB;IACvC,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B,2DAA2D;IAC3D,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;CAC3B;AAED,MAAM,WAAW,gCAAiC,SAAQ,wBAAwB;IAChF,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;CAC3B;AAED,yGAAyG;AACzG,MAAM,MAAM,eAAe,GAAG,MAAM,GAAG,QAAQ,GAAG,QAAQ,CAAC;AAE3D,MAAM,WAAW,qBAAqB;IACpC,8EAA8E;IAC9E,eAAe,CAAC,KAAK,EAAE,wBAAwB,EAAE,KAAK,CAAC,EAAE,eAAe,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IACzF,gEAAgE;IAChE,iBAAiB,CACf,KAAK,EAAE,gCAAgC,EACvC,KAAK,CAAC,EAAE,eAAe,GACtB,OAAO,CAAC,IAAI,CAAC,CAAC;IACjB,OAAO,CAAC,WAAW,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,eAAe,GAAG,OAAO,CAAC,eAAe,CAAC,CAAC;CACjF;AAED,oGAAoG;AACpG,qBAAa,qBAAsB,SAAQ,KAAK;;CAK/C"}
@@ -0,0 +1,16 @@
1
+ "use strict";
2
+ /**
3
+ * CredentialProvisioner — the INSERT-ONLY port that creates a login credential for a new principal
4
+ * (org bootstrap). It never updates or replaces an existing credential: a principal that already has
5
+ * one is refused with {@link CredentialExistsError}, so provisioning can never reset someone's password.
6
+ */
7
+ Object.defineProperty(exports, "__esModule", { value: true });
8
+ exports.CredentialExistsError = void 0;
9
+ /** The principal or login hint already has a credential. Fixed message: no hint, no driver text. */
10
+ class CredentialExistsError extends Error {
11
+ constructor() {
12
+ super('A credential already exists for this principal or login');
13
+ this.name = 'CredentialExistsError';
14
+ }
15
+ }
16
+ exports.CredentialExistsError = CredentialExistsError;
@@ -0,0 +1,26 @@
1
+ /**
2
+ * MariaDbCredentialProvisioner — the framework CredentialProvisioner over `identity_credential`.
3
+ * INSERT only (never UPDATE/upsert): an existing principal, or a duplicate login hint (PK), is a
4
+ * {@link CredentialExistsError}. Stores only an Argon2id hash (or the locked placeholder); never logs it.
5
+ * Pass `query` to run inside the caller's transaction connection.
6
+ */
7
+ import type { Pool } from 'mariadb';
8
+ import { type CredentialProvisioner, type CredentialProvisionInput, type CredentialQuery, type CredentialState, type PasswordCredentialProvisionInput } from './credential-provisioner.js';
9
+ import { type FrameworkSchemaNames } from '../config/framework-schema-names.js';
10
+ export declare class MariaDbCredentialProvisioner implements CredentialProvisioner {
11
+ private readonly pool;
12
+ private readonly now;
13
+ /** `<identity>`.`identity_credential`, resolved at construction. */
14
+ private readonly table;
15
+ private readonly hasher;
16
+ constructor(pool: Pool, now?: () => number,
17
+ /** Framework database names; absent ⇒ resolved from `SHIELD_DB_NAMESPACE` here, once. */
18
+ schemas?: FrameworkSchemaNames);
19
+ provisionLocked(input: CredentialProvisionInput, query?: CredentialQuery): Promise<void>;
20
+ provisionPassword(input: PasswordCredentialProvisionInput, query?: CredentialQuery): Promise<void>;
21
+ stateOf(principalId: string, query?: CredentialQuery): Promise<CredentialState>;
22
+ private validate;
23
+ private run;
24
+ private insert;
25
+ }
26
+ //# sourceMappingURL=mariadb-credential-provisioner.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mariadb-credential-provisioner.d.ts","sourceRoot":"","sources":["../../src/authentication/mariadb-credential-provisioner.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,SAAS,CAAC;AACpC,OAAO,EAEL,KAAK,qBAAqB,EAC1B,KAAK,wBAAwB,EAC7B,KAAK,eAAe,EACpB,KAAK,eAAe,EACpB,KAAK,gCAAgC,EACtC,MAAM,6BAA6B,CAAC;AAMrC,OAAO,EAGL,KAAK,oBAAoB,EAC1B,MAAM,qCAAqC,CAAC;AAW7C,qBAAa,4BAA6B,YAAW,qBAAqB;IAMtE,OAAO,CAAC,QAAQ,CAAC,IAAI;IACrB,OAAO,CAAC,QAAQ,CAAC,GAAG;IANtB,oEAAoE;IACpE,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAS;IAC/B,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAgC;gBAGpC,IAAI,EAAE,IAAI,EACV,GAAG,GAAE,MAAM,MAAiB;IAC7C,yFAAyF;IACzF,OAAO,CAAC,EAAE,oBAAoB;IAQ1B,eAAe,CAAC,KAAK,EAAE,wBAAwB,EAAE,KAAK,CAAC,EAAE,eAAe,GAAG,OAAO,CAAC,IAAI,CAAC;IAKxF,iBAAiB,CACrB,KAAK,EAAE,gCAAgC,EACvC,KAAK,CAAC,EAAE,eAAe,GACtB,OAAO,CAAC,IAAI,CAAC;IAQV,OAAO,CAAC,WAAW,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,eAAe,GAAG,OAAO,CAAC,eAAe,CAAC;IAUrF,OAAO,CAAC,QAAQ;IAMhB,OAAO,CAAC,GAAG;YAIG,MAAM;CA0BrB"}
@@ -0,0 +1,72 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.MariaDbCredentialProvisioner = void 0;
4
+ const credential_provisioner_js_1 = require("./credential-provisioner.js");
5
+ const argon2id_password_hasher_js_1 = require("./argon2id-password-hasher.js");
6
+ const framework_schema_names_js_1 = require("../config/framework-schema-names.js");
7
+ const MIN_PASSWORD_LENGTH = 8;
8
+ const ER_DUP_ENTRY = 1062;
9
+ function requireText(value, name) {
10
+ if (typeof value !== 'string' || value.trim() === '') {
11
+ throw new TypeError(`${name} must be a non-empty string`);
12
+ }
13
+ }
14
+ class MariaDbCredentialProvisioner {
15
+ pool;
16
+ now;
17
+ /** `<identity>`.`identity_credential`, resolved at construction. */
18
+ table;
19
+ hasher = new argon2id_password_hasher_js_1.Argon2idPasswordHasher();
20
+ constructor(pool, now = Date.now,
21
+ /** Framework database names; absent ⇒ resolved from `SHIELD_DB_NAMESPACE` here, once. */
22
+ schemas) {
23
+ this.pool = pool;
24
+ this.now = now;
25
+ this.table = (0, framework_schema_names_js_1.qualifiedTableName)((0, framework_schema_names_js_1.schemaNamesAtConstruction)(schemas).identity, 'identity_credential');
26
+ }
27
+ async provisionLocked(input, query) {
28
+ this.validate(input);
29
+ await this.insert(input, await (0, argon2id_password_hasher_js_1.lockedPasswordHash)(), query);
30
+ }
31
+ async provisionPassword(input, query) {
32
+ this.validate(input);
33
+ if (typeof input.password !== 'string' || input.password.length < MIN_PASSWORD_LENGTH) {
34
+ throw new Error(`password must be at least ${MIN_PASSWORD_LENGTH} characters`);
35
+ }
36
+ await this.insert(input, await this.hasher.hash(input.password), query);
37
+ }
38
+ async stateOf(principalId, query) {
39
+ const rows = (await this.run(query)(`SELECT ic_password_hash FROM ${this.table} WHERE ic_principal_id = ? LIMIT 1`, [principalId]));
40
+ const row = rows[0];
41
+ if (!row)
42
+ return 'none';
43
+ return (0, argon2id_password_hasher_js_1.isLockedHash)(row.ic_password_hash) ? 'locked' : 'usable';
44
+ }
45
+ validate(input) {
46
+ requireText(input.principalId, 'principalId');
47
+ requireText(input.hint, 'hint');
48
+ requireText(input.tenantId, 'tenantId');
49
+ }
50
+ run(query) {
51
+ return query ?? ((sql, params) => this.pool.query(sql, params));
52
+ }
53
+ async insert(input, hash, query) {
54
+ const run = this.run(query);
55
+ const existing = (await run(`SELECT ic_identity_hint FROM ${this.table} WHERE ic_principal_id = ? LIMIT 1 FOR UPDATE`, [input.principalId]));
56
+ if (existing.length > 0)
57
+ throw new credential_provisioner_js_1.CredentialExistsError();
58
+ const nowMs = this.now();
59
+ try {
60
+ await run(`INSERT INTO ${this.table}
61
+ (ic_identity_hint, ic_password_hash, ic_principal_id, ic_tenant_id, ic_roles, ic_created_at_ms, ic_updated_at_ms)
62
+ VALUES (?, ?, ?, ?, ?, ?, ?)`, [input.hint, hash, input.principalId, input.tenantId, '[]', nowMs, nowMs]);
63
+ }
64
+ catch (err) {
65
+ if (err?.errno === ER_DUP_ENTRY) {
66
+ throw new credential_provisioner_js_1.CredentialExistsError();
67
+ }
68
+ throw err;
69
+ }
70
+ }
71
+ }
72
+ exports.MariaDbCredentialProvisioner = MariaDbCredentialProvisioner;
@@ -0,0 +1,14 @@
1
+ /**
2
+ * `withOperationMarkerCheck` — the guard-side seal on core gate 7's delegation marker (G-009 R1-2).
3
+ *
4
+ * Core's `decide()` reads `context.attributes['shield.delegation']` and delegates whatever the
5
+ * principal is. The marker therefore must come only from a principal the engine bound to that
6
+ * exact operation step (`operationOf`, an unforgeable WeakMap binding; the engine's
7
+ * `withDelegation` sets the matching marker). Here, every decision entry the authority exposes
8
+ * (`decide`) passes the attribute through ONLY when `operationOf(principal)` exists and its
9
+ * `operationKey` and `stepKey` equal the marker's; in every other case it is removed before the
10
+ * inner `decide()`, so the baseline decision stands (Shield #1, #9).
11
+ */
12
+ import type { DecisionAuthority } from '@astram/core';
13
+ export declare function withOperationMarkerCheck(inner: DecisionAuthority): DecisionAuthority;
14
+ //# sourceMappingURL=operation-marker-check.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"operation-marker-check.d.ts","sourceRoot":"","sources":["../../src/authz/operation-marker-check.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAC;AAKtD,wBAAgB,wBAAwB,CAAC,KAAK,EAAE,iBAAiB,GAAG,iBAAiB,CAoBpF"}
@@ -0,0 +1,25 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.withOperationMarkerCheck = withOperationMarkerCheck;
4
+ const engine_1 = require("@astram/engine");
5
+ const MARKER = 'shield.delegation';
6
+ function withOperationMarkerCheck(inner) {
7
+ return {
8
+ decide: (principal, action, resource, context) => {
9
+ const attributes = context.attributes;
10
+ if (attributes === undefined || !(MARKER in attributes)) {
11
+ return inner.decide(principal, action, resource, context);
12
+ }
13
+ const raw = attributes[MARKER];
14
+ const binding = (0, engine_1.operationOf)(principal);
15
+ const { operationKey, stepKey } = typeof raw === 'object' && raw !== null ? raw : {};
16
+ const genuine = binding !== undefined &&
17
+ binding.operationKey === operationKey &&
18
+ binding.stepKey === stepKey;
19
+ if (genuine)
20
+ return inner.decide(principal, action, resource, context);
21
+ const { [MARKER]: _forged, ...rest } = attributes;
22
+ return inner.decide(principal, action, resource, { ...context, attributes: rest });
23
+ },
24
+ };
25
+ }
@@ -1 +1 @@
1
- {"version":3,"file":"wire-record-authorization.d.ts","sourceRoot":"","sources":["../../src/authz/wire-record-authorization.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,OAAO,KAAK,EACV,iBAAiB,EACjB,cAAc,EAEd,mBAAmB,EACnB,SAAS,EAET,kBAAkB,EACnB,MAAM,cAAc,CAAC;AAMtB,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,+BAA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AC7B,mBAAmB,CA2BrB;AAED,6EAA6E;AAC7E,MAAM,WAAW,+BAA+B;IAC9C;;;;OAIG;IACH,QAAQ,CAAC,YAAY,CAAC,EAAE,uBAAuB,CAAC;CACjD;AAED,wBAAgB,wBAAwB,CACtC,MAAM,EAAE,yBAAyB,EACjC,OAAO,GAAE,+BAAoC,GAC5C,iBAAiB,CA8BnB;AAED;;;;;;;;;GASG;AACH,MAAM,MAAM,WAAW,GAAG,CACxB,GAAG,EAAE,UAAU,EACf,KAAK,EAAE,SAAS,EAChB,MAAM,EAAE,MAAM,KACX,OAAO,CAAC;IAAE,GAAG,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,OAAO,EAAE,CAAA;CAAE,CAAC,CAAC;AAEjD;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,yBAAyB,GAAG,WAAW,CAyE/E"}
@@ -8,6 +8,7 @@ const mariadb_record_rule_adapter_js_1 = require("./mariadb-record-rule-adapter.
8
8
  const mariadb_record_share_adapter_js_1 = require("./mariadb-record-share-adapter.js");
9
9
  const mariadb_cross_tenant_grant_adapter_js_1 = require("./mariadb-cross-tenant-grant-adapter.js");
10
10
  const mariadb_list_scope_adapter_js_1 = require("./mariadb-list-scope-adapter.js");
11
+ const operation_marker_check_js_1 = require("./operation-marker-check.js");
11
12
  const list_scope_sql_js_1 = require("./list-scope-sql.js");
12
13
  const session_facts_als_js_1 = require("../request-auth/session-facts-als.js");
13
14
  const framework_schema_names_js_1 = require("../config/framework-schema-names.js");
@@ -71,7 +72,7 @@ function buildRecordAuthorization(inputs, options = {}) {
71
72
  ? withRedisPermissionVersion(inputs.permissionFacts, options.versionCache)
72
73
  : inputs.permissionFacts;
73
74
  const schema = authzSchemaOf(inputs);
74
- return (0, core_1.createWiredDecisionAuthority)({
75
+ return (0, operation_marker_check_js_1.withOperationMarkerCheck)((0, core_1.createWiredDecisionAuthority)({
75
76
  registry: inputs.registry,
76
77
  // The app-owned port, wrapped so a gate-5 reload inside an enforcement request notifies the
77
78
  // guard (security hardening Phase 1C: a permission-version move re-derives the session's
@@ -92,7 +93,7 @@ function buildRecordAuthorization(inputs, options = {}) {
92
93
  // Delegation / trusted-operation authority over the DECLARED manifest (no DB).
93
94
  // Empty ⇒ pass-through. The app supplies the entries; the framework owns the adapter.
94
95
  operationAuthority: new manifest_operation_authority_adapter_js_1.ManifestOperationAuthorityAdapter(inputs.operationManifest ?? []),
95
- });
96
+ }));
96
97
  }
97
98
  /**
98
99
  * Construct the engine-facing {@link ListScopeFn} — the LIST-form sibling to
@@ -0,0 +1,14 @@
1
+ /**
2
+ * Principal ids the framework reserves for its own trusted operations (Shield #9).
3
+ *
4
+ * The org-bootstrap operation principal carries NO credential; its authority exists only through
5
+ * the runner's operation binding. It must never be a platform root, so `rootIdsFromEnv` refuses it.
6
+ */
7
+ export declare const ORG_BOOTSTRAP_PRINCIPAL_ID = "5b0d7e1a-0c4f-4a6e-9d3b-b007572a9001";
8
+ /**
9
+ * Refuse a root allowlist that names a reserved principal, however the app built it (`rootIdsFromEnv`,
10
+ * its own variable, or a literal). Called by `ShieldModule.forRoot` and `IdentityFeatureModule.forRoot`.
11
+ * Compared case-insensitively; the message never names the value.
12
+ */
13
+ export declare function assertNoReservedRootId(rootIds: readonly string[] | null | undefined): void;
14
+ //# sourceMappingURL=reserved-principal-ids.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"reserved-principal-ids.d.ts","sourceRoot":"","sources":["../../src/config/reserved-principal-ids.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,eAAO,MAAM,0BAA0B,yCAAyC,CAAC;AAEjF;;;;GAIG;AACH,wBAAgB,sBAAsB,CAAC,OAAO,EAAE,SAAS,MAAM,EAAE,GAAG,IAAI,GAAG,SAAS,GAAG,IAAI,CAM1F"}
@@ -0,0 +1,24 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ORG_BOOTSTRAP_PRINCIPAL_ID = void 0;
4
+ exports.assertNoReservedRootId = assertNoReservedRootId;
5
+ /**
6
+ * Principal ids the framework reserves for its own trusted operations (Shield #9).
7
+ *
8
+ * The org-bootstrap operation principal carries NO credential; its authority exists only through
9
+ * the runner's operation binding. It must never be a platform root, so `rootIdsFromEnv` refuses it.
10
+ */
11
+ exports.ORG_BOOTSTRAP_PRINCIPAL_ID = '5b0d7e1a-0c4f-4a6e-9d3b-b007572a9001';
12
+ /**
13
+ * Refuse a root allowlist that names a reserved principal, however the app built it (`rootIdsFromEnv`,
14
+ * its own variable, or a literal). Called by `ShieldModule.forRoot` and `IdentityFeatureModule.forRoot`.
15
+ * Compared case-insensitively; the message never names the value.
16
+ */
17
+ function assertNoReservedRootId(rootIds) {
18
+ if (!rootIds)
19
+ return;
20
+ const reserved = exports.ORG_BOOTSTRAP_PRINCIPAL_ID.toLowerCase();
21
+ if (rootIds.some((id) => typeof id === 'string' && id.trim().toLowerCase() === reserved)) {
22
+ throw new Error('rootIds contains a reserved principal id; a reserved id is never a root.');
23
+ }
24
+ }
@@ -0,0 +1,2 @@
1
+ export declare function rootIdsFromEnv(env?: Readonly<Record<string, string | undefined>>): string[];
2
+ //# sourceMappingURL=root-ids-from-env.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"root-ids-from-env.d.ts","sourceRoot":"","sources":["../../src/config/root-ids-from-env.ts"],"names":[],"mappings":"AAcA,wBAAgB,cAAc,CAC5B,GAAG,GAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC,CAAe,GAC9D,MAAM,EAAE,CAyBV"}
@@ -0,0 +1,41 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.rootIdsFromEnv = rootIdsFromEnv;
4
+ /**
5
+ * G-009 R9: the platform-root ids from `SHIELD_ROOT_IDS` (comma-separated uuids), for both
6
+ * `ShieldModule.forRoot({ rootIds })` and `IdentityFeatureModule.forRoot({ rootIds })`.
7
+ *
8
+ * Fail closed: every entry must already be the lower-case canonical uuid (`canonicalUuid(v) === v`),
9
+ * so a root id is spelled exactly as the database stores it; an empty, malformed or duplicated entry
10
+ * throws instead of being skipped. Errors name the variable and the entry position, never a value.
11
+ * Unset or blank ⇒ no roots. Root is never inferred from `u_is_platform_superuser`.
12
+ */
13
+ const engine_1 = require("@astram/engine");
14
+ const reserved_principal_ids_js_1 = require("./reserved-principal-ids.js");
15
+ const VARIABLE = 'SHIELD_ROOT_IDS';
16
+ function rootIdsFromEnv(env = process.env) {
17
+ const raw = env[VARIABLE];
18
+ if (raw === undefined || raw.trim() === '')
19
+ return [];
20
+ const ids = [];
21
+ const seen = new Set();
22
+ raw.split(',').forEach((part, index) => {
23
+ const value = part.trim();
24
+ const position = index + 1;
25
+ if (value === '') {
26
+ throw new Error(`${VARIABLE}: entry ${position} is empty.`);
27
+ }
28
+ if ((0, engine_1.canonicalUuid)(value) !== value) {
29
+ throw new Error(`${VARIABLE}: entry ${position} is not a lower-case canonical uuid.`);
30
+ }
31
+ if (value === reserved_principal_ids_js_1.ORG_BOOTSTRAP_PRINCIPAL_ID) {
32
+ throw new Error(`${VARIABLE}: entry ${position} is a reserved principal id.`);
33
+ }
34
+ if (seen.has(value)) {
35
+ throw new Error(`${VARIABLE}: entry ${position} repeats an earlier entry.`);
36
+ }
37
+ seen.add(value);
38
+ ids.push(value);
39
+ });
40
+ return ids;
41
+ }
package/dist/index.d.ts CHANGED
@@ -32,7 +32,9 @@ export { MariaDbApiKeyStore } from './authentication/mariadb-api-key-store.js';
32
32
  export { SHIELD_SESSION_FACTS_ALS, NO_SESSION_FACTS, type SessionFactsStore, } from './request-auth/session-facts-als.js';
33
33
  export { GlobalEnforcementGuard } from './enforcement/global-enforcement.guard.js';
34
34
  export { stubDecisionAuthority, type Effect, type CoreDecisionAuthority, type CoreDecision, type Principal, } from './enforcement/core-seam.js';
35
- export { Argon2idPasswordHasher, argon2idHasherProvider, SHIELD_PASSWORD_HASHER, type Argon2idParams, } from './authentication/argon2id-password-hasher.js';
35
+ export { Argon2idPasswordHasher, argon2idHasherProvider, SHIELD_PASSWORD_HASHER, lockedPasswordHash, isLockedHash, type Argon2idParams, } from './authentication/argon2id-password-hasher.js';
36
+ export { CredentialExistsError, type CredentialProvisioner, type CredentialProvisionInput, type PasswordCredentialProvisionInput, type CredentialState, type CredentialQuery, } from './authentication/credential-provisioner.js';
37
+ export { resolveAuthLinkBaseUrls } from './auth/link-base-url.js';
36
38
  export { LocalKekCrypto } from './encryption/local-kek-crypto.js';
37
39
  export { EncryptedFileSecretsProvider } from './secrets/encrypted-file-secrets.js';
38
40
  export { resolveBootSecrets, createSecretsProviderFromEnv, assertNoUnresolvedSecretRefs, wasResolvedFromSecretRef, type ResolveBootSecretsOptions, } from './secrets/boot-secrets.js';
@@ -67,6 +69,8 @@ export { APP_CONFIG } from './config/config.module.js';
67
69
  export { FRAMEWORK_SCHEMAS } from './config/config.module.js';
68
70
  export type { FrameworkSchemaNames } from './config/framework-schema-names.js';
69
71
  export { frameworkSchemasOf, loadAppConfig, loadPoolBudget, evaluatePoolBudget, DEFAULT_POOL_BUDGET, SCHEMA_SVC_POOL_HARD_CAP, type AppConfig, type PoolBudgetConfig, type PoolBudgetEvaluation, type RuntimeAccountPools, loadDbConfig, loadRedisConfig, loadSessionLifetimes, loadRefreshHmacKey, assertRefreshHmacKey, DEFAULT_DB_CONFIG, DEFAULT_REDIS_URL, type DbConfig, type RedisConfig, type SessionLifetimeOverrides, loadLoginIpLimit, loadRefreshReplayWindowMs, DEFAULT_LOGIN_IP_LIMIT, isDevOrTestNodeEnv, type LoginIpLimitConfig, loadDbTlsConfig, type DbTlsConfig, } from './config/app-config.js';
72
+ export { rootIdsFromEnv } from './config/root-ids-from-env.js';
73
+ export { ORG_BOOTSTRAP_PRINCIPAL_ID, assertNoReservedRootId, } from './config/reserved-principal-ids.js';
70
74
  export { mariadbSslOption } from './auth/connections.js';
71
75
  export { SHIELD_REDIS, SHIELD_CREDENTIAL_RESOLVER, SHIELD_PROFILE_RESOLVER, SHIELD_AUTHENTICATOR, SHIELD_SESSION_AUTHORITY, SHIELD_CREDENTIAL_WRITER, SHIELD_RESET_TOKEN_STORE, SHIELD_EMAIL_CHANGE_TOKEN_STORE, SHIELD_EMAIL_SENDER, SHIELD_RECOVERY_CODE_STORE, SHIELD_PROFILE_WRITER, SHIELD_SESSION_SWEEPER, SHIELD_AUDIT_SINK, SHIELD_MFA_DEVICE_STORE, SHIELD_TOTP_VERIFIER_OVERRIDE, } from './auth/tokens.js';
72
76
  export { MariaDbCredentialResolver } from './authentication/mariadb-credential-resolver.js';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAIH,OAAO,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AASzD,OAAO,EAAE,2BAA2B,EAAE,MAAM,sCAAsC,CAAC;AACnF,OAAO,EACL,UAAU,EACV,gBAAgB,EAChB,0BAA0B,EAC1B,oBAAoB,EACpB,uBAAuB,EACvB,UAAU,EACV,SAAS,GACV,MAAM,gCAAgC,CAAC;AAGxC,OAAO,EACL,YAAY,EACZ,yBAAyB,EAGzB,2BAA2B,EAC3B,KAAK,mBAAmB,EACxB,KAAK,wBAAwB,EAI7B,KAAK,yBAAyB,GAC/B,MAAM,2BAA2B,CAAC;AAGnC,OAAO,EACL,MAAM,EACN,UAAU,EACV,uBAAuB,EACvB,yBAAyB,EACzB,uBAAuB,GACxB,MAAM,2CAA2C,CAAC;AACnD,YAAY,EAAE,cAAc,EAAE,MAAM,2CAA2C,CAAC;AAKhF,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,iBAAiB,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AAKpG,OAAO,EAAE,yBAAyB,EAAE,MAAM,+CAA+C,CAAC;AAC1F,OAAO,EAAE,iBAAiB,EAAE,sBAAsB,EA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,YAAY,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,kCAAkC,CAAC;AAClF,YAAY,EAAE,SAAS,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AAK5E,YAAY,EAAE,qBAAqB,EAAE,MAAM,yCAAyC,CAAC;AACrF,OAAO,EAAE,8BAA8B,EAAE,MAAM,kBAAkB,CAAC;AAMlE,YAAY,EAAE,oBAAoB,EAAE,MAAM,wCAAwC,CAAC;AACnF,OAAO,EAAE,6BAA6B,EAAE,MAAM,kBAAkB,CAAC;AAOjE,OAAO,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAC3D,OAAO,EACL,eAAe,EACf,oBAAoB,EACpB,KAAK,mBAAmB,GACzB,MAAM,6BAA6B,CAAC;AAGrC,OAAO,EACL,mBAAmB,EACnB,qBAAqB,EACrB,gBAAgB,EAChB,KAAK,SAAS,EACd,KAAK,eAAe,GACrB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EACL,kBAAkB,EAClB,kBAAkB,EAClB,0BAA0B,GAC3B,MAAM,kBAAkB,CAAC;AAK1B,OAAO,EACL,kBAAkB,EAClB,eAAe,EACf,qBAAqB,GACtB,MAAM,2BAA2B,CAAC;AAKnC,OAAO,EAAE,iBAAiB,EAAE,MAAM,8BAA8B,CAAC;AAEjE,OAAO,EAAE,sBAAsB,EAAE,MAAM,oCAAoC,CAAC;AAQ5E,OAAO,EACL,gBAAgB,EAChB,eAAe,EACf,eAAe,EACf,uBAAuB,EACvB,KAAK,SAAS,EACd,KAAK,UAAU,GAChB,MAAM,4BAA4B,CAAC"}
package/dist/index.js CHANGED
@@ -16,10 +16,10 @@
16
16
  * `@nestjs/core`, `reflect-metadata`, `rxjs` so the host owns one copy of each.
17
17
  */
18
18
  Object.defineProperty(exports, "__esModule", { value: true });
19
- exports.FileIntake = exports.ObjectStoreBootCheck = exports.NodeSha256Digest = exports.S3ObjectStore = exports.wasResolvedFromSecretRef = exports.assertNoUnresolvedSecretRefs = exports.createSecretsProviderFromEnv = exports.resolveBootSecrets = exports.EncryptedFileSecretsProvider = exports.LocalKekCrypto = exports.SHIELD_PASSWORD_HASHER = exports.argon2idHasherProvider = exports.Argon2idPasswordHasher = exports.stubDecisionAuthority = exports.GlobalEnforcementGuard = exports.NO_SESSION_FACTS = exports.SHIELD_SESSION_FACTS_ALS = exports.MariaDbApiKeyStore = exports.isApiKey = exports.extractBearerToken = exports.principalFromClaims = exports.resolveRequestAuth = exports.resolveRequestPrincipal = exports.SessionTokenBinder = exports.SHIELD_SERVICE_AUTHENTICATOR = exports.SHIELD_SESSION_TOKEN_BINDER = exports.CatalogGatabilityError = exports.CatalogReconciler = exports.OperationInventoryScanner = exports.uuidArrayField = exports.optionalUuidField = exports.uuidField = exports.UuidPipe = exports.normalizeClassification = exports.DEFAULT_CLASSIFIED_ACTION = exports.CLASSIFICATION_METADATA = exports.Classified = exports.Public = exports.SHIELD_RECORD_AUTHORIZATION = exports.SHIELD_DECISION_AUTHORITY = exports.ShieldModule = exports.actionsOf = exports.actionsFor = exports.SERVICE_ACCOUNT_ACTIONS = exports.RECORD_SHARE_ACTIONS = exports.CROSS_TENANT_GRANT_ACTIONS = exports.IDENTITY_ACTIONS = exports.MODULE_KEY = exports.buildIdentityModuleRegistry = exports.guardMigrationsDir = void 0;
20
- exports.withRedisPermissionVersion = exports.buildRecordAuthorization = exports.SHIELD_OPERATION_AUTHORITY_PORT = exports.ManifestOperationAuthorityAdapter = exports.GrantStoreUnavailableError = exports.InvalidGrantError = exports.GrantNotPermittedError = exports.SHIELD_CROSS_TENANT_GRANT_WRITER = exports.CrossTenantGrantWriter = exports.SHIELD_CROSS_TENANT_GRANT_PORT = exports.MariaDbCrossTenantGrantAdapter = exports.makeShareDeleteCascade = exports.ShareStoreUnavailableError = exports.ShareNotPermittedError = exports.SHIELD_RECORD_SHARE_WRITER = exports.RecordShareWriter = exports.SHIELD_RECORD_SHARE_PORT = exports.MariaDbRecordShareAdapter = exports.UnknownScopeFieldError = exports.translateListScope = exports.SHIELD_LIST_SCOPE_PORT = exports.MariaDbListScopeAdapter = exports.SHIELD_POLICY_STORE = exports.MariaDbPolicyStore = exports.SHIELD_RECORD_RULE_PORT = exports.MariaDbRecordPermissionRuleAdapter = exports.accessBindingTtlMs = exports.ROTATE_GRACE_MS = exports.SHIELD_SESSION_LIFETIMES = exports.HotRevokingSessionRecordStore = exports.SHIELD_CLOCK = exports.SHIELD_REFRESH_HASHER = exports.SHIELD_TOKEN_GENERATOR = exports.systemClockProvider = exports.refreshHasherProvider = exports.cryptoTokenGeneratorProvider = exports.SystemClock = exports.Sha256RefreshTokenHasher = exports.CryptoTokenGenerator = exports.RedisRecentRotationStore = exports.SHIELD_HOT_SESSION_STORE = exports.RedisHotSessionStore = exports.SHIELD_SESSION_RECORD_STORE = exports.MariaDbSessionRecordStore = exports.DEFAULT_OBJECT_STORAGE_MAX_BYTES = exports.loadObjectStorageConfig = exports.SHIELD_FILE_INGEST = exports.SHIELD_OBJECT_STORE = exports.FILE_INTAKE_DEFAULT_MAX_BYTES = exports.FILE_INTAKE_REQUEST_KEY = void 0;
21
- exports.SHIELD_SESSION_SWEEPER = exports.SHIELD_PROFILE_WRITER = exports.SHIELD_RECOVERY_CODE_STORE = exports.SHIELD_EMAIL_SENDER = exports.SHIELD_EMAIL_CHANGE_TOKEN_STORE = exports.SHIELD_RESET_TOKEN_STORE = exports.SHIELD_CREDENTIAL_WRITER = exports.SHIELD_SESSION_AUTHORITY = exports.SHIELD_AUTHENTICATOR = exports.SHIELD_PROFILE_RESOLVER = exports.SHIELD_CREDENTIAL_RESOLVER = exports.SHIELD_REDIS = exports.mariadbSslOption = exports.loadDbTlsConfig = exports.isDevOrTestNodeEnv = exports.DEFAULT_LOGIN_IP_LIMIT = exports.loadRefreshReplayWindowMs = exports.loadLoginIpLimit = exports.DEFAULT_REDIS_URL = exports.DEFAULT_DB_CONFIG = exports.assertRefreshHmacKey = exports.loadRefreshHmacKey = exports.loadSessionLifetimes = exports.loadRedisConfig = exports.loadDbConfig = exports.SCHEMA_SVC_POOL_HARD_CAP = exports.DEFAULT_POOL_BUDGET = exports.evaluatePoolBudget = exports.loadPoolBudget = exports.loadAppConfig = exports.frameworkSchemasOf = exports.FRAMEWORK_SCHEMAS = exports.APP_CONFIG = exports.resolveMigrationLedgerCheck = exports.resolveMigrationLedger = exports.frameworkMigrationIds = exports.assertFrameworkMigrationsApplied = exports.SHIELD_MIGRATION_LEDGER_REGISTRY = exports.MigrationLedgerRegistry = exports.FrameworkMigrationLedgerCheck = exports.frameworkDatabasesLogLine = exports.assertPoolBudget = exports.BootSequence = exports.buildListScopeFn = exports.MariaDbSessionRestrictionStore = exports.SHIELD_SESSION_RESTRICTIONS = exports.SHIELD_PERMISSION_VERSION_CACHE = exports.DEFAULT_PERMISSION_VERSION_TTL_MS = exports.PERMISSION_VERSION_KEY_PREFIX = exports.RedisPermissionVersionCache = void 0;
22
- exports.ScopeUnknownParentError = exports.ScopeDepthError = exports.ScopeCycleError = exports.buildClosureRows = exports.ConfirmEmailController = exports.AccountController = exports.generateRecoveryCodes = exports.buildOtpauthUri = exports.generateTotpSecret = exports.SHIELD_LOGIN_TOTP_VERIFIER = exports.SHIELD_MFA_STEP_UP = exports.SHIELD_MFA_LIMITER = exports.challengeMatches = exports.credentialFingerprint = exports.CredentialMfaStepUp = exports.RedisPendingMfaStore = exports.PendingMfaStore = exports.AuthController = exports.SHIELD_SCOPE_SUBTREE_RESOLVER = exports.SHIELD_SESSION_FACTS_PROJECTOR = exports.ProfileNameTakenError = exports.MariaDbEmailAddressChanger = exports.maskEmail = exports.isEmailShaped = exports.canonicalEmail = exports.hmacSha1 = exports.resolveTotpVerifier = exports.makeDefaultTotpVerifier = exports.AuthModule = exports.MariaDbCredentialResolver = exports.SHIELD_TOTP_VERIFIER_OVERRIDE = exports.SHIELD_MFA_DEVICE_STORE = exports.SHIELD_AUDIT_SINK = void 0;
19
+ exports.wasResolvedFromSecretRef = exports.assertNoUnresolvedSecretRefs = exports.createSecretsProviderFromEnv = exports.resolveBootSecrets = exports.EncryptedFileSecretsProvider = exports.LocalKekCrypto = exports.resolveAuthLinkBaseUrls = exports.CredentialExistsError = exports.isLockedHash = exports.lockedPasswordHash = exports.SHIELD_PASSWORD_HASHER = exports.argon2idHasherProvider = exports.Argon2idPasswordHasher = exports.stubDecisionAuthority = exports.GlobalEnforcementGuard = exports.NO_SESSION_FACTS = exports.SHIELD_SESSION_FACTS_ALS = exports.MariaDbApiKeyStore = exports.isApiKey = exports.extractBearerToken = exports.principalFromClaims = exports.resolveRequestAuth = exports.resolveRequestPrincipal = exports.SessionTokenBinder = exports.SHIELD_SERVICE_AUTHENTICATOR = exports.SHIELD_SESSION_TOKEN_BINDER = exports.CatalogGatabilityError = exports.CatalogReconciler = exports.OperationInventoryScanner = exports.uuidArrayField = exports.optionalUuidField = exports.uuidField = exports.UuidPipe = exports.normalizeClassification = exports.DEFAULT_CLASSIFIED_ACTION = exports.CLASSIFICATION_METADATA = exports.Classified = exports.Public = exports.SHIELD_RECORD_AUTHORIZATION = exports.SHIELD_DECISION_AUTHORITY = exports.ShieldModule = exports.actionsOf = exports.actionsFor = exports.SERVICE_ACCOUNT_ACTIONS = exports.RECORD_SHARE_ACTIONS = exports.CROSS_TENANT_GRANT_ACTIONS = exports.IDENTITY_ACTIONS = exports.MODULE_KEY = exports.buildIdentityModuleRegistry = exports.guardMigrationsDir = void 0;
20
+ exports.GrantStoreUnavailableError = exports.InvalidGrantError = exports.GrantNotPermittedError = exports.SHIELD_CROSS_TENANT_GRANT_WRITER = exports.CrossTenantGrantWriter = exports.SHIELD_CROSS_TENANT_GRANT_PORT = exports.MariaDbCrossTenantGrantAdapter = exports.makeShareDeleteCascade = exports.ShareStoreUnavailableError = exports.ShareNotPermittedError = exports.SHIELD_RECORD_SHARE_WRITER = exports.RecordShareWriter = exports.SHIELD_RECORD_SHARE_PORT = exports.MariaDbRecordShareAdapter = exports.UnknownScopeFieldError = exports.translateListScope = exports.SHIELD_LIST_SCOPE_PORT = exports.MariaDbListScopeAdapter = exports.SHIELD_POLICY_STORE = exports.MariaDbPolicyStore = exports.SHIELD_RECORD_RULE_PORT = exports.MariaDbRecordPermissionRuleAdapter = exports.accessBindingTtlMs = exports.ROTATE_GRACE_MS = exports.SHIELD_SESSION_LIFETIMES = exports.HotRevokingSessionRecordStore = exports.SHIELD_CLOCK = exports.SHIELD_REFRESH_HASHER = exports.SHIELD_TOKEN_GENERATOR = exports.systemClockProvider = exports.refreshHasherProvider = exports.cryptoTokenGeneratorProvider = exports.SystemClock = exports.Sha256RefreshTokenHasher = exports.CryptoTokenGenerator = exports.RedisRecentRotationStore = exports.SHIELD_HOT_SESSION_STORE = exports.RedisHotSessionStore = exports.SHIELD_SESSION_RECORD_STORE = exports.MariaDbSessionRecordStore = exports.DEFAULT_OBJECT_STORAGE_MAX_BYTES = exports.loadObjectStorageConfig = exports.SHIELD_FILE_INGEST = exports.SHIELD_OBJECT_STORE = exports.FILE_INTAKE_DEFAULT_MAX_BYTES = exports.FILE_INTAKE_REQUEST_KEY = exports.FileIntake = exports.ObjectStoreBootCheck = exports.NodeSha256Digest = exports.S3ObjectStore = void 0;
21
+ exports.SHIELD_SESSION_AUTHORITY = exports.SHIELD_AUTHENTICATOR = exports.SHIELD_PROFILE_RESOLVER = exports.SHIELD_CREDENTIAL_RESOLVER = exports.SHIELD_REDIS = exports.mariadbSslOption = exports.assertNoReservedRootId = exports.ORG_BOOTSTRAP_PRINCIPAL_ID = exports.rootIdsFromEnv = exports.loadDbTlsConfig = exports.isDevOrTestNodeEnv = exports.DEFAULT_LOGIN_IP_LIMIT = exports.loadRefreshReplayWindowMs = exports.loadLoginIpLimit = exports.DEFAULT_REDIS_URL = exports.DEFAULT_DB_CONFIG = exports.assertRefreshHmacKey = exports.loadRefreshHmacKey = exports.loadSessionLifetimes = exports.loadRedisConfig = exports.loadDbConfig = exports.SCHEMA_SVC_POOL_HARD_CAP = exports.DEFAULT_POOL_BUDGET = exports.evaluatePoolBudget = exports.loadPoolBudget = exports.loadAppConfig = exports.frameworkSchemasOf = exports.FRAMEWORK_SCHEMAS = exports.APP_CONFIG = exports.resolveMigrationLedgerCheck = exports.resolveMigrationLedger = exports.frameworkMigrationIds = exports.assertFrameworkMigrationsApplied = exports.SHIELD_MIGRATION_LEDGER_REGISTRY = exports.MigrationLedgerRegistry = exports.FrameworkMigrationLedgerCheck = exports.frameworkDatabasesLogLine = exports.assertPoolBudget = exports.BootSequence = exports.buildListScopeFn = exports.MariaDbSessionRestrictionStore = exports.SHIELD_SESSION_RESTRICTIONS = exports.SHIELD_PERMISSION_VERSION_CACHE = exports.DEFAULT_PERMISSION_VERSION_TTL_MS = exports.PERMISSION_VERSION_KEY_PREFIX = exports.RedisPermissionVersionCache = exports.withRedisPermissionVersion = exports.buildRecordAuthorization = exports.SHIELD_OPERATION_AUTHORITY_PORT = exports.ManifestOperationAuthorityAdapter = void 0;
22
+ exports.ScopeUnknownParentError = exports.ScopeDepthError = exports.ScopeCycleError = exports.buildClosureRows = exports.ConfirmEmailController = exports.AccountController = exports.generateRecoveryCodes = exports.buildOtpauthUri = exports.generateTotpSecret = exports.SHIELD_LOGIN_TOTP_VERIFIER = exports.SHIELD_MFA_STEP_UP = exports.SHIELD_MFA_LIMITER = exports.challengeMatches = exports.credentialFingerprint = exports.CredentialMfaStepUp = exports.RedisPendingMfaStore = exports.PendingMfaStore = exports.AuthController = exports.SHIELD_SCOPE_SUBTREE_RESOLVER = exports.SHIELD_SESSION_FACTS_PROJECTOR = exports.ProfileNameTakenError = exports.MariaDbEmailAddressChanger = exports.maskEmail = exports.isEmailShaped = exports.canonicalEmail = exports.hmacSha1 = exports.resolveTotpVerifier = exports.makeDefaultTotpVerifier = exports.AuthModule = exports.MariaDbCredentialResolver = exports.SHIELD_TOTP_VERIFIER_OVERRIDE = exports.SHIELD_MFA_DEVICE_STORE = exports.SHIELD_AUDIT_SINK = exports.SHIELD_SESSION_SWEEPER = exports.SHIELD_PROFILE_WRITER = exports.SHIELD_RECOVERY_CODE_STORE = exports.SHIELD_EMAIL_SENDER = exports.SHIELD_EMAIL_CHANGE_TOKEN_STORE = exports.SHIELD_RESET_TOKEN_STORE = exports.SHIELD_CREDENTIAL_WRITER = void 0;
23
23
  // Framework authz migrations (shield_authz DDL — permission / role_permission /
24
24
  // authz_permission_version). Absolute path a consumer's `@astram/migrate` setup merges in.
25
25
  var migrations_dir_js_1 = require("./migrations-dir.js");
@@ -123,6 +123,12 @@ var argon2id_password_hasher_js_1 = require("./authentication/argon2id-password-
123
123
  Object.defineProperty(exports, "Argon2idPasswordHasher", { enumerable: true, get: function () { return argon2id_password_hasher_js_1.Argon2idPasswordHasher; } });
124
124
  Object.defineProperty(exports, "argon2idHasherProvider", { enumerable: true, get: function () { return argon2id_password_hasher_js_1.argon2idHasherProvider; } });
125
125
  Object.defineProperty(exports, "SHIELD_PASSWORD_HASHER", { enumerable: true, get: function () { return argon2id_password_hasher_js_1.SHIELD_PASSWORD_HASHER; } });
126
+ Object.defineProperty(exports, "lockedPasswordHash", { enumerable: true, get: function () { return argon2id_password_hasher_js_1.lockedPasswordHash; } });
127
+ Object.defineProperty(exports, "isLockedHash", { enumerable: true, get: function () { return argon2id_password_hasher_js_1.isLockedHash; } });
128
+ var credential_provisioner_js_1 = require("./authentication/credential-provisioner.js");
129
+ Object.defineProperty(exports, "CredentialExistsError", { enumerable: true, get: function () { return credential_provisioner_js_1.CredentialExistsError; } });
130
+ var link_base_url_js_1 = require("./auth/link-base-url.js");
131
+ Object.defineProperty(exports, "resolveAuthLinkBaseUrls", { enumerable: true, get: function () { return link_base_url_js_1.resolveAuthLinkBaseUrls; } });
126
132
  // The reference `CryptoPort` adapter (ADR-0031 envelope encryption): real AES-256-GCM AEAD +
127
133
  // local-KEK DEK-wrapping, injected into `@astram/core`'s `createEncryptionService({ crypto })`.
128
134
  // Core stays zero-dep; the KMS-backed adapters (AWS/GCP/Vault) implement the same port.
@@ -363,6 +369,12 @@ Object.defineProperty(exports, "DEFAULT_LOGIN_IP_LIMIT", { enumerable: true, get
363
369
  Object.defineProperty(exports, "isDevOrTestNodeEnv", { enumerable: true, get: function () { return app_config_js_2.isDevOrTestNodeEnv; } });
364
370
  // Phase 16 (additive): TLS to MariaDB (APP_DB_TLS / APP_DB_TLS_CA).
365
371
  Object.defineProperty(exports, "loadDbTlsConfig", { enumerable: true, get: function () { return app_config_js_2.loadDbTlsConfig; } });
372
+ // G-009 R9: platform-root ids from `SHIELD_ROOT_IDS` (strict canonical uuids, fail closed).
373
+ var root_ids_from_env_js_1 = require("./config/root-ids-from-env.js");
374
+ Object.defineProperty(exports, "rootIdsFromEnv", { enumerable: true, get: function () { return root_ids_from_env_js_1.rootIdsFromEnv; } });
375
+ var reserved_principal_ids_js_1 = require("./config/reserved-principal-ids.js");
376
+ Object.defineProperty(exports, "ORG_BOOTSTRAP_PRINCIPAL_ID", { enumerable: true, get: function () { return reserved_principal_ids_js_1.ORG_BOOTSTRAP_PRINCIPAL_ID; } });
377
+ Object.defineProperty(exports, "assertNoReservedRootId", { enumerable: true, get: function () { return reserved_principal_ids_js_1.assertNoReservedRootId; } });
366
378
  // Phase 16: the driver `ssl` option every framework pool uses (identity's pools build on it).
367
379
  var connections_js_1 = require("./auth/connections.js");
368
380
  Object.defineProperty(exports, "mariadbSslOption", { enumerable: true, get: function () { return connections_js_1.mariadbSslOption; } });
@@ -9,4 +9,5 @@
9
9
  */
10
10
  export { PersistenceModule } from './auth/persistence.module.js';
11
11
  export { SHIELD_DB_POOL } from './auth/tokens.js';
12
+ export { MariaDbCredentialProvisioner } from './authentication/mariadb-credential-provisioner.js';
12
13
  //# sourceMappingURL=internal.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"internal.d.ts","sourceRoot":"","sources":["../src/internal.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,OAAO,EAAE,iBAAiB,EAAE,MAAM,8BAA8B,CAAC;AACjE,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC"}
1
+ {"version":3,"file":"internal.d.ts","sourceRoot":"","sources":["../src/internal.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,OAAO,EAAE,iBAAiB,EAAE,MAAM,8BAA8B,CAAC;AACjE,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,4BAA4B,EAAE,MAAM,oDAAoD,CAAC"}
package/dist/internal.js CHANGED
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.SHIELD_DB_POOL = exports.PersistenceModule = void 0;
3
+ exports.MariaDbCredentialProvisioner = exports.SHIELD_DB_POOL = exports.PersistenceModule = void 0;
4
4
  /**
5
5
  * @astram/guard/internal — framework-composition and test surface (Phase 8 #5).
6
6
  *
@@ -14,3 +14,5 @@ var persistence_module_js_1 = require("./auth/persistence.module.js");
14
14
  Object.defineProperty(exports, "PersistenceModule", { enumerable: true, get: function () { return persistence_module_js_1.PersistenceModule; } });
15
15
  var tokens_js_1 = require("./auth/tokens.js");
16
16
  Object.defineProperty(exports, "SHIELD_DB_POOL", { enumerable: true, get: function () { return tokens_js_1.SHIELD_DB_POOL; } });
17
+ var mariadb_credential_provisioner_js_1 = require("./authentication/mariadb-credential-provisioner.js");
18
+ Object.defineProperty(exports, "MariaDbCredentialProvisioner", { enumerable: true, get: function () { return mariadb_credential_provisioner_js_1.MariaDbCredentialProvisioner; } });
@@ -1 +1 @@
1
- {"version":3,"file":"shield.module.d.ts","sourceRoot":"","sources":["../../src/module/shield.module.ts"],"names":[],"mappings":"AAAA,OAAO,EAAkB,KAAK,aAAa,EAAiB,MAAM,gBAAgB,CAAC;AAOnF,OAAO,KAAK,EAAE,kBAAkB,EAAE,cAAc,EAAoB,MAAM,cAAc,CAAC;AAQzF,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,uCAAuC,CAAC;AACvF,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,6BAA6B,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,CAAC,OAAO,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IACrC;;;;;OAKG;IACH,QAAQ,CAAC,kBAAkB,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IAChD,2FAA2F;IAC3F,QAAQ,CAAC,wBAAwB,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IACtD;;;;;OAKG;IACH,QAAQ,CAAC,qBAAqB,CAAC,EAAE,qBAAqB,CAAC;IACvD;;;;OAIG;IACH,QAAQ,CAAC,oBAAoB,CAAC,EAAE,oBAAoB,CAAC;IACrD;;;;OAIG;IACH,QAAQ,CAAC,iBAAiB,CAAC,EAAE,iBAAiB,CAAC;IAC/C,+FAA+F;IAC/F,QAAQ,CAAC,sBAAsB,CAAC,EAAE,MAAM,CAAC;IACzC,6FAA6F;IAC7F,QAAQ,CAAC,OAAO,CAAC,EAAE,mBAAmB,CAAC;CACxC;AAYD;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,qBAEa,YAAY;IACvB,6DAA6D;IAC7D,MAAM,CAAC,OAAO,CAAC,OAAO,GAAE,mBAAwB,GAAG,aAAa;IAiHhE;;;;;;;;;OASG;IACH,MAAM,CAAC,YAAY,CAAC,OAAO,EAAE,wBAAwB,GAAG,aAAa;CA6HtE"}
@@ -49,6 +49,7 @@ const boot_module_js_1 = require("../boot/boot.module.js");
49
49
  const migration_ledger_check_js_1 = require("../boot/migration-ledger-check.js");
50
50
  const config_module_js_1 = require("../config/config.module.js");
51
51
  const app_config_js_1 = require("../config/app-config.js");
52
+ const reserved_principal_ids_js_1 = require("../config/reserved-principal-ids.js");
52
53
  /**
53
54
  * `FRAMEWORK_SCHEMAS` from `APP_CONFIG` (configurable-framework-db, ADR-0037): resolved once
54
55
  * at boot, the same frozen names every framework store and module receives.
@@ -226,6 +227,8 @@ function loadEnvAppConfig() {
226
227
  let ShieldModule = ShieldModule_1 = class ShieldModule {
227
228
  /** Register Shield with static options (the common path). */
228
229
  static forRoot(options = {}) {
230
+ // G-009 N4: a reserved operation principal is never a root, however `rootIds` was built.
231
+ (0, reserved_principal_ids_js_1.assertNoReservedRootId)(options.rootIds);
229
232
  const config = options.config ?? loadEnvAppConfig();
230
233
  // ADR-0035: with auth on and no explicit projector, sessions cache the facts the framework-built
231
234
  // authority decides on (attached when the authority is built; inactive until then).
@@ -337,6 +340,7 @@ let ShieldModule = ShieldModule_1 = class ShieldModule {
337
340
  * unchanged whether config is static or computed.
338
341
  */
339
342
  static forRootAsync(options) {
343
+ (0, reserved_principal_ids_js_1.assertNoReservedRootId)(options.rootIds); // G-009 N4 (the static allowlist; see forRoot)
340
344
  const optionsToken = Symbol('SHIELD_MODULE_OPTIONS');
341
345
  const asyncOptionsProvider = {
342
346
  provide: optionsToken,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@astram/guard",
3
- "version": "0.16.0",
3
+ "version": "0.17.0",
4
4
  "license": "MIT",
5
5
  "description": "Astram framework — the enforcement guard + real-world adapters (the 'hands'). One global deny-by-default gate every request passes through (ADR-0002), classification decorators, boot-pool assertion (ADR-0018), the forRoot() registration seam, and the DB/Redis/crypto adapters that connect the sealed core to a real backend. Depends on @astram/core (ADR-0003, ADR-0023).",
6
6
  "type": "commonjs",
@@ -36,8 +36,8 @@
36
36
  "argon2": "^0.41.1",
37
37
  "ioredis": "^5.4.1",
38
38
  "mariadb": "^3.5.4",
39
- "@astram/core": "1.8.0",
40
- "@astram/engine": "0.9.0"
39
+ "@astram/engine": "0.10.0",
40
+ "@astram/core": "1.8.0"
41
41
  },
42
42
  "peerDependencies": {
43
43
  "@nestjs/common": "^11",