@astram/guard 0.1.1 → 0.3.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.
- package/dist/auth/account.controller.d.ts +245 -0
- package/dist/auth/account.controller.d.ts.map +1 -0
- package/dist/auth/account.controller.js +673 -0
- package/dist/auth/account.controller.js.map +1 -0
- package/dist/auth/auth.controller.d.ts +316 -0
- package/dist/auth/auth.controller.d.ts.map +1 -0
- package/dist/auth/auth.controller.js +1091 -0
- package/dist/auth/auth.controller.js.map +1 -0
- package/dist/auth/auth.module.d.ts +202 -0
- package/dist/auth/auth.module.d.ts.map +1 -0
- package/dist/auth/auth.module.js +610 -0
- package/dist/auth/auth.module.js.map +1 -0
- package/dist/auth/connections.d.ts +61 -0
- package/dist/auth/connections.d.ts.map +1 -0
- package/dist/auth/connections.js +116 -0
- package/dist/auth/connections.js.map +1 -0
- package/dist/auth/dto.d.ts +154 -0
- package/dist/auth/dto.d.ts.map +1 -0
- package/dist/auth/dto.js +29 -0
- package/dist/auth/dto.js.map +1 -0
- package/dist/auth/pending-mfa-store.d.ts +72 -0
- package/dist/auth/pending-mfa-store.d.ts.map +1 -0
- package/dist/auth/pending-mfa-store.js +106 -0
- package/dist/auth/pending-mfa-store.js.map +1 -0
- package/dist/auth/persistence.module.d.ts +42 -0
- package/dist/auth/persistence.module.d.ts.map +1 -0
- package/dist/auth/persistence.module.js +94 -0
- package/dist/auth/persistence.module.js.map +1 -0
- package/dist/auth/ports/audit-sink.d.ts +47 -0
- package/dist/auth/ports/audit-sink.d.ts.map +1 -0
- package/dist/auth/ports/audit-sink.js +20 -0
- package/dist/auth/ports/audit-sink.js.map +1 -0
- package/dist/auth/ports/credential-writer.d.ts +23 -0
- package/dist/auth/ports/credential-writer.d.ts.map +1 -0
- package/dist/auth/ports/credential-writer.js +2 -0
- package/dist/auth/ports/credential-writer.js.map +1 -0
- package/dist/auth/ports/email-sender.d.ts +14 -0
- package/dist/auth/ports/email-sender.d.ts.map +1 -0
- package/dist/auth/ports/email-sender.js +2 -0
- package/dist/auth/ports/email-sender.js.map +1 -0
- package/dist/auth/ports/mfa-device-store.d.ts +45 -0
- package/dist/auth/ports/mfa-device-store.d.ts.map +1 -0
- package/dist/auth/ports/mfa-device-store.js +13 -0
- package/dist/auth/ports/mfa-device-store.js.map +1 -0
- package/dist/auth/ports/profile-writer.d.ts +12 -0
- package/dist/auth/ports/profile-writer.d.ts.map +1 -0
- package/dist/auth/ports/profile-writer.js +2 -0
- package/dist/auth/ports/profile-writer.js.map +1 -0
- package/dist/auth/ports/recovery-code-store.d.ts +10 -0
- package/dist/auth/ports/recovery-code-store.d.ts.map +1 -0
- package/dist/auth/ports/recovery-code-store.js +2 -0
- package/dist/auth/ports/recovery-code-store.js.map +1 -0
- package/dist/auth/ports/reset-token-store.d.ts +12 -0
- package/dist/auth/ports/reset-token-store.d.ts.map +1 -0
- package/dist/auth/ports/reset-token-store.js +2 -0
- package/dist/auth/ports/reset-token-store.js.map +1 -0
- package/dist/auth/ports/session-facts-projector.d.ts +44 -0
- package/dist/auth/ports/session-facts-projector.d.ts.map +1 -0
- package/dist/auth/ports/session-facts-projector.js +30 -0
- package/dist/auth/ports/session-facts-projector.js.map +1 -0
- package/dist/auth/ports/session-sweeper.d.ts +12 -0
- package/dist/auth/ports/session-sweeper.d.ts.map +1 -0
- package/dist/auth/ports/session-sweeper.js +2 -0
- package/dist/auth/ports/session-sweeper.js.map +1 -0
- package/dist/auth/profile-resolver.d.ts +73 -0
- package/dist/auth/profile-resolver.d.ts.map +1 -0
- package/dist/auth/profile-resolver.js +28 -0
- package/dist/auth/profile-resolver.js.map +1 -0
- package/dist/auth/rate-limit/attempt-limiter.d.ts +91 -0
- package/dist/auth/rate-limit/attempt-limiter.d.ts.map +1 -0
- package/dist/auth/rate-limit/attempt-limiter.js +133 -0
- package/dist/auth/rate-limit/attempt-limiter.js.map +1 -0
- package/dist/auth/tokens.d.ts +236 -0
- package/dist/auth/tokens.d.ts.map +1 -0
- package/dist/auth/tokens.js +254 -0
- package/dist/auth/tokens.js.map +1 -0
- package/dist/auth/totp-enrollment.d.ts +42 -0
- package/dist/auth/totp-enrollment.d.ts.map +1 -0
- package/dist/auth/totp-enrollment.js +96 -0
- package/dist/auth/totp-enrollment.js.map +1 -0
- package/dist/authentication/argon2id-password-hasher.js.map +1 -0
- package/dist/authentication/mariadb-credential-resolver.d.ts +110 -0
- package/dist/authentication/mariadb-credential-resolver.d.ts.map +1 -0
- package/dist/authentication/mariadb-credential-resolver.js +170 -0
- package/dist/authentication/mariadb-credential-resolver.js.map +1 -0
- package/dist/authz/cross-tenant-grant-writer.d.ts +259 -0
- package/dist/authz/cross-tenant-grant-writer.d.ts.map +1 -0
- package/dist/authz/cross-tenant-grant-writer.js +397 -0
- package/dist/authz/cross-tenant-grant-writer.js.map +1 -0
- package/dist/authz/manifest-operation-authority-adapter.d.ts +65 -0
- package/dist/authz/manifest-operation-authority-adapter.d.ts.map +1 -0
- package/dist/authz/manifest-operation-authority-adapter.js +108 -0
- package/dist/authz/manifest-operation-authority-adapter.js.map +1 -0
- package/dist/authz/mariadb-cross-tenant-grant-adapter.d.ts +90 -0
- package/dist/authz/mariadb-cross-tenant-grant-adapter.d.ts.map +1 -0
- package/dist/authz/mariadb-cross-tenant-grant-adapter.js +211 -0
- package/dist/authz/mariadb-cross-tenant-grant-adapter.js.map +1 -0
- package/dist/authz/mariadb-record-rule-adapter.d.ts +60 -0
- package/dist/authz/mariadb-record-rule-adapter.d.ts.map +1 -0
- package/dist/authz/mariadb-record-rule-adapter.js +154 -0
- package/dist/authz/mariadb-record-rule-adapter.js.map +1 -0
- package/dist/authz/mariadb-record-share-adapter.d.ts +75 -0
- package/dist/authz/mariadb-record-share-adapter.d.ts.map +1 -0
- package/dist/authz/mariadb-record-share-adapter.js +106 -0
- package/dist/authz/mariadb-record-share-adapter.js.map +1 -0
- package/dist/authz/record-share-cascade.d.ts +52 -0
- package/dist/authz/record-share-cascade.d.ts.map +1 -0
- package/dist/authz/record-share-cascade.js +49 -0
- package/dist/authz/record-share-cascade.js.map +1 -0
- package/dist/authz/record-share-writer.d.ts +175 -0
- package/dist/authz/record-share-writer.d.ts.map +1 -0
- package/dist/authz/record-share-writer.js +225 -0
- package/dist/authz/record-share-writer.js.map +1 -0
- package/dist/authz/wire-record-authorization.d.ts +66 -0
- package/dist/authz/wire-record-authorization.d.ts.map +1 -0
- package/dist/authz/wire-record-authorization.js +34 -0
- package/dist/authz/wire-record-authorization.js.map +1 -0
- package/dist/boot/boot-sequence.js.map +1 -0
- package/dist/boot/boot.module.js.map +1 -0
- package/dist/completeness/catalog-reconciler.d.ts +21 -0
- package/dist/completeness/catalog-reconciler.d.ts.map +1 -0
- package/dist/completeness/catalog-reconciler.js +74 -0
- package/dist/completeness/catalog-reconciler.js.map +1 -0
- package/dist/completeness/operation-inventory-scanner.d.ts +17 -0
- package/dist/completeness/operation-inventory-scanner.d.ts.map +1 -0
- package/dist/completeness/operation-inventory-scanner.js +79 -0
- package/dist/completeness/operation-inventory-scanner.js.map +1 -0
- package/dist/completeness/ports/catalog-store.d.ts +33 -0
- package/dist/completeness/ports/catalog-store.d.ts.map +1 -0
- package/dist/completeness/ports/catalog-store.js +2 -0
- package/dist/completeness/ports/catalog-store.js.map +1 -0
- package/dist/config/app-config.d.ts +134 -1
- package/dist/config/app-config.d.ts.map +1 -1
- package/dist/config/app-config.js +144 -2
- package/dist/config/app-config.js.map +1 -0
- package/dist/config/config.module.js.map +1 -0
- package/dist/enforcement/classification.decorator.d.ts +33 -14
- package/dist/enforcement/classification.decorator.d.ts.map +1 -1
- package/dist/enforcement/classification.decorator.js +34 -14
- package/dist/enforcement/classification.decorator.js.map +1 -0
- package/dist/enforcement/core-seam.js.map +1 -0
- package/dist/enforcement/enforcement.module.js.map +1 -0
- package/dist/enforcement/global-enforcement.guard.d.ts +29 -19
- package/dist/enforcement/global-enforcement.guard.d.ts.map +1 -1
- package/dist/enforcement/global-enforcement.guard.js +108 -25
- package/dist/enforcement/global-enforcement.guard.js.map +1 -0
- package/dist/enforcement/reenroll-allowlist.d.ts +49 -0
- package/dist/enforcement/reenroll-allowlist.d.ts.map +1 -0
- package/dist/enforcement/reenroll-allowlist.js +77 -0
- package/dist/enforcement/reenroll-allowlist.js.map +1 -0
- package/dist/index.d.ts +43 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +198 -1
- package/dist/index.js.map +1 -0
- package/dist/module/shield-tokens.d.ts +15 -0
- package/dist/module/shield-tokens.d.ts.map +1 -0
- package/dist/module/shield-tokens.js +17 -0
- package/dist/module/shield-tokens.js.map +1 -0
- package/dist/module/shield.module.d.ts +203 -8
- package/dist/module/shield.module.d.ts.map +1 -1
- package/dist/module/shield.module.js +232 -14
- package/dist/module/shield.module.js.map +1 -0
- package/dist/request-auth/request-principal.d.ts +42 -0
- package/dist/request-auth/request-principal.d.ts.map +1 -0
- package/dist/request-auth/request-principal.js +87 -0
- package/dist/request-auth/request-principal.js.map +1 -0
- package/dist/request-auth/session-facts-als.d.ts +65 -0
- package/dist/request-auth/session-facts-als.d.ts.map +1 -0
- package/dist/request-auth/session-facts-als.js +57 -0
- package/dist/request-auth/session-facts-als.js.map +1 -0
- package/dist/request-auth/session-token-binder.d.ts +130 -0
- package/dist/request-auth/session-token-binder.d.ts.map +1 -0
- package/dist/request-auth/session-token-binder.js +277 -0
- package/dist/request-auth/session-token-binder.js.map +1 -0
- package/dist/request-auth/tokens.d.ts +14 -0
- package/dist/request-auth/tokens.d.ts.map +1 -0
- package/dist/request-auth/tokens.js +16 -0
- package/dist/request-auth/tokens.js.map +1 -0
- package/dist/session/crypto-adapters.js.map +1 -0
- package/dist/session/index.js.map +1 -0
- package/dist/session/mariadb-session-record-store.js.map +1 -0
- package/dist/session/redis-hot-session-store.js.map +1 -0
- package/package.json +2 -2
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* REENROLL_ALLOWED — the enforced-re-enroll allowlist (spec §4.2).
|
|
3
|
+
*
|
|
4
|
+
* A session established via a recovery-code login carries `mustReenroll: true` in its
|
|
5
|
+
* bound claims (see {@link import('../request-auth/session-token-binder.js').BoundPrincipalClaims}).
|
|
6
|
+
* The {@link import('./global-enforcement.guard.js').GlobalEnforcementGuard} restricts
|
|
7
|
+
* such a session to ONLY the routes below — the minimal set needed to RE-SECURE the
|
|
8
|
+
* account (add a fresh authenticator device + refresh recovery codes) and to observe
|
|
9
|
+
* the restricted state (`/auth/me`, list devices) or leave it (`/auth/logout`). EVERY
|
|
10
|
+
* other authenticated route returns 403 `{ error: 'reenrollment_required' }`.
|
|
11
|
+
*
|
|
12
|
+
* FAIL-CLOSED: this is an allowlist, not a denylist — a route NOT listed here (incl. an
|
|
13
|
+
* unclassified/unknown route) is DENIED for a `mustReenroll` session. Adding a route
|
|
14
|
+
* that a re-enrolling user must reach means adding it HERE, deliberately.
|
|
15
|
+
*
|
|
16
|
+
* NOTE — allowlisted ≠ gate-clearing (spec §4.3): being on this list only lets the
|
|
17
|
+
* request THROUGH the gate; it does NOT clear `mustReenroll`. ONLY a successful
|
|
18
|
+
* `POST /account/mfa/devices/confirm` clears the flag (the account controller calls
|
|
19
|
+
* `binder.clearReenroll`). Regenerating codes is allowed but does not re-secure.
|
|
20
|
+
*/
|
|
21
|
+
/** One allowlisted route: an HTTP method + the path SUFFIX it must end with. */
|
|
22
|
+
export interface ReenrollAllowedRoute {
|
|
23
|
+
readonly method: string;
|
|
24
|
+
/** The route path (no query string, no trailing slash), matched by suffix. */
|
|
25
|
+
readonly path: string;
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* The allowlist (spec §4.2). Paths are the framework-owned route paths; matched
|
|
29
|
+
* robustly by method + normalized-path suffix (see {@link isReenrollAllowed}) so a
|
|
30
|
+
* future global prefix, a trailing slash, or a query string never defeats the match.
|
|
31
|
+
*/
|
|
32
|
+
export declare const REENROLL_ALLOWED: readonly ReenrollAllowedRoute[];
|
|
33
|
+
/**
|
|
34
|
+
* Normalize a raw request path for matching: drop the query string and any fragment,
|
|
35
|
+
* collapse a trailing slash (except the root). Never throws.
|
|
36
|
+
*/
|
|
37
|
+
export declare function normalizeRequestPath(rawUrl: unknown): string;
|
|
38
|
+
/**
|
|
39
|
+
* True iff the (method, path) is on the enforced-re-enroll allowlist. Matching is
|
|
40
|
+
* case-insensitive on the method and SUFFIX-based on the normalized path — so
|
|
41
|
+
* `/api/account/mfa/devices/confirm` (a prefixed mount) still matches
|
|
42
|
+
* `/account/mfa/devices/confirm`. The path boundary is inherent: every `route.path`
|
|
43
|
+
* BEGINS with `/`, so `endsWith(route.path)` cannot spuriously match a longer segment
|
|
44
|
+
* name (`/evilaccount/...` does NOT end with `/account/...` — there is no `/` before
|
|
45
|
+
* `account`). `/account/mfa/devices/confirm-evil` also fails (its suffix is `confirm-evil`,
|
|
46
|
+
* not `/confirm`).
|
|
47
|
+
*/
|
|
48
|
+
export declare function isReenrollAllowed(method: unknown, rawUrl: unknown): boolean;
|
|
49
|
+
//# sourceMappingURL=reenroll-allowlist.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"reenroll-allowlist.d.ts","sourceRoot":"","sources":["../../src/enforcement/reenroll-allowlist.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,gFAAgF;AAChF,MAAM,WAAW,oBAAoB;IACnC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,8EAA8E;IAC9E,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;CACvB;AAED;;;;GAIG;AACH,eAAO,MAAM,gBAAgB,EAAE,SAAS,oBAAoB,EAO1D,CAAC;AAEH;;;GAGG;AACH,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,OAAO,GAAG,MAAM,CAO5D;AAED;;;;;;;;;GASG;AACH,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,OAAO,GAAG,OAAO,CAU3E"}
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* REENROLL_ALLOWED — the enforced-re-enroll allowlist (spec §4.2).
|
|
4
|
+
*
|
|
5
|
+
* A session established via a recovery-code login carries `mustReenroll: true` in its
|
|
6
|
+
* bound claims (see {@link import('../request-auth/session-token-binder.js').BoundPrincipalClaims}).
|
|
7
|
+
* The {@link import('./global-enforcement.guard.js').GlobalEnforcementGuard} restricts
|
|
8
|
+
* such a session to ONLY the routes below — the minimal set needed to RE-SECURE the
|
|
9
|
+
* account (add a fresh authenticator device + refresh recovery codes) and to observe
|
|
10
|
+
* the restricted state (`/auth/me`, list devices) or leave it (`/auth/logout`). EVERY
|
|
11
|
+
* other authenticated route returns 403 `{ error: 'reenrollment_required' }`.
|
|
12
|
+
*
|
|
13
|
+
* FAIL-CLOSED: this is an allowlist, not a denylist — a route NOT listed here (incl. an
|
|
14
|
+
* unclassified/unknown route) is DENIED for a `mustReenroll` session. Adding a route
|
|
15
|
+
* that a re-enrolling user must reach means adding it HERE, deliberately.
|
|
16
|
+
*
|
|
17
|
+
* NOTE — allowlisted ≠ gate-clearing (spec §4.3): being on this list only lets the
|
|
18
|
+
* request THROUGH the gate; it does NOT clear `mustReenroll`. ONLY a successful
|
|
19
|
+
* `POST /account/mfa/devices/confirm` clears the flag (the account controller calls
|
|
20
|
+
* `binder.clearReenroll`). Regenerating codes is allowed but does not re-secure.
|
|
21
|
+
*/
|
|
22
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
23
|
+
exports.REENROLL_ALLOWED = void 0;
|
|
24
|
+
exports.normalizeRequestPath = normalizeRequestPath;
|
|
25
|
+
exports.isReenrollAllowed = isReenrollAllowed;
|
|
26
|
+
/**
|
|
27
|
+
* The allowlist (spec §4.2). Paths are the framework-owned route paths; matched
|
|
28
|
+
* robustly by method + normalized-path suffix (see {@link isReenrollAllowed}) so a
|
|
29
|
+
* future global prefix, a trailing slash, or a query string never defeats the match.
|
|
30
|
+
*/
|
|
31
|
+
exports.REENROLL_ALLOWED = Object.freeze([
|
|
32
|
+
{ method: 'POST', path: '/account/mfa/devices/begin' },
|
|
33
|
+
{ method: 'POST', path: '/account/mfa/devices/confirm' },
|
|
34
|
+
{ method: 'POST', path: '/account/mfa/recovery-codes/regenerate' },
|
|
35
|
+
{ method: 'GET', path: '/account/mfa/devices' },
|
|
36
|
+
{ method: 'GET', path: '/auth/me' },
|
|
37
|
+
{ method: 'POST', path: '/auth/logout' },
|
|
38
|
+
]);
|
|
39
|
+
/**
|
|
40
|
+
* Normalize a raw request path for matching: drop the query string and any fragment,
|
|
41
|
+
* collapse a trailing slash (except the root). Never throws.
|
|
42
|
+
*/
|
|
43
|
+
function normalizeRequestPath(rawUrl) {
|
|
44
|
+
if (typeof rawUrl !== 'string' || rawUrl.length === 0)
|
|
45
|
+
return '';
|
|
46
|
+
// Strip query (?...) and fragment (#...).
|
|
47
|
+
let path = rawUrl.split('?', 1)[0].split('#', 1)[0];
|
|
48
|
+
// Collapse a single trailing slash (but keep the root "/").
|
|
49
|
+
if (path.length > 1 && path.endsWith('/'))
|
|
50
|
+
path = path.slice(0, -1);
|
|
51
|
+
return path;
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* True iff the (method, path) is on the enforced-re-enroll allowlist. Matching is
|
|
55
|
+
* case-insensitive on the method and SUFFIX-based on the normalized path — so
|
|
56
|
+
* `/api/account/mfa/devices/confirm` (a prefixed mount) still matches
|
|
57
|
+
* `/account/mfa/devices/confirm`. The path boundary is inherent: every `route.path`
|
|
58
|
+
* BEGINS with `/`, so `endsWith(route.path)` cannot spuriously match a longer segment
|
|
59
|
+
* name (`/evilaccount/...` does NOT end with `/account/...` — there is no `/` before
|
|
60
|
+
* `account`). `/account/mfa/devices/confirm-evil` also fails (its suffix is `confirm-evil`,
|
|
61
|
+
* not `/confirm`).
|
|
62
|
+
*/
|
|
63
|
+
function isReenrollAllowed(method, rawUrl) {
|
|
64
|
+
if (typeof method !== 'string')
|
|
65
|
+
return false;
|
|
66
|
+
const m = method.toUpperCase();
|
|
67
|
+
const path = normalizeRequestPath(rawUrl);
|
|
68
|
+
if (path === '')
|
|
69
|
+
return false;
|
|
70
|
+
for (const route of exports.REENROLL_ALLOWED) {
|
|
71
|
+
if (route.method !== m)
|
|
72
|
+
continue;
|
|
73
|
+
if (path === route.path || path.endsWith(route.path))
|
|
74
|
+
return true;
|
|
75
|
+
}
|
|
76
|
+
return false;
|
|
77
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"reenroll-allowlist.js","sourceRoot":"","sources":["../../src/enforcement/reenroll-allowlist.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;GAmBG;;;AA2BH,oDAOC;AAYD,8CAUC;AA/CD;;;;GAIG;AACU,QAAA,gBAAgB,GAAoC,MAAM,CAAC,MAAM,CAAC;IAC7E,EAAE,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,4BAA4B,EAAE;IACtD,EAAE,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,8BAA8B,EAAE;IACxD,EAAE,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,wCAAwC,EAAE;IAClE,EAAE,MAAM,EAAE,KAAK,EAAE,IAAI,EAAE,sBAAsB,EAAE;IAC/C,EAAE,MAAM,EAAE,KAAK,EAAE,IAAI,EAAE,UAAU,EAAE;IACnC,EAAE,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,cAAc,EAAE;CACzC,CAAC,CAAC;AAEH;;;GAGG;AACH,SAAgB,oBAAoB,CAAC,MAAe;IAClD,IAAI,OAAO,MAAM,KAAK,QAAQ,IAAI,MAAM,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,EAAE,CAAC;IACjE,0CAA0C;IAC1C,IAAI,IAAI,GAAG,MAAM,CAAC,KAAK,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC,CAAC,CAAE,CAAC,KAAK,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC,CAAC,CAAE,CAAC;IACtD,4DAA4D;IAC5D,IAAI,IAAI,CAAC,MAAM,GAAG,CAAC,IAAI,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC;QAAE,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;IACpE,OAAO,IAAI,CAAC;AACd,CAAC;AAED;;;;;;;;;GASG;AACH,SAAgB,iBAAiB,CAAC,MAAe,EAAE,MAAe;IAChE,IAAI,OAAO,MAAM,KAAK,QAAQ;QAAE,OAAO,KAAK,CAAC;IAC7C,MAAM,CAAC,GAAG,MAAM,CAAC,WAAW,EAAE,CAAC;IAC/B,MAAM,IAAI,GAAG,oBAAoB,CAAC,MAAM,CAAC,CAAC;IAC1C,IAAI,IAAI,KAAK,EAAE;QAAE,OAAO,KAAK,CAAC;IAC9B,KAAK,MAAM,KAAK,IAAI,wBAAgB,EAAE,CAAC;QACrC,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC;YAAE,SAAS;QACjC,IAAI,IAAI,KAAK,KAAK,CAAC,IAAI,IAAI,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,IAAI,CAAC;YAAE,OAAO,IAAI,CAAC;IACpE,CAAC;IACD,OAAO,KAAK,CAAC;AACf,CAAC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -14,13 +14,53 @@
|
|
|
14
14
|
* Depends on `@astram/core` (workspace); PEER-depends on `@nestjs/common`,
|
|
15
15
|
* `@nestjs/core`, `reflect-metadata`, `rxjs` so the host owns one copy of each.
|
|
16
16
|
*/
|
|
17
|
-
export { ShieldModule, SHIELD_DECISION_AUTHORITY, type ShieldModuleOptions, type ShieldModuleAsyncOptions, } from './module/shield.module.js';
|
|
18
|
-
export { Public, Classified, CLASSIFICATION_METADATA, } from './enforcement/classification.decorator.js';
|
|
17
|
+
export { ShieldModule, SHIELD_DECISION_AUTHORITY, type ShieldModuleOptions, type ShieldModuleAsyncOptions, type RecordAuthorizationInputs, } from './module/shield.module.js';
|
|
18
|
+
export { Public, Classified, CLASSIFICATION_METADATA, DEFAULT_CLASSIFIED_ACTION, normalizeClassification, } from './enforcement/classification.decorator.js';
|
|
19
|
+
export type { Classification } from './enforcement/classification.decorator.js';
|
|
20
|
+
export { OperationInventoryScanner } from './completeness/operation-inventory-scanner.js';
|
|
21
|
+
export { CatalogReconciler, CatalogGatabilityError } from './completeness/catalog-reconciler.js';
|
|
22
|
+
export type { CatalogStore, CatalogPermissionRow, ReconcileReport, } from './completeness/ports/catalog-store.js';
|
|
23
|
+
export { SHIELD_SESSION_TOKEN_BINDER } from './request-auth/tokens.js';
|
|
24
|
+
export { SessionTokenBinder } from './request-auth/session-token-binder.js';
|
|
25
|
+
export type { BoundPrincipalClaims } from './request-auth/session-token-binder.js';
|
|
26
|
+
export { resolveRequestPrincipal, principalFromClaims, extractBearerToken, } from './request-auth/request-principal.js';
|
|
27
|
+
export { SHIELD_SESSION_FACTS_ALS, NO_SESSION_FACTS, type SessionFactsStore, } from './request-auth/session-facts-als.js';
|
|
19
28
|
export { GlobalEnforcementGuard } from './enforcement/global-enforcement.guard.js';
|
|
20
29
|
export { stubDecisionAuthority, type Effect, type CoreDecisionAuthority, type CoreDecision, type Principal, } from './enforcement/core-seam.js';
|
|
21
30
|
export { Argon2idPasswordHasher, argon2idHasherProvider, SHIELD_PASSWORD_HASHER, type Argon2idParams, } from './authentication/argon2id-password-hasher.js';
|
|
22
31
|
export { MariaDbSessionRecordStore, SHIELD_SESSION_RECORD_STORE, RedisHotSessionStore, SHIELD_HOT_SESSION_STORE, CryptoTokenGenerator, Sha256RefreshTokenHasher, SystemClock, cryptoTokenGeneratorProvider, refreshHasherProvider, systemClockProvider, SHIELD_TOKEN_GENERATOR, SHIELD_REFRESH_HASHER, SHIELD_CLOCK, } from './session/index.js';
|
|
32
|
+
export { MariaDbRecordPermissionRuleAdapter, SHIELD_RECORD_RULE_PORT, type RuleQueryable, } from './authz/mariadb-record-rule-adapter.js';
|
|
33
|
+
export { MariaDbRecordShareAdapter, SHIELD_RECORD_SHARE_PORT, type ShareQueryable, } from './authz/mariadb-record-share-adapter.js';
|
|
34
|
+
export { RecordShareWriter, SHIELD_RECORD_SHARE_WRITER, ShareNotPermittedError, ShareStoreUnavailableError, type ShareInput, type ShareGranteeKind, type ShareTypeInfo, type ShareTypeResolver, type ShareAuditEvent, type ShareAuditSink, } from './authz/record-share-writer.js';
|
|
35
|
+
export { makeShareDeleteCascade, type RecordDeletedHook, type ShareQueryFn, } from './authz/record-share-cascade.js';
|
|
36
|
+
export { MariaDbCrossTenantGrantAdapter, SHIELD_CROSS_TENANT_GRANT_PORT, type GrantQueryable, } from './authz/mariadb-cross-tenant-grant-adapter.js';
|
|
37
|
+
export { CrossTenantGrantWriter, SHIELD_CROSS_TENANT_GRANT_WRITER, GrantNotPermittedError, InvalidGrantError, GrantStoreUnavailableError, type GrantAuthorizeFn, type GrantAuditEvent, type GrantAuditSink, type GrantGranteeKind, type GrantScope, type OfferGrantInput, type AcceptGrantInput, type RevokeGrantInput, } from './authz/cross-tenant-grant-writer.js';
|
|
38
|
+
export { ManifestOperationAuthorityAdapter, SHIELD_OPERATION_AUTHORITY_PORT, type OperationManifestEntry, } from './authz/manifest-operation-authority-adapter.js';
|
|
39
|
+
export { buildRecordAuthorization } from './authz/wire-record-authorization.js';
|
|
23
40
|
export { BootSequence, assertPoolBudget } from './boot/boot-sequence.js';
|
|
24
41
|
export { APP_CONFIG } from './config/config.module.js';
|
|
25
|
-
export { loadAppConfig, loadPoolBudget, evaluatePoolBudget, DEFAULT_POOL_BUDGET, SCHEMA_SVC_POOL_HARD_CAP, type AppConfig, type PoolBudgetConfig, type PoolBudgetEvaluation, type RuntimeAccountPools, } from './config/app-config.js';
|
|
42
|
+
export { 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, } from './config/app-config.js';
|
|
43
|
+
export { SHIELD_DB_POOL, SHIELD_REDIS, SHIELD_CREDENTIAL_RESOLVER, SHIELD_PROFILE_RESOLVER, SHIELD_AUTHENTICATOR, SHIELD_SESSION_AUTHORITY, SHIELD_CREDENTIAL_WRITER, SHIELD_RESET_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';
|
|
44
|
+
export { MariaDbCredentialResolver } from './authentication/mariadb-credential-resolver.js';
|
|
45
|
+
export type { SessionView, SessionTokensView, SessionSuccess, LoginRequest, MfaChallengeResponse, LoginResponse, MfaRequest, MfaResponse, RefreshRequest, RefreshResponse, LogoutRequest, LogoutAck, } from './auth/dto.js';
|
|
46
|
+
export { PersistenceModule } from './auth/persistence.module.js';
|
|
47
|
+
export { AuthModule, type AuthModuleOptions } from './auth/auth.module.js';
|
|
48
|
+
export { makeDefaultTotpVerifier, resolveTotpVerifier, hmacSha1 } from './auth/auth.module.js';
|
|
49
|
+
export type { CredentialResolver, ResolvedCredential, RequiredFactor, } from '@astram/core';
|
|
50
|
+
export type { FactorVerifier, FactorVerdict, Credential } from '@astram/core';
|
|
51
|
+
export type { ProfileResolver, CurrentUserProfile, ProfileRole, ProfileTenant, } from './auth/profile-resolver.js';
|
|
52
|
+
export type { CredentialWriter } from './auth/ports/credential-writer.js';
|
|
53
|
+
export type { ResetTokenStore } from './auth/ports/reset-token-store.js';
|
|
54
|
+
export type { EmailSender, EmailMessage } from './auth/ports/email-sender.js';
|
|
55
|
+
export type { RecoveryCodeStore } from './auth/ports/recovery-code-store.js';
|
|
56
|
+
export type { ProfileWriter } from './auth/ports/profile-writer.js';
|
|
57
|
+
export type { SessionSweeper } from './auth/ports/session-sweeper.js';
|
|
58
|
+
export type { MfaDeviceStore, MfaDevice } from './auth/ports/mfa-device-store.js';
|
|
59
|
+
export type { AuditSink, AuthAuditEvent } from './auth/ports/audit-sink.js';
|
|
60
|
+
export type { SessionFactsProjector } from './auth/ports/session-facts-projector.js';
|
|
61
|
+
export { SHIELD_SESSION_FACTS_PROJECTOR } from './auth/tokens.js';
|
|
62
|
+
export { AuthController } from './auth/auth.controller.js';
|
|
63
|
+
export { PendingMfaStore } from './auth/pending-mfa-store.js';
|
|
64
|
+
export { generateTotpSecret, buildOtpauthUri, generateRecoveryCodes, } from './auth/totp-enrollment.js';
|
|
65
|
+
export { AccountController } from './auth/account.controller.js';
|
|
26
66
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAGH,OAAO,EACL,YAAY,EACZ,yBAAyB,EACzB,KAAK,mBAAmB,EACxB,KAAK,wBAAwB,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAGH,OAAO,EACL,YAAY,EACZ,yBAAyB,EACzB,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,yBAAyB,EAAE,MAAM,+CAA+C,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E,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;AAOlE,OAAO,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAC3D,OAAO,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAC;AAK9D,OAAO,EACL,kBAAkB,EAClB,eAAe,EACf,qBAAqB,GACtB,MAAM,2BAA2B,CAAC;AAKnC,OAAO,EAAE,iBAAiB,EAAE,MAAM,8BAA8B,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -16,7 +16,8 @@
|
|
|
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.
|
|
19
|
+
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.SHIELD_RECORD_RULE_PORT = exports.MariaDbRecordPermissionRuleAdapter = exports.SHIELD_CLOCK = exports.SHIELD_REFRESH_HASHER = exports.SHIELD_TOKEN_GENERATOR = exports.systemClockProvider = exports.refreshHasherProvider = exports.cryptoTokenGeneratorProvider = exports.SystemClock = exports.Sha256RefreshTokenHasher = exports.CryptoTokenGenerator = exports.SHIELD_HOT_SESSION_STORE = exports.RedisHotSessionStore = exports.SHIELD_SESSION_RECORD_STORE = exports.MariaDbSessionRecordStore = exports.SHIELD_PASSWORD_HASHER = exports.argon2idHasherProvider = exports.Argon2idPasswordHasher = exports.stubDecisionAuthority = exports.GlobalEnforcementGuard = exports.NO_SESSION_FACTS = exports.SHIELD_SESSION_FACTS_ALS = exports.extractBearerToken = exports.principalFromClaims = exports.resolveRequestPrincipal = exports.SessionTokenBinder = exports.SHIELD_SESSION_TOKEN_BINDER = exports.CatalogGatabilityError = exports.CatalogReconciler = exports.OperationInventoryScanner = exports.normalizeClassification = exports.DEFAULT_CLASSIFIED_ACTION = exports.CLASSIFICATION_METADATA = exports.Classified = exports.Public = exports.SHIELD_DECISION_AUTHORITY = exports.ShieldModule = void 0;
|
|
20
|
+
exports.AccountController = exports.generateRecoveryCodes = exports.buildOtpauthUri = exports.generateTotpSecret = exports.PendingMfaStore = exports.AuthController = exports.SHIELD_SESSION_FACTS_PROJECTOR = exports.hmacSha1 = exports.resolveTotpVerifier = exports.makeDefaultTotpVerifier = exports.AuthModule = exports.PersistenceModule = 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_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.SHIELD_DB_POOL = 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.APP_CONFIG = exports.assertPoolBudget = exports.BootSequence = exports.buildRecordAuthorization = exports.SHIELD_OPERATION_AUTHORITY_PORT = exports.ManifestOperationAuthorityAdapter = exports.GrantStoreUnavailableError = void 0;
|
|
20
21
|
// The single registration seam.
|
|
21
22
|
var shield_module_js_1 = require("./module/shield.module.js");
|
|
22
23
|
Object.defineProperty(exports, "ShieldModule", { enumerable: true, get: function () { return shield_module_js_1.ShieldModule; } });
|
|
@@ -26,6 +27,38 @@ var classification_decorator_js_1 = require("./enforcement/classification.decora
|
|
|
26
27
|
Object.defineProperty(exports, "Public", { enumerable: true, get: function () { return classification_decorator_js_1.Public; } });
|
|
27
28
|
Object.defineProperty(exports, "Classified", { enumerable: true, get: function () { return classification_decorator_js_1.Classified; } });
|
|
28
29
|
Object.defineProperty(exports, "CLASSIFICATION_METADATA", { enumerable: true, get: function () { return classification_decorator_js_1.CLASSIFICATION_METADATA; } });
|
|
30
|
+
Object.defineProperty(exports, "DEFAULT_CLASSIFIED_ACTION", { enumerable: true, get: function () { return classification_decorator_js_1.DEFAULT_CLASSIFIED_ACTION; } });
|
|
31
|
+
Object.defineProperty(exports, "normalizeClassification", { enumerable: true, get: function () { return classification_decorator_js_1.normalizeClassification; } });
|
|
32
|
+
// Auto-catalog: boot-time route reflection + catalog reconcile (register a @Classified
|
|
33
|
+
// route → its permission auto-appears; route-less permissions orphaned). The consumer
|
|
34
|
+
// supplies the CatalogStore DB impl (ADR-0003 — guard does no DB).
|
|
35
|
+
var operation_inventory_scanner_js_1 = require("./completeness/operation-inventory-scanner.js");
|
|
36
|
+
Object.defineProperty(exports, "OperationInventoryScanner", { enumerable: true, get: function () { return operation_inventory_scanner_js_1.OperationInventoryScanner; } });
|
|
37
|
+
var catalog_reconciler_js_1 = require("./completeness/catalog-reconciler.js");
|
|
38
|
+
Object.defineProperty(exports, "CatalogReconciler", { enumerable: true, get: function () { return catalog_reconciler_js_1.CatalogReconciler; } });
|
|
39
|
+
Object.defineProperty(exports, "CatalogGatabilityError", { enumerable: true, get: function () { return catalog_reconciler_js_1.CatalogGatabilityError; } });
|
|
40
|
+
// The request-auth layer (access token → Principal → decide()). The binder token is
|
|
41
|
+
// exported so advanced consumers can inspect/override it; `SessionTokenBinder` +
|
|
42
|
+
// `resolveRequestPrincipal` are exported for testing + reuse. The guard wires these
|
|
43
|
+
// internally — a consumer does NOT hand-wire request auth.
|
|
44
|
+
var tokens_js_1 = require("./request-auth/tokens.js");
|
|
45
|
+
Object.defineProperty(exports, "SHIELD_SESSION_TOKEN_BINDER", { enumerable: true, get: function () { return tokens_js_1.SHIELD_SESSION_TOKEN_BINDER; } });
|
|
46
|
+
var session_token_binder_js_1 = require("./request-auth/session-token-binder.js");
|
|
47
|
+
Object.defineProperty(exports, "SessionTokenBinder", { enumerable: true, get: function () { return session_token_binder_js_1.SessionTokenBinder; } });
|
|
48
|
+
var request_principal_js_1 = require("./request-auth/request-principal.js");
|
|
49
|
+
Object.defineProperty(exports, "resolveRequestPrincipal", { enumerable: true, get: function () { return request_principal_js_1.resolveRequestPrincipal; } });
|
|
50
|
+
Object.defineProperty(exports, "principalFromClaims", { enumerable: true, get: function () { return request_principal_js_1.principalFromClaims; } });
|
|
51
|
+
Object.defineProperty(exports, "extractBearerToken", { enumerable: true, get: function () { return request_principal_js_1.extractBearerToken; } });
|
|
52
|
+
// The per-request session-facts hot path (ADR-0011): the SINGLE shared
|
|
53
|
+
// `AsyncLocalStorage` the enforcement guard ENTERS around decide() and the consumer's
|
|
54
|
+
// app-owned `SessionFactsReader` READS. The consumer imports THIS exact singleton to
|
|
55
|
+
// build an ALS-backed reader (swapping the null-facts slot in its authz wiring), so
|
|
56
|
+
// both sides share one instance — the guard writes THIS request's cached grants, the
|
|
57
|
+
// reader serves them to gate 5. `SessionFactsStore` is the store shape (mirrors core's
|
|
58
|
+
// SessionFactsReader 1:1); `NO_SESSION_FACTS` is the fail-closed empty store.
|
|
59
|
+
var session_facts_als_js_1 = require("./request-auth/session-facts-als.js");
|
|
60
|
+
Object.defineProperty(exports, "SHIELD_SESSION_FACTS_ALS", { enumerable: true, get: function () { return session_facts_als_js_1.SHIELD_SESSION_FACTS_ALS; } });
|
|
61
|
+
Object.defineProperty(exports, "NO_SESSION_FACTS", { enumerable: true, get: function () { return session_facts_als_js_1.NO_SESSION_FACTS; } });
|
|
29
62
|
// The global enforcement guard (framework-owned; exported so the enforcement
|
|
30
63
|
// point is inspectable/testable, not so consumers re-wire it).
|
|
31
64
|
//
|
|
@@ -68,6 +101,83 @@ Object.defineProperty(exports, "systemClockProvider", { enumerable: true, get: f
|
|
|
68
101
|
Object.defineProperty(exports, "SHIELD_TOKEN_GENERATOR", { enumerable: true, get: function () { return index_js_1.SHIELD_TOKEN_GENERATOR; } });
|
|
69
102
|
Object.defineProperty(exports, "SHIELD_REFRESH_HASHER", { enumerable: true, get: function () { return index_js_1.SHIELD_REFRESH_HASHER; } });
|
|
70
103
|
Object.defineProperty(exports, "SHIELD_CLOCK", { enumerable: true, get: function () { return index_js_1.SHIELD_CLOCK; } });
|
|
104
|
+
// The record-permit ADMIN-rule adapter (ADR-0003 / design §5.1): the concrete
|
|
105
|
+
// `RecordPermissionRulePort` over the `record_permission_rule` table. Reads ADMIN
|
|
106
|
+
// rules only; the framework-owned OWNER baseline is core's job (not a row here). An
|
|
107
|
+
// empty table ⇒ owner-only access (core baseline), NOT a lockout. Injected into core's
|
|
108
|
+
// wired decision authority by the consumer's authz wiring.
|
|
109
|
+
var mariadb_record_rule_adapter_js_1 = require("./authz/mariadb-record-rule-adapter.js");
|
|
110
|
+
Object.defineProperty(exports, "MariaDbRecordPermissionRuleAdapter", { enumerable: true, get: function () { return mariadb_record_rule_adapter_js_1.MariaDbRecordPermissionRuleAdapter; } });
|
|
111
|
+
Object.defineProperty(exports, "SHIELD_RECORD_RULE_PORT", { enumerable: true, get: function () { return mariadb_record_rule_adapter_js_1.SHIELD_RECORD_RULE_PORT; } });
|
|
112
|
+
// The per-record SHARE adapter (ADR-0003 / design §6): the concrete `RecordSharePort` over
|
|
113
|
+
// the `record_share` table. Answers `hasShare` (user- OR role-granted shares, exact-or-`*`
|
|
114
|
+
// action). No share ⇒ false; store outage ⇒ AuthorizationUnavailableError. Injected into
|
|
115
|
+
// core's wired decision authority by the consumer's authz wiring.
|
|
116
|
+
var mariadb_record_share_adapter_js_1 = require("./authz/mariadb-record-share-adapter.js");
|
|
117
|
+
Object.defineProperty(exports, "MariaDbRecordShareAdapter", { enumerable: true, get: function () { return mariadb_record_share_adapter_js_1.MariaDbRecordShareAdapter; } });
|
|
118
|
+
Object.defineProperty(exports, "SHIELD_RECORD_SHARE_PORT", { enumerable: true, get: function () { return mariadb_record_share_adapter_js_1.SHIELD_RECORD_SHARE_PORT; } });
|
|
119
|
+
// The WHO-MAY-SHARE write path (design §6.2, the Phase-3 invariant): share CREATION is
|
|
120
|
+
// framework-bounded — only the record's OWNER (fetched tenant-scoped, never trusted from
|
|
121
|
+
// input) may share an `owned`-type record; non-owners + grantees are rejected by
|
|
122
|
+
// construction. Idempotent INSERT, DELETE on unshare, best-effort audit. Exposed as a
|
|
123
|
+
// provider the consumer's share/unshare surface calls. The consumer supplies a
|
|
124
|
+
// `ShareTypeResolver` (over the engine registry) + an optional `ShareAuditSink` — keeping
|
|
125
|
+
// guard decoupled from `@astram/engine`.
|
|
126
|
+
var record_share_writer_js_1 = require("./authz/record-share-writer.js");
|
|
127
|
+
Object.defineProperty(exports, "RecordShareWriter", { enumerable: true, get: function () { return record_share_writer_js_1.RecordShareWriter; } });
|
|
128
|
+
Object.defineProperty(exports, "SHIELD_RECORD_SHARE_WRITER", { enumerable: true, get: function () { return record_share_writer_js_1.SHIELD_RECORD_SHARE_WRITER; } });
|
|
129
|
+
Object.defineProperty(exports, "ShareNotPermittedError", { enumerable: true, get: function () { return record_share_writer_js_1.ShareNotPermittedError; } });
|
|
130
|
+
Object.defineProperty(exports, "ShareStoreUnavailableError", { enumerable: true, get: function () { return record_share_writer_js_1.ShareStoreUnavailableError; } });
|
|
131
|
+
// The delete-cascade (design §6.2 orphan-share cleanup): builds the guard-owned
|
|
132
|
+
// `(typeKey, recordId, tenantId) => Promise<void>` the consumer wires into the engine's
|
|
133
|
+
// OPTIONAL `onRecordDeleted` hook (the engine never imports guard — ADR-0003). Removes a
|
|
134
|
+
// deleted record's `record_share` rows, tenant-scoped.
|
|
135
|
+
var record_share_cascade_js_1 = require("./authz/record-share-cascade.js");
|
|
136
|
+
Object.defineProperty(exports, "makeShareDeleteCascade", { enumerable: true, get: function () { return record_share_cascade_js_1.makeShareDeleteCascade; } });
|
|
137
|
+
// The CROSS-TENANT GRANT adapter (ADR-0009 / Phase 4): the concrete `CrossTenantGrantPort` over
|
|
138
|
+
// the `cross_tenant_grant` table. Answers `findActiveGrant` — the ONE active (accepted, unexpired,
|
|
139
|
+
// unrevoked) consented grant matching (owning tenant, type, grantee user/role, scope+record). No
|
|
140
|
+
// active grant ⇒ null; store outage ⇒ AuthorizationUnavailableError. Injected into core's wired
|
|
141
|
+
// decision authority by the consumer's authz wiring.
|
|
142
|
+
var mariadb_cross_tenant_grant_adapter_js_1 = require("./authz/mariadb-cross-tenant-grant-adapter.js");
|
|
143
|
+
Object.defineProperty(exports, "MariaDbCrossTenantGrantAdapter", { enumerable: true, get: function () { return mariadb_cross_tenant_grant_adapter_js_1.MariaDbCrossTenantGrantAdapter; } });
|
|
144
|
+
Object.defineProperty(exports, "SHIELD_CROSS_TENANT_GRANT_PORT", { enumerable: true, get: function () { return mariadb_cross_tenant_grant_adapter_js_1.SHIELD_CROSS_TENANT_GRANT_PORT; } });
|
|
145
|
+
// The WHO-MAY-GRANT lifecycle write path (ADR-0009, the Phase-4 invariant): grant offer/accept/
|
|
146
|
+
// revoke is framework-bounded — only an OWNING-tenant admin may OFFER (the grantee's own tenant
|
|
147
|
+
// can NEVER mint a grant), only a GRANTEE-tenant member may ACCEPT, EITHER side may REVOKE. Hard
|
|
148
|
+
// non-wildcard/non-empty action ceiling + mandatory future expiry enforced at offer. Audit on
|
|
149
|
+
// BOTH tenants (both tenant ids in structured fields, no raw uuid in a message). Exposed as a
|
|
150
|
+
// provider the consumer's grant surface calls. The consumer supplies a `GrantAuthorizeFn`
|
|
151
|
+
// (may this principal perform share/accept/revoke in this tenant? — resolved via the app's own
|
|
152
|
+
// `decide()`) + an optional `GrantAuditSink` — keeping guard decoupled from `@astram/engine` +
|
|
153
|
+
// the app.
|
|
154
|
+
var cross_tenant_grant_writer_js_1 = require("./authz/cross-tenant-grant-writer.js");
|
|
155
|
+
Object.defineProperty(exports, "CrossTenantGrantWriter", { enumerable: true, get: function () { return cross_tenant_grant_writer_js_1.CrossTenantGrantWriter; } });
|
|
156
|
+
Object.defineProperty(exports, "SHIELD_CROSS_TENANT_GRANT_WRITER", { enumerable: true, get: function () { return cross_tenant_grant_writer_js_1.SHIELD_CROSS_TENANT_GRANT_WRITER; } });
|
|
157
|
+
Object.defineProperty(exports, "GrantNotPermittedError", { enumerable: true, get: function () { return cross_tenant_grant_writer_js_1.GrantNotPermittedError; } });
|
|
158
|
+
Object.defineProperty(exports, "InvalidGrantError", { enumerable: true, get: function () { return cross_tenant_grant_writer_js_1.InvalidGrantError; } });
|
|
159
|
+
Object.defineProperty(exports, "GrantStoreUnavailableError", { enumerable: true, get: function () { return cross_tenant_grant_writer_js_1.GrantStoreUnavailableError; } });
|
|
160
|
+
// The DELEGATION / trusted-operation authority adapter (ADR-0008 / Phase 4): the concrete
|
|
161
|
+
// `OperationAuthorityPort` over a DECLARED operation manifest (no DB — declared metadata). Answers
|
|
162
|
+
// `resolveDelegatedAuthority` — a scoped, non-wildcard authority for a trusted operation's step,
|
|
163
|
+
// or undefined (pass-through, the common case). A malformed / wildcard declared entry is dropped
|
|
164
|
+
// (fail-closed ⇒ undefined). An EMPTY manifest ⇒ every lookup undefined = pass-through. Injected
|
|
165
|
+
// into core's wired decision authority by the consumer's authz wiring.
|
|
166
|
+
var manifest_operation_authority_adapter_js_1 = require("./authz/manifest-operation-authority-adapter.js");
|
|
167
|
+
Object.defineProperty(exports, "ManifestOperationAuthorityAdapter", { enumerable: true, get: function () { return manifest_operation_authority_adapter_js_1.ManifestOperationAuthorityAdapter; } });
|
|
168
|
+
Object.defineProperty(exports, "SHIELD_OPERATION_AUTHORITY_PORT", { enumerable: true, get: function () { return manifest_operation_authority_adapter_js_1.SHIELD_OPERATION_AUTHORITY_PORT; } });
|
|
169
|
+
// The framework-owned record-tier WIRING (design §9, Phase 5): constructs the four
|
|
170
|
+
// record-tier adapters over a supplied pool + manifest and returns the fully-wired core
|
|
171
|
+
// DecisionAuthority. `ShieldModule.forRoot({ recordAuthorization })` uses this internally
|
|
172
|
+
// (the preferred path — the app never touches the adapters). Exported so a consumer's
|
|
173
|
+
// TESTS can build the same wired authority directly from the app-owned inputs WITHOUT
|
|
174
|
+
// re-implementing the adapter construction (the app still cannot substitute a record
|
|
175
|
+
// adapter — it supplies only `RecordAuthorizationInputs`, which is re-exported from the
|
|
176
|
+
// ShieldModule seam above). NOTE: this value-imports `@astram/core` + the adapters;
|
|
177
|
+
// `ShieldModule` itself does NOT import it statically (it lazy-loads it) to keep the
|
|
178
|
+
// enforcement-only path core-free.
|
|
179
|
+
var wire_record_authorization_js_1 = require("./authz/wire-record-authorization.js");
|
|
180
|
+
Object.defineProperty(exports, "buildRecordAuthorization", { enumerable: true, get: function () { return wire_record_authorization_js_1.buildRecordAuthorization; } });
|
|
71
181
|
// Boot infrastructure (ADR-0018 connection-pool budget assertion). `BootModule`
|
|
72
182
|
// itself is NOT exported — it is composed internally by `ShieldModule.forRoot()`.
|
|
73
183
|
var boot_sequence_js_1 = require("./boot/boot-sequence.js");
|
|
@@ -86,3 +196,90 @@ Object.defineProperty(exports, "loadPoolBudget", { enumerable: true, get: functi
|
|
|
86
196
|
Object.defineProperty(exports, "evaluatePoolBudget", { enumerable: true, get: function () { return app_config_js_1.evaluatePoolBudget; } });
|
|
87
197
|
Object.defineProperty(exports, "DEFAULT_POOL_BUDGET", { enumerable: true, get: function () { return app_config_js_1.DEFAULT_POOL_BUDGET; } });
|
|
88
198
|
Object.defineProperty(exports, "SCHEMA_SVC_POOL_HARD_CAP", { enumerable: true, get: function () { return app_config_js_1.SCHEMA_SVC_POOL_HARD_CAP; } });
|
|
199
|
+
// Phase 0b Auth-surface config (additive): the DB/Redis/lifetime loaders + the
|
|
200
|
+
// required-secret resolver/gate + the new config shapes.
|
|
201
|
+
Object.defineProperty(exports, "loadDbConfig", { enumerable: true, get: function () { return app_config_js_1.loadDbConfig; } });
|
|
202
|
+
Object.defineProperty(exports, "loadRedisConfig", { enumerable: true, get: function () { return app_config_js_1.loadRedisConfig; } });
|
|
203
|
+
Object.defineProperty(exports, "loadSessionLifetimes", { enumerable: true, get: function () { return app_config_js_1.loadSessionLifetimes; } });
|
|
204
|
+
Object.defineProperty(exports, "loadRefreshHmacKey", { enumerable: true, get: function () { return app_config_js_1.loadRefreshHmacKey; } });
|
|
205
|
+
Object.defineProperty(exports, "assertRefreshHmacKey", { enumerable: true, get: function () { return app_config_js_1.assertRefreshHmacKey; } });
|
|
206
|
+
Object.defineProperty(exports, "DEFAULT_DB_CONFIG", { enumerable: true, get: function () { return app_config_js_1.DEFAULT_DB_CONFIG; } });
|
|
207
|
+
Object.defineProperty(exports, "DEFAULT_REDIS_URL", { enumerable: true, get: function () { return app_config_js_1.DEFAULT_REDIS_URL; } });
|
|
208
|
+
// ---------------------------------------------------------------------------
|
|
209
|
+
// Phase 0b Auth surface (framework-owned login → session, spec §2/§3/§4).
|
|
210
|
+
//
|
|
211
|
+
// PRELUDE CONTRACT (this commit): the frozen DI tokens, endpoint DTO shapes, the
|
|
212
|
+
// credential-resolver skeleton (Team A fills), and the composition module
|
|
213
|
+
// skeletons (Team B fills). Team C's `/auth/*` controllers consume
|
|
214
|
+
// SHIELD_AUTHENTICATOR / SHIELD_SESSION_AUTHORITY. All ADDITIVE — the enforcement
|
|
215
|
+
// path is untouched; ShieldModule wiring is deferred to the integration owner.
|
|
216
|
+
// ---------------------------------------------------------------------------
|
|
217
|
+
// Shared DI provider tokens (the seams the teams bind/consume — see tokens.ts for
|
|
218
|
+
// who provides/consumes each).
|
|
219
|
+
var tokens_js_2 = require("./auth/tokens.js");
|
|
220
|
+
Object.defineProperty(exports, "SHIELD_DB_POOL", { enumerable: true, get: function () { return tokens_js_2.SHIELD_DB_POOL; } });
|
|
221
|
+
Object.defineProperty(exports, "SHIELD_REDIS", { enumerable: true, get: function () { return tokens_js_2.SHIELD_REDIS; } });
|
|
222
|
+
Object.defineProperty(exports, "SHIELD_CREDENTIAL_RESOLVER", { enumerable: true, get: function () { return tokens_js_2.SHIELD_CREDENTIAL_RESOLVER; } });
|
|
223
|
+
Object.defineProperty(exports, "SHIELD_PROFILE_RESOLVER", { enumerable: true, get: function () { return tokens_js_2.SHIELD_PROFILE_RESOLVER; } });
|
|
224
|
+
Object.defineProperty(exports, "SHIELD_AUTHENTICATOR", { enumerable: true, get: function () { return tokens_js_2.SHIELD_AUTHENTICATOR; } });
|
|
225
|
+
Object.defineProperty(exports, "SHIELD_SESSION_AUTHORITY", { enumerable: true, get: function () { return tokens_js_2.SHIELD_SESSION_AUTHORITY; } });
|
|
226
|
+
// Account & credential-surface seams (forgot/reset, change-password, MFA
|
|
227
|
+
// enrollment, profile edit) — all OPTIONAL, consumer-plugged through
|
|
228
|
+
// ShieldModule.forRoot. See tokens.ts for who provides/consumes each.
|
|
229
|
+
Object.defineProperty(exports, "SHIELD_CREDENTIAL_WRITER", { enumerable: true, get: function () { return tokens_js_2.SHIELD_CREDENTIAL_WRITER; } });
|
|
230
|
+
Object.defineProperty(exports, "SHIELD_RESET_TOKEN_STORE", { enumerable: true, get: function () { return tokens_js_2.SHIELD_RESET_TOKEN_STORE; } });
|
|
231
|
+
Object.defineProperty(exports, "SHIELD_EMAIL_SENDER", { enumerable: true, get: function () { return tokens_js_2.SHIELD_EMAIL_SENDER; } });
|
|
232
|
+
Object.defineProperty(exports, "SHIELD_RECOVERY_CODE_STORE", { enumerable: true, get: function () { return tokens_js_2.SHIELD_RECOVERY_CODE_STORE; } });
|
|
233
|
+
Object.defineProperty(exports, "SHIELD_PROFILE_WRITER", { enumerable: true, get: function () { return tokens_js_2.SHIELD_PROFILE_WRITER; } });
|
|
234
|
+
Object.defineProperty(exports, "SHIELD_SESSION_SWEEPER", { enumerable: true, get: function () { return tokens_js_2.SHIELD_SESSION_SWEEPER; } });
|
|
235
|
+
// The auth-surface audit sink seam (the first auth audit event — recovery login).
|
|
236
|
+
Object.defineProperty(exports, "SHIELD_AUDIT_SINK", { enumerable: true, get: function () { return tokens_js_2.SHIELD_AUDIT_SINK; } });
|
|
237
|
+
// The multi-device MFA store seam (multiple independent authenticator devices).
|
|
238
|
+
Object.defineProperty(exports, "SHIELD_MFA_DEVICE_STORE", { enumerable: true, get: function () { return tokens_js_2.SHIELD_MFA_DEVICE_STORE; } });
|
|
239
|
+
// The login totp-verifier OVERRIDE seam (Phase 2 — plug an OR-matching verifier).
|
|
240
|
+
Object.defineProperty(exports, "SHIELD_TOTP_VERIFIER_OVERRIDE", { enumerable: true, get: function () { return tokens_js_2.SHIELD_TOTP_VERIFIER_OVERRIDE; } });
|
|
241
|
+
// The credential-store contract (skeleton — Team A implements the SELECT).
|
|
242
|
+
var mariadb_credential_resolver_js_1 = require("./authentication/mariadb-credential-resolver.js");
|
|
243
|
+
Object.defineProperty(exports, "MariaDbCredentialResolver", { enumerable: true, get: function () { return mariadb_credential_resolver_js_1.MariaDbCredentialResolver; } });
|
|
244
|
+
// The composition module skeletons (Team B fills the factory bodies; the
|
|
245
|
+
// integration owner imports AuthModule into ShieldModule — see auth.module.ts /
|
|
246
|
+
// DONE.md).
|
|
247
|
+
var persistence_module_js_1 = require("./auth/persistence.module.js");
|
|
248
|
+
Object.defineProperty(exports, "PersistenceModule", { enumerable: true, get: function () { return persistence_module_js_1.PersistenceModule; } });
|
|
249
|
+
var auth_module_js_1 = require("./auth/auth.module.js");
|
|
250
|
+
Object.defineProperty(exports, "AuthModule", { enumerable: true, get: function () { return auth_module_js_1.AuthModule; } });
|
|
251
|
+
// Phase-2 verifier-seam helpers. `makeDefaultTotpVerifier()` builds the framework's
|
|
252
|
+
// DEFAULT single-secret TOTP FactorVerifier (loading the ESM-only core factory lazily,
|
|
253
|
+
// the CJS↔ESM invariant) so a CONSUMER can WRAP it (e.g. an OR-matching multi-device
|
|
254
|
+
// verifier delegates to it per device secret) WITHOUT importing `@astram/core`
|
|
255
|
+
// directly. `resolveTotpVerifier(override, default)` is the pure `override ?? default`
|
|
256
|
+
// decision the authenticator composition uses (exported for unit testing the seam).
|
|
257
|
+
// `hmacSha1` is the node:crypto HMAC-SHA1 primitive the core TOTP verifier needs.
|
|
258
|
+
var auth_module_js_2 = require("./auth/auth.module.js");
|
|
259
|
+
Object.defineProperty(exports, "makeDefaultTotpVerifier", { enumerable: true, get: function () { return auth_module_js_2.makeDefaultTotpVerifier; } });
|
|
260
|
+
Object.defineProperty(exports, "resolveTotpVerifier", { enumerable: true, get: function () { return auth_module_js_2.resolveTotpVerifier; } });
|
|
261
|
+
Object.defineProperty(exports, "hmacSha1", { enumerable: true, get: function () { return auth_module_js_2.hmacSha1; } });
|
|
262
|
+
var tokens_js_3 = require("./auth/tokens.js");
|
|
263
|
+
Object.defineProperty(exports, "SHIELD_SESSION_FACTS_PROJECTOR", { enumerable: true, get: function () { return tokens_js_3.SHIELD_SESSION_FACTS_PROJECTOR; } });
|
|
264
|
+
// The framework-owned `/auth/*` HTTP controller (Team C) + its pending-MFA store.
|
|
265
|
+
// The controller CONSUMES SHIELD_AUTHENTICATOR / SHIELD_SESSION_AUTHORITY and the
|
|
266
|
+
// PendingMfaStore. It is EXPORTED so AuthModule (Team B) / the integration owner
|
|
267
|
+
// registers it in the module's `controllers` and provides `PendingMfaStore` — this
|
|
268
|
+
// file (Team C) does NOT edit auth.module.ts. See auth.controller.ts header.
|
|
269
|
+
var auth_controller_js_1 = require("./auth/auth.controller.js");
|
|
270
|
+
Object.defineProperty(exports, "AuthController", { enumerable: true, get: function () { return auth_controller_js_1.AuthController; } });
|
|
271
|
+
var pending_mfa_store_js_1 = require("./auth/pending-mfa-store.js");
|
|
272
|
+
Object.defineProperty(exports, "PendingMfaStore", { enumerable: true, get: function () { return pending_mfa_store_js_1.PendingMfaStore; } });
|
|
273
|
+
// The pure TOTP-enrollment helpers (Phase 4 MFA). Re-exported for consumers/tests
|
|
274
|
+
// that need them; the multi-device MFA routes (Phase 3) reuse them to mint a device
|
|
275
|
+
// secret + provisioning URI + recovery codes. (The old in-memory
|
|
276
|
+
// PendingEnrollmentStore is gone — a pending device is now a row in the MfaDeviceStore.)
|
|
277
|
+
var totp_enrollment_js_1 = require("./auth/totp-enrollment.js");
|
|
278
|
+
Object.defineProperty(exports, "generateTotpSecret", { enumerable: true, get: function () { return totp_enrollment_js_1.generateTotpSecret; } });
|
|
279
|
+
Object.defineProperty(exports, "buildOtpauthUri", { enumerable: true, get: function () { return totp_enrollment_js_1.buildOtpauthUri; } });
|
|
280
|
+
Object.defineProperty(exports, "generateRecoveryCodes", { enumerable: true, get: function () { return totp_enrollment_js_1.generateRecoveryCodes; } });
|
|
281
|
+
// The framework-owned `/account/*` self-scoped HTTP controller — the authenticated
|
|
282
|
+
// user acting on THEIR OWN credential/profile (change-password today; MFA/profile
|
|
283
|
+
// later). Registered by AuthModule alongside AuthController under `auth: true`.
|
|
284
|
+
var account_controller_js_1 = require("./auth/account.controller.js");
|
|
285
|
+
Object.defineProperty(exports, "AccountController", { enumerable: true, get: function () { return account_controller_js_1.AccountController; } });
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;GAeG;;;;AAEH,gCAAgC;AAChC,8DASmC;AARjC,gHAAA,YAAY,OAAA;AACZ,6HAAA,yBAAyB,OAAA;AAS3B,wEAAwE;AACxE,yFAMmD;AALjD,qHAAA,MAAM,OAAA;AACN,yHAAA,UA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B,mFAAmF;AACnF,kFAAkF;AAClF,gFAAgF;AAChF,sEAAiE;AAAxD,0HAAA,iBAAiB,OAAA"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Framework DI tokens that must be importable WITHOUT pulling in `ShieldModule`
|
|
3
|
+
* itself (which would create import cycles: `ShieldModule` → `EnforcementModule` →
|
|
4
|
+
* the guard → back to a token declared in `ShieldModule`). Declaring the shared
|
|
5
|
+
* tokens here lets both `shield.module.ts` and the enforcement guard depend on them
|
|
6
|
+
* with no cycle. `shield.module.ts` re-exports these for the public barrel.
|
|
7
|
+
*/
|
|
8
|
+
/**
|
|
9
|
+
* The Core decision authority (`@astram/core`'s `DecisionAuthority`) — the single
|
|
10
|
+
* ADR-0001 decision entry both the global enforcement guard and the engine's
|
|
11
|
+
* permission-gate stage consult. Provided app-wide by `ShieldModule.forRoot()`
|
|
12
|
+
* (default: the deny-by-default stub; overridable via the `decisionAuthority` option).
|
|
13
|
+
*/
|
|
14
|
+
export declare const SHIELD_DECISION_AUTHORITY: unique symbol;
|
|
15
|
+
//# sourceMappingURL=shield-tokens.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"shield-tokens.d.ts","sourceRoot":"","sources":["../../src/module/shield-tokens.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH;;;;;GAKG;AACH,eAAO,MAAM,yBAAyB,eAAsC,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Framework DI tokens that must be importable WITHOUT pulling in `ShieldModule`
|
|
4
|
+
* itself (which would create import cycles: `ShieldModule` → `EnforcementModule` →
|
|
5
|
+
* the guard → back to a token declared in `ShieldModule`). Declaring the shared
|
|
6
|
+
* tokens here lets both `shield.module.ts` and the enforcement guard depend on them
|
|
7
|
+
* with no cycle. `shield.module.ts` re-exports these for the public barrel.
|
|
8
|
+
*/
|
|
9
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
+
exports.SHIELD_DECISION_AUTHORITY = void 0;
|
|
11
|
+
/**
|
|
12
|
+
* The Core decision authority (`@astram/core`'s `DecisionAuthority`) — the single
|
|
13
|
+
* ADR-0001 decision entry both the global enforcement guard and the engine's
|
|
14
|
+
* permission-gate stage consult. Provided app-wide by `ShieldModule.forRoot()`
|
|
15
|
+
* (default: the deny-by-default stub; overridable via the `decisionAuthority` option).
|
|
16
|
+
*/
|
|
17
|
+
exports.SHIELD_DECISION_AUTHORITY = Symbol('SHIELD_DECISION_AUTHORITY');
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"shield-tokens.js","sourceRoot":"","sources":["../../src/module/shield-tokens.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG;;;AAEH;;;;;GAKG;AACU,QAAA,yBAAyB,GAAG,MAAM,CAAC,2BAA2B,CAAC,CAAC"}
|