@astram/guard 0.27.0 → 0.28.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/auth.module.d.ts +4 -0
- package/dist/auth/auth.module.d.ts.map +1 -1
- package/dist/auth/auth.module.js +20 -1
- package/dist/auth/persistence.module.d.ts +4 -0
- package/dist/auth/persistence.module.d.ts.map +1 -1
- package/dist/auth/persistence.module.js +5 -1
- package/dist/auth/tokens.d.ts +8 -0
- package/dist/auth/tokens.d.ts.map +1 -1
- package/dist/auth/tokens.js +10 -2
- package/dist/boot/boot.module.d.ts +4 -0
- package/dist/boot/boot.module.d.ts.map +1 -1
- package/dist/boot/boot.module.js +3 -0
- package/dist/config/config.module.d.ts +4 -0
- package/dist/config/config.module.d.ts.map +1 -1
- package/dist/config/config.module.js +3 -0
- package/dist/enforcement/enforcement.module.d.ts +4 -0
- package/dist/enforcement/enforcement.module.d.ts.map +1 -1
- package/dist/enforcement/enforcement.module.js +3 -0
- package/dist/enforcement/global-enforcement.guard.d.ts +12 -0
- package/dist/enforcement/global-enforcement.guard.d.ts.map +1 -1
- package/dist/enforcement/global-enforcement.guard.js +42 -0
- package/dist/identity/identity-actions.d.ts +16 -0
- package/dist/identity/identity-actions.d.ts.map +1 -1
- package/dist/identity/identity-actions.js +15 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +7 -5
- package/dist/internal.d.ts +14 -0
- package/dist/internal.d.ts.map +1 -1
- package/dist/internal.js +19 -1
- package/dist/module/shield.module.d.ts +9 -0
- package/dist/module/shield.module.d.ts.map +1 -1
- package/dist/module/shield.module.js +11 -1
- package/dist/session/session-liveness.d.ts +41 -0
- package/dist/session/session-liveness.d.ts.map +1 -0
- package/dist/session/session-liveness.js +63 -0
- package/package.json +5 -5
|
@@ -80,6 +80,8 @@ import type { ProfileWriter } from './ports/profile-writer.js';
|
|
|
80
80
|
import type { SessionSweeper } from './ports/session-sweeper.js';
|
|
81
81
|
import type { MfaDeviceStore } from './ports/mfa-device-store.js';
|
|
82
82
|
import type { AuditSink } from './ports/audit-sink.js';
|
|
83
|
+
/** Framework-module marker (G-036 M1, agent-read-capabilities SPEC §5 A); see `ShieldModule`. */
|
|
84
|
+
declare const FRAMEWORK_MODULE: unique symbol;
|
|
83
85
|
/**
|
|
84
86
|
* The injected HMAC-SHA1 primitive the core TOTP verifier needs (Core is zero-dep
|
|
85
87
|
* + node-type-free, so it cannot import `node:crypto`). Guard owns node:crypto and
|
|
@@ -323,6 +325,7 @@ export declare function makeScopeSubtreeResolverProvider(override?: ScopeSubtree
|
|
|
323
325
|
* DONE.md for the exact gating the integration owner applies.
|
|
324
326
|
*/
|
|
325
327
|
export declare class AuthModule {
|
|
328
|
+
static readonly [FRAMEWORK_MODULE] = true;
|
|
326
329
|
/**
|
|
327
330
|
* Compose the auth surface. `options.credentialResolver`, when supplied, REPLACES
|
|
328
331
|
* the default MariaDb store with the consumer's own (a value provider under
|
|
@@ -331,4 +334,5 @@ export declare class AuthModule {
|
|
|
331
334
|
*/
|
|
332
335
|
static forRoot(options?: AuthModuleOptions): DynamicModule;
|
|
333
336
|
}
|
|
337
|
+
export {};
|
|
334
338
|
//# sourceMappingURL=auth.module.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"auth.module.d.ts","sourceRoot":"","sources":["../../src/auth/auth.module.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+DG;AAEH,OAAO,EAGL,KAAK,aAAa,EAElB,KAAK,QAAQ,EACd,MAAM,gBAAgB,CAAC;AAaxB,OAAO,KAAK,EAGV,kBAAkB,EAOlB,QAAQ,EACR,cAAc,EAKf,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"auth.module.d.ts","sourceRoot":"","sources":["../../src/auth/auth.module.ts"],"names":[],"mappings":"AAAA;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C,QAAQ,CAAC,EAAE,SAAS,GAAG,QAAQ,CAQpE;AAUD;;;;;;GAMG;AACH,wBAAgB,gCAAgC,CAAC,QAAQ,CAAC,EAAE,oBAAoB,GAAG,QAAQ,CAS1F;AAqCD;;;;;;GAMG;AACH,qBACa,UAAU;IACrB,MAAM,CAAC,QAAQ,CAAC,CAAC,gBAAgB,CAAC,QAAQ;IAE1C;;;;;OAKG;IACH,MAAM,CAAC,OAAO,CAAC,OAAO,GAAE,iBAAsB,GAAG,aAAa;CAmO/D"}
|
package/dist/auth/auth.module.js
CHANGED
|
@@ -144,6 +144,7 @@ const confirm_email_controller_js_1 = require("./confirm-email.controller.js");
|
|
|
144
144
|
const pending_mfa_store_js_1 = require("./pending-mfa-store.js");
|
|
145
145
|
const mfa_step_up_js_1 = require("./mfa-step-up.js");
|
|
146
146
|
const tokens_js_1 = require("./tokens.js");
|
|
147
|
+
const session_liveness_js_1 = require("../session/session-liveness.js");
|
|
147
148
|
const mariadb_notification_store_js_1 = require("../notifications/mariadb-notification-store.js");
|
|
148
149
|
const notification_service_js_1 = require("../notifications/notification.service.js");
|
|
149
150
|
const notification_retention_job_js_1 = require("../notifications/notification-retention.job.js");
|
|
@@ -167,6 +168,8 @@ const tokens_js_2 = require("../request-auth/tokens.js");
|
|
|
167
168
|
const mariadb_api_key_store_js_1 = require("../authentication/mariadb-api-key-store.js");
|
|
168
169
|
const core_1 = require("@astram/core");
|
|
169
170
|
const session_token_binder_js_1 = require("../request-auth/session-token-binder.js");
|
|
171
|
+
/** Framework-module marker (G-036 M1, agent-read-capabilities SPEC §5 A); see `ShieldModule`. */
|
|
172
|
+
const FRAMEWORK_MODULE = Symbol.for('astram.framework-module');
|
|
170
173
|
/**
|
|
171
174
|
* The injected HMAC-SHA1 primitive the core TOTP verifier needs (Core is zero-dep
|
|
172
175
|
* + node-type-free, so it cannot import `node:crypto`). Guard owns node:crypto and
|
|
@@ -426,6 +429,16 @@ const sessionTokenBinderProvider = {
|
|
|
426
429
|
}),
|
|
427
430
|
inject: [tokens_js_1.SHIELD_REDIS, index_js_1.SHIELD_SESSION_LIFETIMES],
|
|
428
431
|
};
|
|
432
|
+
/**
|
|
433
|
+
* Strict session liveness (G-036 M1, agent-read-capabilities SPEC §5): one Redis GET of the
|
|
434
|
+
* session-claims entry, `'unavailable'` on any error. Only `@astram/agent` reads it, inside its own
|
|
435
|
+
* handler; the enforcement guard never does (no read added to the per-request path).
|
|
436
|
+
*/
|
|
437
|
+
const sessionLivenessProvider = {
|
|
438
|
+
provide: tokens_js_1.SHIELD_SESSION_LIVENESS,
|
|
439
|
+
useFactory: (redis) => new session_liveness_js_1.RedisSessionLiveness(redis),
|
|
440
|
+
inject: [tokens_js_1.SHIELD_REDIS],
|
|
441
|
+
};
|
|
429
442
|
/**
|
|
430
443
|
* The pending-MFA challenge store (M6): Redis-backed, so `/auth/mfa` completes on any
|
|
431
444
|
* instance, and it holds the password step's RESULT (principal + hint + credential
|
|
@@ -1106,7 +1119,9 @@ function makeResetLinkBaseUrlProvider(emailChangeLinkBaseUrl, mailDisabled) {
|
|
|
1106
1119
|
* an auth-enabled `ShieldModule.forRoot({ auth: true })` — see the file header +
|
|
1107
1120
|
* DONE.md for the exact gating the integration owner applies.
|
|
1108
1121
|
*/
|
|
1109
|
-
let AuthModule =
|
|
1122
|
+
let AuthModule = class AuthModule {
|
|
1123
|
+
static { AuthModule_1 = this; }
|
|
1124
|
+
static [FRAMEWORK_MODULE] = true;
|
|
1110
1125
|
/**
|
|
1111
1126
|
* Compose the auth surface. `options.credentialResolver`, when supplied, REPLACES
|
|
1112
1127
|
* the default MariaDb store with the consumer's own (a value provider under
|
|
@@ -1245,6 +1260,8 @@ let AuthModule = AuthModule_1 = class AuthModule {
|
|
|
1245
1260
|
pendingMfaStoreProvider,
|
|
1246
1261
|
// The request-auth token binder (access-token → principal claims).
|
|
1247
1262
|
sessionTokenBinderProvider,
|
|
1263
|
+
// G-036 M1: strict session liveness for the agent's per-call freshness check.
|
|
1264
|
+
sessionLivenessProvider,
|
|
1248
1265
|
// The service-account API-key authenticator (ADR-0033) — `ask_…` bearer → service_account
|
|
1249
1266
|
// Principal. Provided here (with the guard) so the APP_GUARD sees it; exported below.
|
|
1250
1267
|
serviceAuthenticatorProvider,
|
|
@@ -1326,6 +1343,8 @@ let AuthModule = AuthModule_1 = class AuthModule {
|
|
|
1326
1343
|
tokens_js_1.SHIELD_ACCOUNT_UNLOCKER,
|
|
1327
1344
|
// G-027 step 2: app code (and identity in step 3) posts notices through it.
|
|
1328
1345
|
tokens_js_1.SHIELD_NOTIFICATIONS,
|
|
1346
|
+
// G-036 M1: `@astram/agent` injects it (through @astram/guard/internal).
|
|
1347
|
+
tokens_js_1.SHIELD_SESSION_LIVENESS,
|
|
1329
1348
|
],
|
|
1330
1349
|
};
|
|
1331
1350
|
}
|
|
@@ -36,12 +36,16 @@
|
|
|
36
36
|
* ADR-0003: the real `mariadb`/`ioredis` live in guard (Core stays zero-dep).
|
|
37
37
|
*/
|
|
38
38
|
import { type DynamicModule } from '@nestjs/common';
|
|
39
|
+
/** Framework-module marker (G-036 M1, agent-read-capabilities SPEC §5 A); see `ShieldModule`. */
|
|
40
|
+
declare const FRAMEWORK_MODULE: unique symbol;
|
|
39
41
|
/**
|
|
40
42
|
* The persistence module. `forRoot()` returns the two connection providers (both
|
|
41
43
|
* exported so AuthModule can inject them), the shutdown holder, the audit sealer and its
|
|
42
44
|
* own pool (not exported). Opt-in: only imported when auth is wired.
|
|
43
45
|
*/
|
|
44
46
|
export declare class PersistenceModule {
|
|
47
|
+
static readonly [FRAMEWORK_MODULE] = true;
|
|
45
48
|
static forRoot(): DynamicModule;
|
|
46
49
|
}
|
|
50
|
+
export {};
|
|
47
51
|
//# sourceMappingURL=persistence.module.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"persistence.module.d.ts","sourceRoot":"","sources":["../../src/auth/persistence.module.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoCG;AAEH,OAAO,EAAU,KAAK,aAAa,EAAiB,MAAM,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"persistence.module.d.ts","sourceRoot":"","sources":["../../src/auth/persistence.module.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoCG;AAEH,OAAO,EAAU,KAAK,aAAa,EAAiB,MAAM,gBAAgB,CAAC;AAe3E,iGAAiG;AACjG,QAAA,MAAM,gBAAgB,eAAwC,CAAC;AAgE/D;;;;GAIG;AACH,qBACa,iBAAiB;IAC5B,MAAM,CAAC,QAAQ,CAAC,CAAC,gBAAgB,CAAC,QAAQ;IAE1C,MAAM,CAAC,OAAO,IAAI,aAAa;CAahC"}
|
|
@@ -52,6 +52,8 @@ const audit_sealer_service_js_1 = require("../audit/audit-sealer.service.js");
|
|
|
52
52
|
const audit_seal_config_js_1 = require("../audit/audit-seal-config.js");
|
|
53
53
|
const tokens_js_1 = require("./tokens.js");
|
|
54
54
|
const connections_js_1 = require("./connections.js");
|
|
55
|
+
/** Framework-module marker (G-036 M1, agent-read-capabilities SPEC §5 A); see `ShieldModule`. */
|
|
56
|
+
const FRAMEWORK_MODULE = Symbol.for('astram.framework-module');
|
|
55
57
|
/**
|
|
56
58
|
* The live MariaDB pool provider. Creates the ONE `shield_core` pool from config
|
|
57
59
|
* via {@link createDbPool}. `inject: [APP_CONFIG]` so the factory sees the resolved
|
|
@@ -112,7 +114,9 @@ const auditSealerProvider = {
|
|
|
112
114
|
* exported so AuthModule can inject them), the shutdown holder, the audit sealer and its
|
|
113
115
|
* own pool (not exported). Opt-in: only imported when auth is wired.
|
|
114
116
|
*/
|
|
115
|
-
let PersistenceModule =
|
|
117
|
+
let PersistenceModule = class PersistenceModule {
|
|
118
|
+
static { PersistenceModule_1 = this; }
|
|
119
|
+
static [FRAMEWORK_MODULE] = true;
|
|
116
120
|
static forRoot() {
|
|
117
121
|
return {
|
|
118
122
|
module: PersistenceModule_1,
|
package/dist/auth/tokens.d.ts
CHANGED
|
@@ -412,6 +412,14 @@ export declare const SHIELD_PERMISSION_VERSION_CACHE: unique symbol;
|
|
|
412
412
|
* the rebuild is refused (401) and recovery logins cannot be marked (they fail closed).
|
|
413
413
|
*/
|
|
414
414
|
export declare const SHIELD_SESSION_RESTRICTIONS: unique symbol;
|
|
415
|
+
/**
|
|
416
|
+
* Strict session liveness (G-036 M1, agent-read-capabilities SPEC §5 guard section) — a
|
|
417
|
+
* {@link import('../session/session-liveness.js').SessionLiveness} over {@link SHIELD_REDIS}: one
|
|
418
|
+
* `GET shield:sessclaims:<sessionId>`, `'unavailable'` on any error (never `null`). Provided and
|
|
419
|
+
* exported by `AuthModule` (`auth: true`); on `@astram/guard/internal` for `@astram/agent`'s
|
|
420
|
+
* per-call freshness check. Never used on the guard's per-request path.
|
|
421
|
+
*/
|
|
422
|
+
export declare const SHIELD_SESSION_LIVENESS: unique symbol;
|
|
415
423
|
/**
|
|
416
424
|
* The validated `signInWith` option (auth capabilities R1.8; `readonly SignInMethod[]`, default
|
|
417
425
|
* `['email']`). Consumed by the default credential resolver (and by login-options).
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tokens.d.ts","sourceRoot":"","sources":["../../src/auth/tokens.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAEH,OAAO,EAAE,sBAAsB,EAAE,MAAM,+CAA+C,CAAC;AAEvF;;;;;;GAMG;AACH,eAAO,MAAM,cAAc,eAA2B,CAAC;AAEvD;;;;GAIG;AACH,eAAO,MAAM,wBAAwB,eAAqC,CAAC;AAE3E;;;;GAIG;AACH,eAAO,MAAM,YAAY,eAAyB,CAAC;AAEnD;;;;;;GAMG;AACH,eAAO,MAAM,0BAA0B,eAAuC,CAAC;AAE/E;;;;;;;GAOG;AACH,eAAO,MAAM,uBAAuB,eAAoC,CAAC;AAEzE;;;;;GAKG;AACH,eAAO,MAAM,o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G;AACH,eAAO,MAAM,oBAAoB,eAAiC,CAAC;AAEnE;;;;GAIG;AACH,eAAO,MAAM,yBAAyB,eAAsC,CAAC;AAC7E,eAAO,MAAM,uBAAuB,eAAoC,CAAC;AACzE,eAAO,MAAM,mBAAmB,eAAgC,CAAC"}
|
package/dist/auth/tokens.js
CHANGED
|
@@ -23,8 +23,8 @@
|
|
|
23
23
|
* ADR-0003: no framework/DB/crypto imports here — just Symbols (+ one re-export).
|
|
24
24
|
*/
|
|
25
25
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
-
exports.
|
|
27
|
-
exports.SHIELD_CAPTCHA_GATE = exports.SHIELD_CAPTCHA_VERIFIER = exports.SHIELD_NOTIFICATION_STORE = exports.SHIELD_NOTIFICATIONS = exports.SHIELD_CAPTCHA_CONFIG = exports.SHIELD_MFA_POLICY_FEATURE = exports.SHIELD_ACCOUNT_UNLOCKER = void 0;
|
|
26
|
+
exports.SHIELD_MFA_REQUIREMENT = exports.SHIELD_MFA_REQUIREMENT_SOURCE = exports.SHIELD_SIGN_IN_WITH = exports.SHIELD_SESSION_LIVENESS = exports.SHIELD_SESSION_RESTRICTIONS = exports.SHIELD_PERMISSION_VERSION_CACHE = exports.SHIELD_PERMISSION_FACTS = exports.SHIELD_RESET_LIMITER = exports.SHIELD_FORGOT_HINT_LIMITER = exports.SHIELD_FORGOT_LIMITER = exports.SHIELD_LOGIN_TOTP_VERIFIER = exports.SHIELD_MFA_STEP_UP = exports.SHIELD_MFA_LIMITER = exports.SHIELD_RECOVERY_LIMITER = exports.SHIELD_LOGIN_IP_LIMITER = exports.SHIELD_LOGIN_LIMITER = exports.SHIELD_MEMBERSHIP_CHECKER = exports.SHIELD_SCOPE_SUBTREE_RESOLVER = exports.SHIELD_SESSION_FACTS_PROJECTOR = exports.SHIELD_ROOT_IDS = exports.SHIELD_TOTP_VERIFIER_OVERRIDE = exports.SHIELD_TOTP_VERIFIER = exports.SHIELD_RESET_LINK_BASE_URL = exports.SHIELD_SESSION_SWEEPER = exports.SHIELD_MFA_DEVICE_STORE = exports.SHIELD_DEFAULT_SCOPE_SUBTREE_RESOLVER = exports.SHIELD_DEFAULT_AUTH_AUDIT_SINK = exports.SHIELD_AUDIT_SINK = exports.SHIELD_PROFILE_WRITER = exports.SHIELD_RECOVERY_CODE_STORE = exports.SHIELD_EMAIL_DELIVERY = exports.SHIELD_ATTEMPT_LIMITER_FACTORY = exports.SHIELD_MESSAGE_DISPATCHER = exports.SHIELD_EMAIL_SENDER = exports.SHIELD_CONFIRM_EMAIL_LIMITER = exports.SHIELD_EMAIL_CHANGE_LIMITER = exports.SHIELD_EMAIL_CHANGE_LINK_BASE_URL = exports.SHIELD_EMAIL_ADDRESS_CHANGER = exports.SHIELD_EMAIL_CHANGE_TOKEN_STORE = exports.SHIELD_RESET_TOKEN_STORE = exports.SHIELD_CREDENTIAL_WRITER = exports.SHIELD_RECENT_ROTATION_STORE = exports.SHIELD_SESSION_AUTHORITY = exports.SHIELD_AUTHENTICATOR = exports.SHIELD_PROFILE_RESOLVER = exports.SHIELD_CREDENTIAL_RESOLVER = exports.SHIELD_REDIS = exports.SHIELD_AUDIT_SEALER_POOL = exports.SHIELD_DB_POOL = exports.SHIELD_PASSWORD_HASHER = void 0;
|
|
27
|
+
exports.SHIELD_CAPTCHA_GATE = exports.SHIELD_CAPTCHA_VERIFIER = exports.SHIELD_NOTIFICATION_STORE = exports.SHIELD_NOTIFICATIONS = exports.SHIELD_CAPTCHA_CONFIG = exports.SHIELD_MFA_POLICY_FEATURE = exports.SHIELD_ACCOUNT_UNLOCKER = exports.SHIELD_ADMIN_STEP_UP = void 0;
|
|
28
28
|
var argon2id_password_hasher_js_1 = require("../authentication/argon2id-password-hasher.js");
|
|
29
29
|
Object.defineProperty(exports, "SHIELD_PASSWORD_HASHER", { enumerable: true, get: function () { return argon2id_password_hasher_js_1.SHIELD_PASSWORD_HASHER; } });
|
|
30
30
|
/**
|
|
@@ -432,6 +432,14 @@ exports.SHIELD_PERMISSION_VERSION_CACHE = Symbol('SHIELD_PERMISSION_VERSION_CACH
|
|
|
432
432
|
* the rebuild is refused (401) and recovery logins cannot be marked (they fail closed).
|
|
433
433
|
*/
|
|
434
434
|
exports.SHIELD_SESSION_RESTRICTIONS = Symbol('SHIELD_SESSION_RESTRICTIONS');
|
|
435
|
+
/**
|
|
436
|
+
* Strict session liveness (G-036 M1, agent-read-capabilities SPEC §5 guard section) — a
|
|
437
|
+
* {@link import('../session/session-liveness.js').SessionLiveness} over {@link SHIELD_REDIS}: one
|
|
438
|
+
* `GET shield:sessclaims:<sessionId>`, `'unavailable'` on any error (never `null`). Provided and
|
|
439
|
+
* exported by `AuthModule` (`auth: true`); on `@astram/guard/internal` for `@astram/agent`'s
|
|
440
|
+
* per-call freshness check. Never used on the guard's per-request path.
|
|
441
|
+
*/
|
|
442
|
+
exports.SHIELD_SESSION_LIVENESS = Symbol('SHIELD_SESSION_LIVENESS');
|
|
435
443
|
/**
|
|
436
444
|
* The validated `signInWith` option (auth capabilities R1.8; `readonly SignInMethod[]`, default
|
|
437
445
|
* `['email']`). Consumed by the default credential resolver (and by login-options).
|
|
@@ -1,8 +1,12 @@
|
|
|
1
|
+
/** Framework-module marker (G-036 M1, agent-read-capabilities SPEC §5 A); see `ShieldModule`. */
|
|
2
|
+
declare const FRAMEWORK_MODULE: unique symbol;
|
|
1
3
|
/**
|
|
2
4
|
* Registers the {@link BootSequence} lifecycle hook (Scaffold).
|
|
3
5
|
* Holds the named extension point where the ADR-0018 connection-pool assertion
|
|
4
6
|
* attaches in a later layer.
|
|
5
7
|
*/
|
|
6
8
|
export declare class BootModule {
|
|
9
|
+
static readonly [FRAMEWORK_MODULE] = true;
|
|
7
10
|
}
|
|
11
|
+
export {};
|
|
8
12
|
//# sourceMappingURL=boot.module.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"boot.module.d.ts","sourceRoot":"","sources":["../../src/boot/boot.module.ts"],"names":[],"mappings":"AAGA;;;;GAIG;AACH,qBAGa,UAAU;
|
|
1
|
+
{"version":3,"file":"boot.module.d.ts","sourceRoot":"","sources":["../../src/boot/boot.module.ts"],"names":[],"mappings":"AAGA,iGAAiG;AACjG,QAAA,MAAM,gBAAgB,eAAwC,CAAC;AAE/D;;;;GAIG;AACH,qBAGa,UAAU;IACrB,MAAM,CAAC,QAAQ,CAAC,CAAC,gBAAgB,CAAC,QAAQ;CAC3C"}
|
package/dist/boot/boot.module.js
CHANGED
|
@@ -9,12 +9,15 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
9
9
|
exports.BootModule = void 0;
|
|
10
10
|
const common_1 = require("@nestjs/common");
|
|
11
11
|
const boot_sequence_js_1 = require("./boot-sequence.js");
|
|
12
|
+
/** Framework-module marker (G-036 M1, agent-read-capabilities SPEC §5 A); see `ShieldModule`. */
|
|
13
|
+
const FRAMEWORK_MODULE = Symbol.for('astram.framework-module');
|
|
12
14
|
/**
|
|
13
15
|
* Registers the {@link BootSequence} lifecycle hook (Scaffold).
|
|
14
16
|
* Holds the named extension point where the ADR-0018 connection-pool assertion
|
|
15
17
|
* attaches in a later layer.
|
|
16
18
|
*/
|
|
17
19
|
let BootModule = class BootModule {
|
|
20
|
+
static [FRAMEWORK_MODULE] = true;
|
|
18
21
|
};
|
|
19
22
|
exports.BootModule = BootModule;
|
|
20
23
|
exports.BootModule = BootModule = __decorate([
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
/** Framework-module marker (G-036 M1, agent-read-capabilities SPEC §5 A); see `ShieldModule`. */
|
|
2
|
+
declare const FRAMEWORK_MODULE: unique symbol;
|
|
1
3
|
/** DI token for the resolved {@link AppConfig}. */
|
|
2
4
|
export declare const APP_CONFIG: unique symbol;
|
|
3
5
|
/**
|
|
@@ -15,5 +17,7 @@ export declare const FRAMEWORK_SCHEMAS: unique symbol;
|
|
|
15
17
|
* A richer, validated config system replaces this in the Infrastructure layer.
|
|
16
18
|
*/
|
|
17
19
|
export declare class ConfigModule {
|
|
20
|
+
static readonly [FRAMEWORK_MODULE] = true;
|
|
18
21
|
}
|
|
22
|
+
export {};
|
|
19
23
|
//# sourceMappingURL=config.module.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.module.d.ts","sourceRoot":"","sources":["../../src/config/config.module.ts"],"names":[],"mappings":"AAIA,mDAAmD;AACnD,eAAO,MAAM,UAAU,eAAuB,CAAC;AAE/C;;;;;GAKG;AACH,eAAO,MAAM,iBAAiB,eAA8B,CAAC;AAE7D;;;;;;GAMG;AACH,qBAaa,YAAY;
|
|
1
|
+
{"version":3,"file":"config.module.d.ts","sourceRoot":"","sources":["../../src/config/config.module.ts"],"names":[],"mappings":"AAIA,iGAAiG;AACjG,QAAA,MAAM,gBAAgB,eAAwC,CAAC;AAE/D,mDAAmD;AACnD,eAAO,MAAM,UAAU,eAAuB,CAAC;AAE/C;;;;;GAKG;AACH,eAAO,MAAM,iBAAiB,eAA8B,CAAC;AAE7D;;;;;;GAMG;AACH,qBAaa,YAAY;IACvB,MAAM,CAAC,QAAQ,CAAC,CAAC,gBAAgB,CAAC,QAAQ;CAC3C"}
|
|
@@ -10,6 +10,8 @@ exports.ConfigModule = exports.FRAMEWORK_SCHEMAS = exports.APP_CONFIG = void 0;
|
|
|
10
10
|
const common_1 = require("@nestjs/common");
|
|
11
11
|
const app_config_js_1 = require("./app-config.js");
|
|
12
12
|
const boot_secrets_js_1 = require("../secrets/boot-secrets.js");
|
|
13
|
+
/** Framework-module marker (G-036 M1, agent-read-capabilities SPEC §5 A); see `ShieldModule`. */
|
|
14
|
+
const FRAMEWORK_MODULE = Symbol.for('astram.framework-module');
|
|
13
15
|
/** DI token for the resolved {@link AppConfig}. */
|
|
14
16
|
exports.APP_CONFIG = Symbol('APP_CONFIG');
|
|
15
17
|
/**
|
|
@@ -27,6 +29,7 @@ exports.FRAMEWORK_SCHEMAS = Symbol('FRAMEWORK_SCHEMAS');
|
|
|
27
29
|
* A richer, validated config system replaces this in the Infrastructure layer.
|
|
28
30
|
*/
|
|
29
31
|
let ConfigModule = class ConfigModule {
|
|
32
|
+
static [FRAMEWORK_MODULE] = true;
|
|
30
33
|
};
|
|
31
34
|
exports.ConfigModule = ConfigModule;
|
|
32
35
|
exports.ConfigModule = ConfigModule = __decorate([
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
/** Framework-module marker (G-036 M1, agent-read-capabilities SPEC §5 A); see `ShieldModule`. */
|
|
2
|
+
declare const FRAMEWORK_MODULE: unique symbol;
|
|
1
3
|
/**
|
|
2
4
|
* The SOLE definition of the global `APP_GUARD` binding (ADR-0002).
|
|
3
5
|
*
|
|
@@ -14,5 +16,7 @@
|
|
|
14
16
|
* `ShieldModule`) guarantees exactly one wiring path for the guard.
|
|
15
17
|
*/
|
|
16
18
|
export declare class EnforcementModule {
|
|
19
|
+
static readonly [FRAMEWORK_MODULE] = true;
|
|
17
20
|
}
|
|
21
|
+
export {};
|
|
18
22
|
//# sourceMappingURL=enforcement.module.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"enforcement.module.d.ts","sourceRoot":"","sources":["../../src/enforcement/enforcement.module.ts"],"names":[],"mappings":"AAKA;;;;;;;;;;;;;;GAcG;AACH,qBAgBa,iBAAiB;
|
|
1
|
+
{"version":3,"file":"enforcement.module.d.ts","sourceRoot":"","sources":["../../src/enforcement/enforcement.module.ts"],"names":[],"mappings":"AAKA,iGAAiG;AACjG,QAAA,MAAM,gBAAgB,eAAwC,CAAC;AAE/D;;;;;;;;;;;;;;GAcG;AACH,qBAgBa,iBAAiB;IAC5B,MAAM,CAAC,QAAQ,CAAC,CAAC,gBAAgB,CAAC,QAAQ;CAC3C"}
|
|
@@ -11,6 +11,8 @@ const common_1 = require("@nestjs/common");
|
|
|
11
11
|
const core_1 = require("@nestjs/core");
|
|
12
12
|
const global_enforcement_guard_js_1 = require("./global-enforcement.guard.js");
|
|
13
13
|
const engine_error_filter_js_1 = require("./engine-error.filter.js");
|
|
14
|
+
/** Framework-module marker (G-036 M1, agent-read-capabilities SPEC §5 A); see `ShieldModule`. */
|
|
15
|
+
const FRAMEWORK_MODULE = Symbol.for('astram.framework-module');
|
|
14
16
|
/**
|
|
15
17
|
* The SOLE definition of the global `APP_GUARD` binding (ADR-0002).
|
|
16
18
|
*
|
|
@@ -27,6 +29,7 @@ const engine_error_filter_js_1 = require("./engine-error.filter.js");
|
|
|
27
29
|
* `ShieldModule`) guarantees exactly one wiring path for the guard.
|
|
28
30
|
*/
|
|
29
31
|
let EnforcementModule = class EnforcementModule {
|
|
32
|
+
static [FRAMEWORK_MODULE] = true;
|
|
30
33
|
};
|
|
31
34
|
exports.EnforcementModule = EnforcementModule;
|
|
32
35
|
exports.EnforcementModule = EnforcementModule = __decorate([
|
|
@@ -5,6 +5,18 @@ import { type SessionTokenBinder } from '../request-auth/session-token-binder.js
|
|
|
5
5
|
import type { ServiceAuthenticator } from '@astram/core';
|
|
6
6
|
import type { ScopeSubtreeResolver } from '../auth/ports/scope-subtree-resolver.js';
|
|
7
7
|
import { type MfaRequirementService } from '../session/mfa-requirement-service.js';
|
|
8
|
+
/**
|
|
9
|
+
* The permission version the enforcement guard derived this request's principal under: gate 5's
|
|
10
|
+
* reload version, else the version of the cached facts it served (`reloaded ?? usableFacts`). No
|
|
11
|
+
* extra DB or Redis read: the guard records what gate 5 already told it.
|
|
12
|
+
*
|
|
13
|
+
* `undefined` (callers fail closed) when the request did not pass a classified route's request-auth
|
|
14
|
+
* path, when gate 5 reported no version (no reload and no usable cached facts, e.g. root, whose
|
|
15
|
+
* coarse gate loads no grants), or when a reload's subtree re-derive was due but failed (the
|
|
16
|
+
* principal then keeps a subtree from an older version, so no version describes it).
|
|
17
|
+
* On `@astram/guard/internal` for `@astram/agent`'s run-start snapshot check.
|
|
18
|
+
*/
|
|
19
|
+
export declare function requestFactsVersion(req: unknown): number | undefined;
|
|
8
20
|
/**
|
|
9
21
|
* Global, fail-closed enforcement guard (ADR-0002) — now with REAL request
|
|
10
22
|
* authorization for classified routes.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"global-enforcement.guard.d.ts","sourceRoot":"","sources":["../../src/enforcement/global-enforcement.guard.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,WAAW,EACX,gBAAgB,EAMjB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAOzC,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,gBAAgB,CAAC;AAK5D,OAAO,EAGL,KAAK,kBAAkB,EACxB,MAAM,yCAAyC,CAAC;AACjD,OAAO,KAAK,EAA2B,oBAAoB,EAAE,MAAM,cAAc,CAAC;AAOlF,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,yCAAyC,CAAC;AAOpF,OAAO,EAEL,KAAK,qBAAqB,EAC3B,MAAM,uCAAuC,CAAC;
|
|
1
|
+
{"version":3,"file":"global-enforcement.guard.d.ts","sourceRoot":"","sources":["../../src/enforcement/global-enforcement.guard.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,WAAW,EACX,gBAAgB,EAMjB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAOzC,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,gBAAgB,CAAC;AAK5D,OAAO,EAGL,KAAK,kBAAkB,EACxB,MAAM,yCAAyC,CAAC;AACjD,OAAO,KAAK,EAA2B,oBAAoB,EAAE,MAAM,cAAc,CAAC;AAOlF,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,yCAAyC,CAAC;AAOpF,OAAO,EAEL,KAAK,qBAAqB,EAC3B,MAAM,uCAAuC,CAAC;AAa/C;;;;;;;;;;GAUG;AACH,wBAAgB,mBAAmB,CAAC,GAAG,EAAE,OAAO,GAAG,MAAM,GAAG,SAAS,CAGpE;AAYD;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,qBACa,sBAAuB,YAAW,WAAW;IAEtD,OAAO,CAAC,QAAQ,CAAC,SAAS;IAG1B,OAAO,CAAC,QAAQ,CAAC,iBAAiB,CAAC;IAGnC,OAAO,CAAC,QAAQ,CAAC,WAAW,CAAC;IAM7B,OAAO,CAAC,QAAQ,CAAC,WAAW,CAAC;IAO7B,OAAO,CAAC,QAAQ,CAAC,oBAAoB,CAAC;IAMtC,OAAO,CAAC,QAAQ,CAAC,cAAc,CAAC;gBAzBf,SAAS,EAAE,SAAS,EAGpB,iBAAiB,CAAC,EAAE,qBAAqB,YAAA,EAGzC,WAAW,CAAC,EAAE,kBAAkB,YAAA,EAMhC,WAAW,CAAC,EAAE,oBAAoB,YAAA,EAOlC,oBAAoB,CAAC,GAAE,oBAAoB,GAAG,IAAI,aAAA,EAMlD,cAAc,CAAC,GAAE,qBAAqB,GAAG,IAAI,aAAA;IAG1D,WAAW,CAAC,OAAO,EAAE,gBAAgB,GAAG,OAAO,CAAC,OAAO,CAAC;IAuC9D,mFAAmF;YACrE,mBAAmB;IAoLjC;;;;OAIG;IACH,OAAO,CAAC,kBAAkB;IAW1B;;;;;OAKG;YACW,oBAAoB;IAuBlC;;;;;;;;;;;;;;;;OAgBG;YACW,4BAA4B;CA8C3C"}
|
|
@@ -13,6 +13,7 @@ var __param = (this && this.__param) || function (paramIndex, decorator) {
|
|
|
13
13
|
};
|
|
14
14
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
15
|
exports.GlobalEnforcementGuard = void 0;
|
|
16
|
+
exports.requestFactsVersion = requestFactsVersion;
|
|
16
17
|
const common_1 = require("@nestjs/common");
|
|
17
18
|
const core_1 = require("@nestjs/core");
|
|
18
19
|
const classification_decorator_js_1 = require("./classification.decorator.js");
|
|
@@ -27,6 +28,29 @@ const session_restriction_js_1 = require("../session/session-restriction.js");
|
|
|
27
28
|
const mfa_requirement_service_js_1 = require("../session/mfa-requirement-service.js");
|
|
28
29
|
/** A subtree re-derive that was due but could not be done (resolver error / empty / junk). */
|
|
29
30
|
const SUBTREE_REDERIVE_FAILED = Symbol('subtree-rederive-failed');
|
|
31
|
+
/**
|
|
32
|
+
* The permission version gate 5 derived each request's `req.principal` (roles and subtree) under
|
|
33
|
+
* (G-036 M1, agent-read-capabilities SPEC §5 run-loop "Manifest"). Keyed by the request object, so
|
|
34
|
+
* nothing on the request (header, body, a handler) can set or spoof it, and it goes with the request.
|
|
35
|
+
* Written only by {@link GlobalEnforcementGuard}; read only through {@link requestFactsVersion}.
|
|
36
|
+
*/
|
|
37
|
+
const REQUEST_FACTS_VERSION = new WeakMap();
|
|
38
|
+
/**
|
|
39
|
+
* The permission version the enforcement guard derived this request's principal under: gate 5's
|
|
40
|
+
* reload version, else the version of the cached facts it served (`reloaded ?? usableFacts`). No
|
|
41
|
+
* extra DB or Redis read: the guard records what gate 5 already told it.
|
|
42
|
+
*
|
|
43
|
+
* `undefined` (callers fail closed) when the request did not pass a classified route's request-auth
|
|
44
|
+
* path, when gate 5 reported no version (no reload and no usable cached facts, e.g. root, whose
|
|
45
|
+
* coarse gate loads no grants), or when a reload's subtree re-derive was due but failed (the
|
|
46
|
+
* principal then keeps a subtree from an older version, so no version describes it).
|
|
47
|
+
* On `@astram/guard/internal` for `@astram/agent`'s run-start snapshot check.
|
|
48
|
+
*/
|
|
49
|
+
function requestFactsVersion(req) {
|
|
50
|
+
if (req === null || typeof req !== 'object')
|
|
51
|
+
return undefined;
|
|
52
|
+
return REQUEST_FACTS_VERSION.get(req);
|
|
53
|
+
}
|
|
30
54
|
/**
|
|
31
55
|
* The binding's cached facts as gate 5 may use them (ADR-0035): absent, or at/past their
|
|
32
56
|
* `validUntilMs` time bound ⇒ `null` (gate 5 reloads). Never fabricated.
|
|
@@ -205,10 +229,12 @@ let GlobalEnforcementGuard = class GlobalEnforcementGuard {
|
|
|
205
229
|
mfaFailed = true;
|
|
206
230
|
}
|
|
207
231
|
}
|
|
232
|
+
let subtreeStale = false;
|
|
208
233
|
if (reloaded !== undefined && !mfaFailed) {
|
|
209
234
|
const liveRoles = (0, session_token_binder_js_1.liveRoleIds)(reloaded);
|
|
210
235
|
const current = liveRoles !== undefined ? { ...claims, roleIds: liveRoles } : claims;
|
|
211
236
|
const rederived = await this.rederiveSubtreeOnVersionMove(authHeader, current, reloaded.permissionsVersion);
|
|
237
|
+
subtreeStale = rederived === SUBTREE_REDERIVE_FAILED;
|
|
212
238
|
// A subtree re-derive that was due but FAILED (resolver error / empty) keeps the facts
|
|
213
239
|
// uncached, so the next request reloads and retries it (the Phase 1C retry guarantee).
|
|
214
240
|
if (rederived !== SUBTREE_REDERIVE_FAILED) {
|
|
@@ -223,6 +249,22 @@ let GlobalEnforcementGuard = class GlobalEnforcementGuard {
|
|
|
223
249
|
req.principal = withRoles;
|
|
224
250
|
}
|
|
225
251
|
}
|
|
252
|
+
// G-036 M1 (SPEC §5 run-loop): record the version the principal above was derived under, from
|
|
253
|
+
// what gate 5 already reported (no new read). Absent when gate 5 reported none or the subtree
|
|
254
|
+
// re-derive failed (the principal's subtree then belongs to no single version). For a ROOT
|
|
255
|
+
// principal gate 5 loads and checks no grants (core decides root by its flag and plane), so
|
|
256
|
+
// cached facts it never compared with the tenant's version say nothing (SPEC v8): absent.
|
|
257
|
+
const derivedUnder = reloaded?.permissionsVersion ??
|
|
258
|
+
(principal.isRoot ? undefined : usableFacts?.permissionsVersion);
|
|
259
|
+
if (!subtreeStale &&
|
|
260
|
+
typeof derivedUnder === 'number' &&
|
|
261
|
+
Number.isSafeInteger(derivedUnder) &&
|
|
262
|
+
derivedUnder >= 0) {
|
|
263
|
+
REQUEST_FACTS_VERSION.set(req, derivedUnder);
|
|
264
|
+
}
|
|
265
|
+
else {
|
|
266
|
+
REQUEST_FACTS_VERSION.delete(req);
|
|
267
|
+
}
|
|
226
268
|
if (mfaFailed)
|
|
227
269
|
throw new mfa_requirement_service_js_1.MfaRequirementUnavailableError();
|
|
228
270
|
// The requirement may have just changed: enforce it on THIS request (gated routes are never on
|
|
@@ -33,6 +33,22 @@ export type RecordShareAction = (typeof RECORD_SHARE_ACTIONS)[number];
|
|
|
33
33
|
*/
|
|
34
34
|
export declare const SERVICE_ACCOUNT_ACTIONS: readonly ["read", "create", "update", "delete", "manage_keys"];
|
|
35
35
|
export type ServiceAccountAction = (typeof SERVICE_ACCOUNT_ACTIONS)[number];
|
|
36
|
+
/**
|
|
37
|
+
* `agent`'s action vocabulary (G-036 M1, agent-read-capabilities SPEC §5 "A. Authority type") —
|
|
38
|
+
* NOT the CRUD verbs. `agent` is an authority-only type (`crudActions: false`): `chat` gates the
|
|
39
|
+
* assistant routes and every agent call, `propose` is reserved for proposals (M3), and
|
|
40
|
+
* `restricted_data` lets a user's run send `restricted` data to an approved model provider.
|
|
41
|
+
*/
|
|
42
|
+
export declare const AGENT_ACTIONS: readonly ["chat", "propose", "restricted_data"];
|
|
43
|
+
export type AgentAction = (typeof AGENT_ACTIONS)[number];
|
|
44
|
+
/**
|
|
45
|
+
* The per-tenant agent modes (SPEC §5 H, §11 D-3) an org bootstrap file may set
|
|
46
|
+
* (`agent.mode`). `off` is the default when no `agent_tenant_setting` row exists; `synthetic` is the
|
|
47
|
+
* only mode that enables a run (tenants holding synthetic data only). Any other stored value reads
|
|
48
|
+
* as `off`.
|
|
49
|
+
*/
|
|
50
|
+
export declare const AGENT_TENANT_MODES: readonly ["off", "synthetic"];
|
|
51
|
+
export type AgentTenantMode = (typeof AGENT_TENANT_MODES)[number];
|
|
36
52
|
/**
|
|
37
53
|
* The action vocabulary declared on a registration (ADR-0038): the CRUD verbs then the declared
|
|
38
54
|
* extras, or exactly the declared list when `crudActions === false`. Delegates to engine
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"identity-actions.d.ts","sourceRoot":"","sources":["../../src/identity/identity-actions.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AAGxD,eAAO,MAAM,UAAU,aAAa,CAAC;AACrC,eAA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6B,CAAC;AAC/D,MAAM,MAAM,iBAAiB,GAAG,CAAC,OAAO,oBAAoB,CAAC,CAAC,MAAM,CAAC,CAAC;AAEtE;;;;;;GAMG;AACH,eAAO,MAAM,uBAAuB,gEAM1B,CAAC;AACX,MAAM,MAAM,oBAAoB,GAAG,CAAC,OAAO,uBAAuB,CAAC,CAAC,MAAM,CAAC,CAAC;AAE5E;;;;;GAKG;AACH,eAAO,MAAM,aAAa,iDAAkD,CAAC;AAC7E,MAAM,MAAM,WAAW,GAAG,CAAC,OAAO,aAAa,CAAC,CAAC,MAAM,CAAC,CAAC;AAEzD;;;;;GAKG;AACH,eAAO,MAAM,kBAAkB,+BAAgC,CAAC;AAChE,MAAM,MAAM,eAAe,GAAG,CAAC,OAAO,kBAAkB,CAAC,CAAC,MAAM,CAAC,CAAC;AAElE;;;;GAIG;AACH,wBAAgB,SAAS,CAAC,GAAG,EAAE,iBAAiB,GAAG,SAAS,MAAM,EAAE,CAEnE;AAED;;;;;GAKG;AACH,wBAAgB,UAAU,CAAC,QAAQ,EAAE,MAAM,GAAG,SAAS,MAAM,EAAE,CAE9D"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.SERVICE_ACCOUNT_ACTIONS = exports.RECORD_SHARE_ACTIONS = exports.CROSS_TENANT_GRANT_ACTIONS = exports.IDENTITY_ACTIONS = exports.MODULE_KEY = void 0;
|
|
3
|
+
exports.AGENT_TENANT_MODES = exports.AGENT_ACTIONS = exports.SERVICE_ACCOUNT_ACTIONS = exports.RECORD_SHARE_ACTIONS = exports.CROSS_TENANT_GRANT_ACTIONS = exports.IDENTITY_ACTIONS = exports.MODULE_KEY = void 0;
|
|
4
4
|
exports.actionsOf = actionsOf;
|
|
5
5
|
exports.actionsFor = actionsFor;
|
|
6
6
|
const engine_1 = require("@astram/engine");
|
|
@@ -34,6 +34,20 @@ exports.SERVICE_ACCOUNT_ACTIONS = [
|
|
|
34
34
|
'delete',
|
|
35
35
|
'manage_keys',
|
|
36
36
|
];
|
|
37
|
+
/**
|
|
38
|
+
* `agent`'s action vocabulary (G-036 M1, agent-read-capabilities SPEC §5 "A. Authority type") —
|
|
39
|
+
* NOT the CRUD verbs. `agent` is an authority-only type (`crudActions: false`): `chat` gates the
|
|
40
|
+
* assistant routes and every agent call, `propose` is reserved for proposals (M3), and
|
|
41
|
+
* `restricted_data` lets a user's run send `restricted` data to an approved model provider.
|
|
42
|
+
*/
|
|
43
|
+
exports.AGENT_ACTIONS = ['chat', 'propose', 'restricted_data'];
|
|
44
|
+
/**
|
|
45
|
+
* The per-tenant agent modes (SPEC §5 H, §11 D-3) an org bootstrap file may set
|
|
46
|
+
* (`agent.mode`). `off` is the default when no `agent_tenant_setting` row exists; `synthetic` is the
|
|
47
|
+
* only mode that enables a run (tenants holding synthetic data only). Any other stored value reads
|
|
48
|
+
* as `off`.
|
|
49
|
+
*/
|
|
50
|
+
exports.AGENT_TENANT_MODES = ['off', 'synthetic'];
|
|
37
51
|
/**
|
|
38
52
|
* The action vocabulary declared on a registration (ADR-0038): the CRUD verbs then the declared
|
|
39
53
|
* extras, or exactly the declared list when `crudActions === false`. Delegates to engine
|
package/dist/index.d.ts
CHANGED
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
export { guardMigrationsDir } from './migrations-dir.js';
|
|
18
18
|
export { buildIdentityModuleRegistry, permissionTextByKey, } from './identity/module-registry.bridge.js';
|
|
19
19
|
export type { PermissionText } from '@astram/engine';
|
|
20
|
-
export { MODULE_KEY, IDENTITY_ACTIONS, CROSS_TENANT_GRANT_ACTIONS, RECORD_SHARE_ACTIONS, SERVICE_ACCOUNT_ACTIONS, actionsFor, actionsOf, } from './identity/identity-actions.js';
|
|
20
|
+
export { MODULE_KEY, IDENTITY_ACTIONS, CROSS_TENANT_GRANT_ACTIONS, RECORD_SHARE_ACTIONS, SERVICE_ACCOUNT_ACTIONS, AGENT_ACTIONS, AGENT_TENANT_MODES, actionsFor, actionsOf, type AgentAction, type AgentTenantMode, } from './identity/identity-actions.js';
|
|
21
21
|
export { ShieldModule, SHIELD_DECISION_AUTHORITY, SHIELD_RECORD_AUTHORIZATION, type ShieldModuleOptions, type ShieldModuleAsyncOptions, type RecordAuthorizationInputs, } from './module/shield.module.js';
|
|
22
22
|
export { Public, Classified, CLASSIFICATION_METADATA, DEFAULT_CLASSIFIED_ACTION, normalizeClassification, } from './enforcement/classification.decorator.js';
|
|
23
23
|
export type { Classification } from './enforcement/classification.decorator.js';
|
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;AAIH,OAAO,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AASzD,OAAO,EACL,2BAA2B,EAC3B,mBAAmB,GACpB,MAAM,sCAAsC,CAAC;AAE9C,YAAY,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AACrD,OAAO,EACL,UAAU,EACV,gBAAgB,EAChB,0BAA0B,EAC1B,oBAAoB,EACpB,uBAAuB,EACvB,UAAU,EACV,SAAS,
|
|
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,EACL,2BAA2B,EAC3B,mBAAmB,GACpB,MAAM,sCAAsC,CAAC;AAE9C,YAAY,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AACrD,OAAO,EACL,UAAU,EACV,gBAAgB,EAChB,0BAA0B,EAC1B,oBAAoB,EACpB,uBAAuB,EACvB,aAAa,EACb,kBAAkB,EAClB,UAAU,EACV,SAAS,EACT,KAAK,WAAW,EAChB,KAAK,eAAe,GACrB,MAAM,gCAAgC,CAAC;A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,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,11 +16,11 @@
|
|
|
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.
|
|
20
|
-
exports.
|
|
21
|
-
exports.
|
|
22
|
-
exports.
|
|
23
|
-
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.maskPhone = exports.MAX_MESSAGE_SEND_TIMEOUT_MS = exports.DEFAULT_MESSAGE_SEND_TIMEOUT_MS = exports.EMAIL_PROVIDER_VALUES = exports.loadMessageConfig = exports.MariaDbEmailAddressChanger = exports.maskEmail = exports.isEmailShaped = exports.canonicalEmail = void 0;
|
|
19
|
+
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.AGENT_TENANT_MODES = exports.AGENT_ACTIONS = exports.SERVICE_ACCOUNT_ACTIONS = exports.RECORD_SHARE_ACTIONS = exports.CROSS_TENANT_GRANT_ACTIONS = exports.IDENTITY_ACTIONS = exports.MODULE_KEY = exports.permissionTextByKey = exports.buildIdentityModuleRegistry = exports.guardMigrationsDir = void 0;
|
|
20
|
+
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.SHIELD_NOTIFICATIONS = exports.loadNotificationConfig = exports.NotificationUnavailableError = exports.NotificationValidationError = exports.NotificationKindError = exports.NOTIFICATION_BULK_ACTIONS = exports.NOTIFICATION_STATUSES = exports.NOTIFICATION_SEVERITIES = exports.NOTIFICATION_CATEGORIES = exports.NotificationService = exports.loadAuditSealConfig = exports.NodeSha256Hash = exports.NodeSha256Digest = exports.S3ObjectStore = exports.wasResolvedFromSecretRef = exports.assertNoUnresolvedSecretRefs = exports.createSecretsProviderFromEnv = void 0;
|
|
21
|
+
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 = 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 = void 0;
|
|
22
|
+
exports.makeDefaultTotpVerifier = exports.AuthModule = exports.SHIELD_CAPTCHA_GATE = exports.RECAPTCHA_SITEVERIFY_URL = exports.RecaptchaVerifier = exports.TURNSTILE_SITEVERIFY_URL = exports.TurnstileVerifier = exports.MAX_CAPTCHA_TIMEOUT_MS = exports.DEFAULT_CAPTCHA_TIMEOUT_MS = exports.DEFAULT_CAPTCHA_MIN_SCORE = exports.DEFAULT_CAPTCHA_THRESHOLD = exports.CAPTCHA_FAIL_MODES = exports.CAPTCHA_MODES = exports.CAPTCHA_ENDPOINTS = exports.loadCaptchaConfig = exports.SHIELD_SIGN_IN_WITH = exports.DEFAULT_SIGN_IN_WITH = exports.resolveSignInWith = 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_MESSAGE_DISPATCHER = 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.withoutStatementTimeout = exports.mariadbPoolTuningOptions = exports.mariadbSslOption = exports.reservedOperationPrincipal = exports.RESERVED_OPERATION_PRINCIPALS = exports.assertNoReservedRootId = exports.ORG_BOOTSTRAP_PRINCIPAL_ID = exports.rootIdsFromEnv = exports.loadPoolTuning = exports.loadDbTlsConfig = exports.isDevOrTestNodeEnv = exports.DEFAULT_LOGIN_IP_LIMIT = exports.loadRefreshReplayWindowMs = exports.loadLoginIpLimit = exports.DEFAULT_REDIS_URL = void 0;
|
|
23
|
+
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.maskPhone = exports.MAX_MESSAGE_SEND_TIMEOUT_MS = exports.DEFAULT_MESSAGE_SEND_TIMEOUT_MS = exports.EMAIL_PROVIDER_VALUES = exports.loadMessageConfig = exports.MariaDbEmailAddressChanger = exports.maskEmail = exports.isEmailShaped = exports.canonicalEmail = exports.hmacSha1 = exports.resolveTotpVerifier = void 0;
|
|
24
24
|
// Framework authz migrations (shield_authz DDL — permission / role_permission /
|
|
25
25
|
// authz_permission_version). Absolute path a consumer's `@astram/migrate` setup merges in.
|
|
26
26
|
var migrations_dir_js_1 = require("./migrations-dir.js");
|
|
@@ -41,6 +41,8 @@ Object.defineProperty(exports, "IDENTITY_ACTIONS", { enumerable: true, get: func
|
|
|
41
41
|
Object.defineProperty(exports, "CROSS_TENANT_GRANT_ACTIONS", { enumerable: true, get: function () { return identity_actions_js_1.CROSS_TENANT_GRANT_ACTIONS; } });
|
|
42
42
|
Object.defineProperty(exports, "RECORD_SHARE_ACTIONS", { enumerable: true, get: function () { return identity_actions_js_1.RECORD_SHARE_ACTIONS; } });
|
|
43
43
|
Object.defineProperty(exports, "SERVICE_ACCOUNT_ACTIONS", { enumerable: true, get: function () { return identity_actions_js_1.SERVICE_ACCOUNT_ACTIONS; } });
|
|
44
|
+
Object.defineProperty(exports, "AGENT_ACTIONS", { enumerable: true, get: function () { return identity_actions_js_1.AGENT_ACTIONS; } });
|
|
45
|
+
Object.defineProperty(exports, "AGENT_TENANT_MODES", { enumerable: true, get: function () { return identity_actions_js_1.AGENT_TENANT_MODES; } });
|
|
44
46
|
Object.defineProperty(exports, "actionsFor", { enumerable: true, get: function () { return identity_actions_js_1.actionsFor; } });
|
|
45
47
|
Object.defineProperty(exports, "actionsOf", { enumerable: true, get: function () { return identity_actions_js_1.actionsOf; } });
|
|
46
48
|
// The single registration seam.
|
package/dist/internal.d.ts
CHANGED
|
@@ -58,4 +58,18 @@ export { SHIELD_ADMIN_STEP_UP, SHIELD_ACCOUNT_UNLOCKER } from './auth/tokens.js'
|
|
|
58
58
|
export { AdminControlUnavailableError, accountUnlockKeys, type AccountUnlocker, type AdminStepUp, type AdminStepUpOutcome, } from './auth/admin-signin-controls.js';
|
|
59
59
|
export { MariaDbMfaResetter, type MfaResetQuery, type MfaResetRequest, type MfaResetResult, type MfaResetter, } from './authentication/mariadb-mfa-resetter.js';
|
|
60
60
|
export type { MfaAdminStatus, MfaStatusBatchSource, MfaStatusSubject, } from './session/mfa-requirement-service.js';
|
|
61
|
+
/**
|
|
62
|
+
* For `@astram/agent` only (G-036 M1, agent-read-capabilities SPEC §5, §10): strict session
|
|
63
|
+
* liveness (one Redis GET, `'unavailable'` on any error) for the per-call freshness check.
|
|
64
|
+
*/
|
|
65
|
+
export { SHIELD_SESSION_LIVENESS } from './auth/tokens.js';
|
|
66
|
+
export { RedisSessionLiveness, type SessionLiveness, type SessionLivenessState, } from './session/session-liveness.js';
|
|
67
|
+
/**
|
|
68
|
+
* For `@astram/agent` only (SPEC §5 run-loop "Manifest"): the permission version the enforcement
|
|
69
|
+
* guard derived `req.principal` under (gate 5's reload, else its cached facts); `undefined` ⇒ the
|
|
70
|
+
* caller fails closed. Recorded by the guard from what gate 5 reported; no read of its own.
|
|
71
|
+
*/
|
|
72
|
+
export { requestFactsVersion } from './enforcement/global-enforcement.guard.js';
|
|
73
|
+
/** For `@astram/agent` only (SPEC §5 `AgentModule` env): the runtime URL rule's loopback check. */
|
|
74
|
+
export { isLoopbackHost } from './config/loopback-host.js';
|
|
61
75
|
//# sourceMappingURL=internal.d.ts.map
|
package/dist/internal.d.ts.map
CHANGED
|
@@ -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;AAClD;;;;GAIG;AACH,OAAO,EAAE,wBAAwB,EAAE,MAAM,kBAAkB,CAAC;AAC5D,OAAO,EAAE,4BAA4B,EAAE,MAAM,oDAAoD,CAAC;AAClG;;;;;GAKG;AACH,OAAO,EAAE,cAAc,EAAE,MAAM,sCAAsC,CAAC;AACtE,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAChD,OAAO,EAAE,8BAA8B,EAAE,MAAM,kBAAkB,CAAC;AAClE,YAAY,EAAE,qBAAqB,EAAE,MAAM,uBAAuB,CAAC;AACnE;;;GAGG;AACH,OAAO,EAAE,8BAA8B,EAAE,MAAM,kBAAkB,CAAC;AAClE;;;GAGG;AACH,OAAO,EAAE,qCAAqC,EAAE,MAAM,kBAAkB,CAAC;AACzE;;;GAGG;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AAE,qCAAqC,EAAE,MAAM,kBAAkB,CAAC;AACzE;;;GAGG;AACH,OAAO,EAAE,yBAAyB,EAAE,MAAM,kBAAkB,CAAC;AAC7D,sGAAsG;AACtG,OAAO,EAAE,sBAAsB,EAAE,MAAM,kBAAkB,CAAC;AAC1D;;;;GAIG;AACH,OAAO,EAAE,6BAA6B,EAAE,MAAM,kBAAkB,CAAC;AACjE;;;;GAIG;AACH,OAAO,EAAE,oBAAoB,EAAE,uBAAuB,EAAE,MAAM,kBAAkB,CAAC;AACjF,OAAO,EACL,4BAA4B,EAC5B,iBAAiB,EACjB,KAAK,eAAe,EACpB,KAAK,WAAW,EAChB,KAAK,kBAAkB,GACxB,MAAM,iCAAiC,CAAC;AACzC,OAAO,EACL,kBAAkB,EAClB,KAAK,aAAa,EAClB,KAAK,eAAe,EACpB,KAAK,cAAc,EACnB,KAAK,WAAW,GACjB,MAAM,0CAA0C,CAAC;AAClD,YAAY,EACV,cAAc,EACd,oBAAoB,EACpB,gBAAgB,GACjB,MAAM,sCAAsC,CAAC;AAC9C;;;GAGG;AACH,OAAO,EAAE,uBAAuB,EAAE,MAAM,kBAAkB,CAAC;AAC3D,OAAO,EACL,oBAAoB,EACpB,KAAK,eAAe,EACpB,KAAK,oBAAoB,GAC1B,MAAM,+BAA+B,CAAC;AACvC;;;;GAIG;AACH,OAAO,EAAE,mBAAmB,EAAE,MAAM,2CAA2C,CAAC;AAChF,mGAAmG;AACnG,OAAO,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC"}
|
package/dist/internal.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.MariaDbMfaResetter = exports.accountUnlockKeys = exports.AdminControlUnavailableError = exports.SHIELD_ACCOUNT_UNLOCKER = exports.SHIELD_ADMIN_STEP_UP = exports.SHIELD_MFA_REQUIREMENT_SOURCE = exports.SHIELD_MFA_REQUIREMENT = exports.SHIELD_MFA_POLICY_FEATURE = exports.SHIELD_DEFAULT_SCOPE_SUBTREE_RESOLVER = exports.SHIELD_DEFAULT_AUTH_AUDIT_SINK = exports.SHIELD_ATTEMPT_LIMITER_FACTORY = exports.SHIELD_REDIS = exports.AttemptLimiter = exports.MariaDbCredentialProvisioner = exports.SHIELD_AUDIT_SEALER_POOL = exports.SHIELD_DB_POOL = exports.PersistenceModule = void 0;
|
|
3
|
+
exports.isLoopbackHost = exports.requestFactsVersion = exports.RedisSessionLiveness = exports.SHIELD_SESSION_LIVENESS = exports.MariaDbMfaResetter = exports.accountUnlockKeys = exports.AdminControlUnavailableError = exports.SHIELD_ACCOUNT_UNLOCKER = exports.SHIELD_ADMIN_STEP_UP = exports.SHIELD_MFA_REQUIREMENT_SOURCE = exports.SHIELD_MFA_REQUIREMENT = exports.SHIELD_MFA_POLICY_FEATURE = exports.SHIELD_DEFAULT_SCOPE_SUBTREE_RESOLVER = exports.SHIELD_DEFAULT_AUTH_AUDIT_SINK = exports.SHIELD_ATTEMPT_LIMITER_FACTORY = exports.SHIELD_REDIS = exports.AttemptLimiter = exports.MariaDbCredentialProvisioner = exports.SHIELD_AUDIT_SEALER_POOL = 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
|
*
|
|
@@ -76,3 +76,21 @@ Object.defineProperty(exports, "AdminControlUnavailableError", { enumerable: tru
|
|
|
76
76
|
Object.defineProperty(exports, "accountUnlockKeys", { enumerable: true, get: function () { return admin_signin_controls_js_1.accountUnlockKeys; } });
|
|
77
77
|
var mariadb_mfa_resetter_js_1 = require("./authentication/mariadb-mfa-resetter.js");
|
|
78
78
|
Object.defineProperty(exports, "MariaDbMfaResetter", { enumerable: true, get: function () { return mariadb_mfa_resetter_js_1.MariaDbMfaResetter; } });
|
|
79
|
+
/**
|
|
80
|
+
* For `@astram/agent` only (G-036 M1, agent-read-capabilities SPEC §5, §10): strict session
|
|
81
|
+
* liveness (one Redis GET, `'unavailable'` on any error) for the per-call freshness check.
|
|
82
|
+
*/
|
|
83
|
+
var tokens_js_11 = require("./auth/tokens.js");
|
|
84
|
+
Object.defineProperty(exports, "SHIELD_SESSION_LIVENESS", { enumerable: true, get: function () { return tokens_js_11.SHIELD_SESSION_LIVENESS; } });
|
|
85
|
+
var session_liveness_js_1 = require("./session/session-liveness.js");
|
|
86
|
+
Object.defineProperty(exports, "RedisSessionLiveness", { enumerable: true, get: function () { return session_liveness_js_1.RedisSessionLiveness; } });
|
|
87
|
+
/**
|
|
88
|
+
* For `@astram/agent` only (SPEC §5 run-loop "Manifest"): the permission version the enforcement
|
|
89
|
+
* guard derived `req.principal` under (gate 5's reload, else its cached facts); `undefined` ⇒ the
|
|
90
|
+
* caller fails closed. Recorded by the guard from what gate 5 reported; no read of its own.
|
|
91
|
+
*/
|
|
92
|
+
var global_enforcement_guard_js_1 = require("./enforcement/global-enforcement.guard.js");
|
|
93
|
+
Object.defineProperty(exports, "requestFactsVersion", { enumerable: true, get: function () { return global_enforcement_guard_js_1.requestFactsVersion; } });
|
|
94
|
+
/** For `@astram/agent` only (SPEC §5 `AgentModule` env): the runtime URL rule's loopback check. */
|
|
95
|
+
var loopback_host_js_1 = require("./config/loopback-host.js");
|
|
96
|
+
Object.defineProperty(exports, "isLoopbackHost", { enumerable: true, get: function () { return loopback_host_js_1.isLoopbackHost; } });
|
|
@@ -21,6 +21,14 @@ export { SHIELD_DECISION_AUTHORITY, SHIELD_RECORD_AUTHORIZATION };
|
|
|
21
21
|
import { type ShieldStorageOption } from '../storage/storage.providers.js';
|
|
22
22
|
import type { ShieldCaptchaOption } from '../captcha/captcha.providers.js';
|
|
23
23
|
import type { NotificationKindRegistration } from '../notifications/ports.js';
|
|
24
|
+
/**
|
|
25
|
+
* The framework-module marker (G-036 M1, agent-read-capabilities SPEC §5 A). Every `@Module` class of
|
|
26
|
+
* guard, identity, engine and agent carries it as a static key (`static readonly [key] = true`), so
|
|
27
|
+
* `@astram/agent`'s inject allow-list walk refuses a capability whose provider tree reaches a
|
|
28
|
+
* framework module. Built with `Symbol.for`, so no package imports another to read it; each package
|
|
29
|
+
* has a test that fails on an unmarked `@Module` class.
|
|
30
|
+
*/
|
|
31
|
+
declare const FRAMEWORK_MODULE: unique symbol;
|
|
24
32
|
export type { RecordAuthorizationInputs } from '../authz/wire-record-authorization.js';
|
|
25
33
|
/**
|
|
26
34
|
* Options for {@link ShieldModule.forRoot}. Intentionally minimal (ADR-0023 §7 —
|
|
@@ -382,6 +390,7 @@ export interface ShieldModuleAsyncOptions {
|
|
|
382
390
|
* `@Global()` so its exported tokens are visible app-wide without re-importing.
|
|
383
391
|
*/
|
|
384
392
|
export declare class ShieldModule {
|
|
393
|
+
static readonly [FRAMEWORK_MODULE] = true;
|
|
385
394
|
/** Register Shield with static options (the common path). */
|
|
386
395
|
static forRoot(options?: ShieldModuleOptions): DynamicModule;
|
|
387
396
|
/**
|
|
@@ -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,CAAC;AACnE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,oCAAoC,CAAC;AAC3E,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,oCAAoC,CAAC;AAC1E,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,+BAA+B,CAAC;AACjE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,sCAAsC,CAAC;AAC9E,OAAO,KAAK,EAAE,aAAa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CAAC,EAAE,mBAAmB,CAAC;IACvC,6FAA6F;IAC7F,QAAQ,CAAC,OAAO,CAAC,EAAE,mBAAmB,CAAC;IACvC,0FAA0F;IAC1F,QAAQ,CAAC,iBAAiB,CAAC,EAAE,SAAS,4BAA4B,EAAE,CAAC;CACtE;AAYD;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,qBAEa,YAAY;IACvB,MAAM,CAAC,QAAQ,CAAC,CAAC,gBAAgB,CAAC,QAAQ;IAE1C,6DAA6D;IAC7D,MAAM,CAAC,OAAO,CAAC,OAAO,GAAE,mBAAwB,GAAG,aAAa;IA4HhE;;;;;;;;;OASG;IACH,MAAM,CAAC,YAAY,CAAC,OAAO,EAAE,wBAAwB,GAAG,aAAa;CAsItE"}
|
|
@@ -88,6 +88,14 @@ Object.defineProperty(exports, "SHIELD_RECORD_AUTHORIZATION", { enumerable: true
|
|
|
88
88
|
// FILE_STORAGE SPEC §6: the `storage` option (S3 adapter loaded lazily inside the provider).
|
|
89
89
|
const storage_providers_js_1 = require("../storage/storage.providers.js");
|
|
90
90
|
const notification_service_js_1 = require("../notifications/notification.service.js");
|
|
91
|
+
/**
|
|
92
|
+
* The framework-module marker (G-036 M1, agent-read-capabilities SPEC §5 A). Every `@Module` class of
|
|
93
|
+
* guard, identity, engine and agent carries it as a static key (`static readonly [key] = true`), so
|
|
94
|
+
* `@astram/agent`'s inject allow-list walk refuses a capability whose provider tree reaches a
|
|
95
|
+
* framework module. Built with `Symbol.for`, so no package imports another to read it; each package
|
|
96
|
+
* has a test that fails on an unmarked `@Module` class.
|
|
97
|
+
*/
|
|
98
|
+
const FRAMEWORK_MODULE = Symbol.for('astram.framework-module');
|
|
91
99
|
/**
|
|
92
100
|
* A `Function`-wrapped dynamic `import()` that survives the CommonJS **build** — the same
|
|
93
101
|
* shim as auth.module.ts's `evalImport`. Under `module: commonjs`, `tsc` would rewrite a
|
|
@@ -225,7 +233,9 @@ function loadEnvAppConfig() {
|
|
|
225
233
|
*
|
|
226
234
|
* `@Global()` so its exported tokens are visible app-wide without re-importing.
|
|
227
235
|
*/
|
|
228
|
-
let ShieldModule =
|
|
236
|
+
let ShieldModule = class ShieldModule {
|
|
237
|
+
static { ShieldModule_1 = this; }
|
|
238
|
+
static [FRAMEWORK_MODULE] = true;
|
|
229
239
|
/** Register Shield with static options (the common path). */
|
|
230
240
|
static forRoot(options = {}) {
|
|
231
241
|
// G-009 N4: a reserved operation principal is never a root, however `rootIds` was built.
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Strict session liveness (G-036 M1, agent-read-capabilities SPEC §5 guard section, §10 step 1).
|
|
3
|
+
*
|
|
4
|
+
* `check(sessionId, tenantId)` answers whether a session is still live, still acting on `tenantId`
|
|
5
|
+
* and unrestricted, from ONE Redis `GET shield:sessclaims:<sessionId>` (the liveness entry the
|
|
6
|
+
* {@link import('../request-auth/session-token-binder.js').SessionTokenBinder} writes at login and
|
|
7
|
+
* deletes on logout, admin end-sessions and the disable sweep). Unlike the binder's
|
|
8
|
+
* `sessionTenant()`, which swallows errors into `null`, every failure here is `'unavailable'`, so a
|
|
9
|
+
* caller can fail closed (Shield #1) instead of reading an outage as "ended".
|
|
10
|
+
*
|
|
11
|
+
* - entry missing ⇒ `'ended'`
|
|
12
|
+
* - Redis error, unparseable or malformed entry ⇒ `'unavailable'`
|
|
13
|
+
* - entry tenant ≠ `canonicalUuid(tenantId)` ⇒ `'tenant_changed'` (scope switch)
|
|
14
|
+
* - `restrictionOf(claims, now) !== null` ⇒ `'restricted'` (the guard's own rule, grace
|
|
15
|
+
* deadline included)
|
|
16
|
+
* - otherwise ⇒ `'live'`
|
|
17
|
+
*
|
|
18
|
+
* Used inside a handler (the agent executor), never on the guard's per-request path: it adds no read
|
|
19
|
+
* there (Shield #12). Exported on `@astram/guard/internal` only.
|
|
20
|
+
*/
|
|
21
|
+
import type Redis from 'ioredis';
|
|
22
|
+
export type SessionLivenessState = 'live' | 'ended' | 'tenant_changed' | 'restricted' | 'unavailable';
|
|
23
|
+
/** The port behind `SHIELD_SESSION_LIVENESS`. Never throws. */
|
|
24
|
+
export interface SessionLiveness {
|
|
25
|
+
check(sessionId: string, tenantId: string): Promise<SessionLivenessState>;
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* The session-claims key prefix. Must equal the binder's private `SESS_CLAIMS_PREFIX`; the spec
|
|
29
|
+
* proves it by binding a session through the real binder and reading it back here.
|
|
30
|
+
*/
|
|
31
|
+
export declare const SESSION_CLAIMS_KEY_PREFIX = "shield:sessclaims:";
|
|
32
|
+
/** The Redis client surface the check uses (one `get`). */
|
|
33
|
+
type RedisGet = Pick<Redis, 'get'>;
|
|
34
|
+
export declare class RedisSessionLiveness implements SessionLiveness {
|
|
35
|
+
private readonly redis;
|
|
36
|
+
private readonly now;
|
|
37
|
+
constructor(redis: RedisGet, now?: () => number);
|
|
38
|
+
check(sessionId: string, tenantId: string): Promise<SessionLivenessState>;
|
|
39
|
+
}
|
|
40
|
+
export {};
|
|
41
|
+
//# sourceMappingURL=session-liveness.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"session-liveness.d.ts","sourceRoot":"","sources":["../../src/session/session-liveness.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AACH,OAAO,KAAK,KAAK,MAAM,SAAS,CAAC;AAIjC,MAAM,MAAM,oBAAoB,GAC9B,MAAM,GAAG,OAAO,GAAG,gBAAgB,GAAG,YAAY,GAAG,aAAa,CAAC;AAErE,+DAA+D;AAC/D,MAAM,WAAW,eAAe;IAC9B,KAAK,CAAC,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,oBAAoB,CAAC,CAAC;CAC3E;AAED;;;GAGG;AACH,eAAO,MAAM,yBAAyB,uBAAuB,CAAC;AAE9D,2DAA2D;AAC3D,KAAK,QAAQ,GAAG,IAAI,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC;AAEnC,qBAAa,oBAAqB,YAAW,eAAe;IAExD,OAAO,CAAC,QAAQ,CAAC,KAAK;IACtB,OAAO,CAAC,QAAQ,CAAC,GAAG;gBADH,KAAK,EAAE,QAAQ,EACf,GAAG,GAAE,MAAM,MAAiB;IAGzC,KAAK,CAAC,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,oBAAoB,CAAC;CA+ChF"}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.RedisSessionLiveness = exports.SESSION_CLAIMS_KEY_PREFIX = void 0;
|
|
4
|
+
const engine_1 = require("@astram/engine");
|
|
5
|
+
const session_restriction_js_1 = require("./session-restriction.js");
|
|
6
|
+
/**
|
|
7
|
+
* The session-claims key prefix. Must equal the binder's private `SESS_CLAIMS_PREFIX`; the spec
|
|
8
|
+
* proves it by binding a session through the real binder and reading it back here.
|
|
9
|
+
*/
|
|
10
|
+
exports.SESSION_CLAIMS_KEY_PREFIX = 'shield:sessclaims:';
|
|
11
|
+
class RedisSessionLiveness {
|
|
12
|
+
redis;
|
|
13
|
+
now;
|
|
14
|
+
constructor(redis, now = Date.now) {
|
|
15
|
+
this.redis = redis;
|
|
16
|
+
this.now = now;
|
|
17
|
+
}
|
|
18
|
+
async check(sessionId, tenantId) {
|
|
19
|
+
// A service-account principal has no session id: nothing to look up, and never live.
|
|
20
|
+
if (typeof sessionId !== 'string' || sessionId === '')
|
|
21
|
+
return 'ended';
|
|
22
|
+
let raw;
|
|
23
|
+
try {
|
|
24
|
+
raw = await this.redis.get(`${exports.SESSION_CLAIMS_KEY_PREFIX}${sessionId}`);
|
|
25
|
+
}
|
|
26
|
+
catch {
|
|
27
|
+
return 'unavailable';
|
|
28
|
+
}
|
|
29
|
+
if (raw === null)
|
|
30
|
+
return 'ended';
|
|
31
|
+
let parsed;
|
|
32
|
+
try {
|
|
33
|
+
parsed = JSON.parse(raw);
|
|
34
|
+
}
|
|
35
|
+
catch {
|
|
36
|
+
return 'unavailable';
|
|
37
|
+
}
|
|
38
|
+
if (parsed === null || typeof parsed !== 'object' || Array.isArray(parsed)) {
|
|
39
|
+
return 'unavailable';
|
|
40
|
+
}
|
|
41
|
+
const claims = parsed;
|
|
42
|
+
const bound = (0, engine_1.canonicalUuid)(claims.tenantId);
|
|
43
|
+
if (bound === null)
|
|
44
|
+
return 'unavailable';
|
|
45
|
+
const wanted = (0, engine_1.canonicalUuid)(tenantId);
|
|
46
|
+
if (wanted === null || wanted !== bound)
|
|
47
|
+
return 'tenant_changed';
|
|
48
|
+
const input = {
|
|
49
|
+
mustReenroll: claims.mustReenroll === true,
|
|
50
|
+
...(claims.restriction !== undefined
|
|
51
|
+
? { restriction: claims.restriction }
|
|
52
|
+
: {}),
|
|
53
|
+
...(claims.mfaEnrollmentDeadlineMs !== undefined
|
|
54
|
+
? {
|
|
55
|
+
mfaEnrollmentDeadlineMs: claims.mfaEnrollmentDeadlineMs,
|
|
56
|
+
}
|
|
57
|
+
: {}),
|
|
58
|
+
};
|
|
59
|
+
const restriction = (0, session_restriction_js_1.restrictionOf)(input, this.now());
|
|
60
|
+
return restriction === null ? 'live' : 'restricted';
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
exports.RedisSessionLiveness = RedisSessionLiveness;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@astram/guard",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.28.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/
|
|
40
|
-
"@astram/
|
|
39
|
+
"@astram/core": "1.15.0",
|
|
40
|
+
"@astram/engine": "0.17.0"
|
|
41
41
|
},
|
|
42
42
|
"peerDependencies": {
|
|
43
43
|
"@nestjs/common": "^11",
|
|
@@ -45,7 +45,7 @@
|
|
|
45
45
|
"@nestjs/platform-express": "^11",
|
|
46
46
|
"reflect-metadata": "^0.2",
|
|
47
47
|
"rxjs": "^7",
|
|
48
|
-
"@astram/messaging": "^0.1.
|
|
48
|
+
"@astram/messaging": "^0.1.14"
|
|
49
49
|
},
|
|
50
50
|
"peerDependenciesMeta": {
|
|
51
51
|
"@astram/messaging": {
|
|
@@ -68,7 +68,7 @@
|
|
|
68
68
|
"typescript": "^5.7.0",
|
|
69
69
|
"unplugin-swc": "^1.5.1",
|
|
70
70
|
"vitest": "^2.1.8",
|
|
71
|
-
"@astram/messaging": "0.1.
|
|
71
|
+
"@astram/messaging": "0.1.14"
|
|
72
72
|
},
|
|
73
73
|
"repository": {
|
|
74
74
|
"type": "git",
|