@astram/guard 0.31.0 → 0.32.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/agent/agent-provenance.d.ts +24 -0
- package/dist/agent/agent-provenance.d.ts.map +1 -0
- package/dist/agent/agent-provenance.js +40 -0
- package/dist/authz/manifest-operation-authority-adapter.d.ts +9 -1
- package/dist/authz/manifest-operation-authority-adapter.d.ts.map +1 -1
- package/dist/authz/manifest-operation-authority-adapter.js +17 -1
- package/dist/authz/operation-marker-check.d.ts +12 -1
- package/dist/authz/operation-marker-check.d.ts.map +1 -1
- package/dist/authz/operation-marker-check.js +13 -1
- package/dist/authz/wire-record-authorization.d.ts.map +1 -1
- package/dist/authz/wire-record-authorization.js +6 -4
- package/dist/config/app-config.d.ts +15 -3
- package/dist/config/app-config.d.ts.map +1 -1
- package/dist/config/app-config.js +12 -3
- package/dist/index.d.ts +3 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +13 -4
- package/dist/internal.d.ts +6 -0
- package/dist/internal.d.ts.map +1 -1
- package/dist/internal.js +10 -1
- package/dist/module/shield-tokens.d.ts +103 -0
- package/dist/module/shield-tokens.d.ts.map +1 -1
- package/dist/module/shield-tokens.js +13 -1
- package/dist/module/shield.module.d.ts +17 -1
- package/dist/module/shield.module.d.ts.map +1 -1
- package/dist/module/shield.module.js +2 -2
- package/dist/notifications/notification.service.d.ts +2 -0
- package/dist/notifications/notification.service.d.ts.map +1 -1
- package/dist/notifications/notification.service.js +8 -0
- package/dist/storage/storage.providers.d.ts +36 -3
- package/dist/storage/storage.providers.d.ts.map +1 -1
- package/dist/storage/storage.providers.js +203 -3
- package/package.json +5 -5
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Agent provenance (agent-proposals SPEC v7 §5 E, plan D-9): the ONLY way a proposal is recorded
|
|
3
|
+
* as `origin: 'agent'`. Reviewers and audit rely on that label, so trusted app server code must
|
|
4
|
+
* not be able to put it on a person's proposal through the public `SHIELD_PROPOSAL_PORT`.
|
|
5
|
+
*
|
|
6
|
+
* ⛔ UNFORGEABLE, like engine `bindOperation`. A minted provenance lives in a module-private
|
|
7
|
+
* WeakSet keyed by the frozen object {@link mintAgentProvenance} returned. A spread, JSON or
|
|
8
|
+
* structural copy is a different object and carries nothing, so a literal
|
|
9
|
+
* `{ origin: 'agent', taskId, callId }` built by app code is refused by identity's submit
|
|
10
|
+
* (`forbidden`). Exported from `@astram/guard/internal` only, never the guard root barrel: only
|
|
11
|
+
* the agent executor mints; identity reads {@link isMintedAgentProvenance}.
|
|
12
|
+
*/
|
|
13
|
+
/** The longest task or call id a provenance carries (identity `proposal.service.ts` `IDS_MAX`). */
|
|
14
|
+
export declare const AGENT_PROVENANCE_ID_MAX = 64;
|
|
15
|
+
export interface AgentProvenance {
|
|
16
|
+
readonly origin: 'agent';
|
|
17
|
+
readonly taskId: string;
|
|
18
|
+
readonly callId: string;
|
|
19
|
+
}
|
|
20
|
+
/** Mint an agent provenance for the executing call. Returns a NEW frozen, registered object. */
|
|
21
|
+
export declare function mintAgentProvenance(taskId: string, callId: string): AgentProvenance;
|
|
22
|
+
/** `true` only for the exact object {@link mintAgentProvenance} returned. */
|
|
23
|
+
export declare function isMintedAgentProvenance(p: unknown): p is AgentProvenance;
|
|
24
|
+
//# sourceMappingURL=agent-provenance.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"agent-provenance.d.ts","sourceRoot":"","sources":["../../src/agent/agent-provenance.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,mGAAmG;AACnG,eAAO,MAAM,uBAAuB,KAAK,CAAC;AAE1C,MAAM,WAAW,eAAe;IAC9B,QAAQ,CAAC,MAAM,EAAE,OAAO,CAAC;IACzB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;CACzB;AAaD,gGAAgG;AAChG,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,eAAe,CAQnF;AAED,6EAA6E;AAC7E,wBAAgB,uBAAuB,CAAC,CAAC,EAAE,OAAO,GAAG,CAAC,IAAI,eAAe,CAExE"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Agent provenance (agent-proposals SPEC v7 §5 E, plan D-9): the ONLY way a proposal is recorded
|
|
4
|
+
* as `origin: 'agent'`. Reviewers and audit rely on that label, so trusted app server code must
|
|
5
|
+
* not be able to put it on a person's proposal through the public `SHIELD_PROPOSAL_PORT`.
|
|
6
|
+
*
|
|
7
|
+
* ⛔ UNFORGEABLE, like engine `bindOperation`. A minted provenance lives in a module-private
|
|
8
|
+
* WeakSet keyed by the frozen object {@link mintAgentProvenance} returned. A spread, JSON or
|
|
9
|
+
* structural copy is a different object and carries nothing, so a literal
|
|
10
|
+
* `{ origin: 'agent', taskId, callId }` built by app code is refused by identity's submit
|
|
11
|
+
* (`forbidden`). Exported from `@astram/guard/internal` only, never the guard root barrel: only
|
|
12
|
+
* the agent executor mints; identity reads {@link isMintedAgentProvenance}.
|
|
13
|
+
*/
|
|
14
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
+
exports.AGENT_PROVENANCE_ID_MAX = void 0;
|
|
16
|
+
exports.mintAgentProvenance = mintAgentProvenance;
|
|
17
|
+
exports.isMintedAgentProvenance = isMintedAgentProvenance;
|
|
18
|
+
/** The longest task or call id a provenance carries (identity `proposal.service.ts` `IDS_MAX`). */
|
|
19
|
+
exports.AGENT_PROVENANCE_ID_MAX = 64;
|
|
20
|
+
const minted = new WeakSet();
|
|
21
|
+
function requireId(name, value) {
|
|
22
|
+
if (typeof value !== 'string' || value.length === 0 || value.length > exports.AGENT_PROVENANCE_ID_MAX) {
|
|
23
|
+
throw new TypeError(`mintAgentProvenance: ${name} must be a string of 1-${exports.AGENT_PROVENANCE_ID_MAX} characters`);
|
|
24
|
+
}
|
|
25
|
+
return value;
|
|
26
|
+
}
|
|
27
|
+
/** Mint an agent provenance for the executing call. Returns a NEW frozen, registered object. */
|
|
28
|
+
function mintAgentProvenance(taskId, callId) {
|
|
29
|
+
const provenance = Object.freeze({
|
|
30
|
+
origin: 'agent',
|
|
31
|
+
taskId: requireId('taskId', taskId),
|
|
32
|
+
callId: requireId('callId', callId),
|
|
33
|
+
});
|
|
34
|
+
minted.add(provenance);
|
|
35
|
+
return provenance;
|
|
36
|
+
}
|
|
37
|
+
/** `true` only for the exact object {@link mintAgentProvenance} returned. */
|
|
38
|
+
function isMintedAgentProvenance(p) {
|
|
39
|
+
return typeof p === 'object' && p !== null && minted.has(p);
|
|
40
|
+
}
|
|
@@ -17,7 +17,8 @@
|
|
|
17
17
|
* ── THE MANIFEST: `${operationKey}:${stepKey}` → {@link DelegatedAuthority}. The consumer
|
|
18
18
|
* DECLARES it by constructing the adapter with a map (or `[key, authority]` entries). An
|
|
19
19
|
* UNKNOWN key ⇒ `undefined` (pass-through: NO delegation — evaluate under the caller — the
|
|
20
|
-
* common case).
|
|
20
|
+
* common case). Plan D-5: that pass-through holds only for an UNBOUND principal; the wired
|
|
21
|
+
* `withOperationMarkerCheck` denies a principal bound to a step {@link declaresStep} rejects.
|
|
21
22
|
*
|
|
22
23
|
* ── FAIL-CLOSED ON A MALFORMED / WILDCARD ENTRY. Core's gate-7 overlay re-checks scope with
|
|
23
24
|
* strict membership, but this adapter NEVER hands back a wildcard or malformed authority: a
|
|
@@ -61,5 +62,12 @@ export declare class ManifestOperationAuthorityAdapter implements OperationAutho
|
|
|
61
62
|
*/
|
|
62
63
|
constructor(entries?: readonly OperationManifestEntry[]);
|
|
63
64
|
resolveDelegatedAuthority(operationKey: string, stepKey: string): DelegatedAuthority | undefined;
|
|
65
|
+
/**
|
|
66
|
+
* Agent-proposals plan D-5: whether `operationKey` + `stepKey` is a DECLARED, well-formed step
|
|
67
|
+
* (a dropped wildcard / malformed entry is not). `withOperationMarkerCheck` denies every decision
|
|
68
|
+
* of a principal bound (`bindOperation`) to a step this returns `false` for, so an unknown step,
|
|
69
|
+
* or an undeclared operation, never falls back to the user's own grants at gate 7.
|
|
70
|
+
*/
|
|
71
|
+
declaresStep(operationKey: string, stepKey: string): boolean;
|
|
64
72
|
}
|
|
65
73
|
//# sourceMappingURL=manifest-operation-authority-adapter.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"manifest-operation-authority-adapter.d.ts","sourceRoot":"","sources":["../../src/authz/manifest-operation-authority-adapter.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"manifest-operation-authority-adapter.d.ts","sourceRoot":"","sources":["../../src/authz/manifest-operation-authority-adapter.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqCG;AAEH,OAAO,KAAK,EAAE,kBAAkB,EAAE,sBAAsB,EAAE,MAAM,cAAc,CAAC;AAE/E,yFAAyF;AACzF,eAAO,MAAM,+BAA+B,eAA4C,CAAC;AAEzF;;;;GAIG;AACH,MAAM,WAAW,sBAAsB;IACrC,kEAAkE;IAClE,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC;IAC9B,uDAAuD;IACvD,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,sEAAsE;IACtE,QAAQ,CAAC,SAAS,EAAE,kBAAkB,CAAC;CACxC;AA6BD,qBAAa,iCAAkC,YAAW,sBAAsB;IAC9E,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAkC;IAE3D;;;;;OAKG;gBACS,OAAO,GAAE,SAAS,sBAAsB,EAAO;IAuB3D,yBAAyB,CAAC,YAAY,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,kBAAkB,GAAG,SAAS;IAchG;;;;;OAKG;IACH,YAAY,CAAC,YAAY,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,OAAO;CAW7D"}
|
|
@@ -18,7 +18,8 @@
|
|
|
18
18
|
* ── THE MANIFEST: `${operationKey}:${stepKey}` → {@link DelegatedAuthority}. The consumer
|
|
19
19
|
* DECLARES it by constructing the adapter with a map (or `[key, authority]` entries). An
|
|
20
20
|
* UNKNOWN key ⇒ `undefined` (pass-through: NO delegation — evaluate under the caller — the
|
|
21
|
-
* common case).
|
|
21
|
+
* common case). Plan D-5: that pass-through holds only for an UNBOUND principal; the wired
|
|
22
|
+
* `withOperationMarkerCheck` denies a principal bound to a step {@link declaresStep} rejects.
|
|
22
23
|
*
|
|
23
24
|
* ── FAIL-CLOSED ON A MALFORMED / WILDCARD ENTRY. Core's gate-7 overlay re-checks scope with
|
|
24
25
|
* strict membership, but this adapter NEVER hands back a wildcard or malformed authority: a
|
|
@@ -104,5 +105,20 @@ class ManifestOperationAuthorityAdapter {
|
|
|
104
105
|
// absent key ⇒ undefined (pass-through: no delegation, the common case).
|
|
105
106
|
return this.manifest.get(manifestKey(operationKey, stepKey));
|
|
106
107
|
}
|
|
108
|
+
/**
|
|
109
|
+
* Agent-proposals plan D-5: whether `operationKey` + `stepKey` is a DECLARED, well-formed step
|
|
110
|
+
* (a dropped wildcard / malformed entry is not). `withOperationMarkerCheck` denies every decision
|
|
111
|
+
* of a principal bound (`bindOperation`) to a step this returns `false` for, so an unknown step,
|
|
112
|
+
* or an undeclared operation, never falls back to the user's own grants at gate 7.
|
|
113
|
+
*/
|
|
114
|
+
declaresStep(operationKey, stepKey) {
|
|
115
|
+
if (typeof operationKey !== 'string' ||
|
|
116
|
+
operationKey.length === 0 ||
|
|
117
|
+
typeof stepKey !== 'string' ||
|
|
118
|
+
stepKey.length === 0) {
|
|
119
|
+
return false;
|
|
120
|
+
}
|
|
121
|
+
return this.manifest.has(manifestKey(operationKey, stepKey));
|
|
122
|
+
}
|
|
107
123
|
}
|
|
108
124
|
exports.ManifestOperationAuthorityAdapter = ManifestOperationAuthorityAdapter;
|
|
@@ -14,7 +14,18 @@
|
|
|
14
14
|
* (`isEngineSeparationOfDutiesFacts`, a module-private WeakSet) passes. Any other value is
|
|
15
15
|
* removed, so a bound action then fails closed (`separation_of_duties_unverified`) instead of a
|
|
16
16
|
* forged empty set skipping the rule.
|
|
17
|
+
*
|
|
18
|
+
* Agent-proposals plan D-5 (stricter than SPEC v7): gate 7 overrides only for a step the manifest
|
|
19
|
+
* declares; for any other step it passes through, so the baseline (the user's own grants) would
|
|
20
|
+
* decide. Given `declared` (the wired `ManifestOperationAuthorityAdapter`), a principal BOUND to
|
|
21
|
+
* an operation step the manifest does not declare (an unknown step of a declared operation, or an
|
|
22
|
+
* undeclared operation key) is DENIED here, before the inner `decide()` runs: a fixed, frozen
|
|
23
|
+
* `missing_object_type_grant` / `operation_step_not_declared`, whatever the marker or the grants.
|
|
17
24
|
*/
|
|
18
25
|
import type { DecisionAuthority } from '@astram/core';
|
|
19
|
-
|
|
26
|
+
/** The declared steps of every operation (the wired manifest adapter implements it). */
|
|
27
|
+
export interface DeclaredOperationSteps {
|
|
28
|
+
declaresStep(operationKey: string, stepKey: string): boolean;
|
|
29
|
+
}
|
|
30
|
+
export declare function withOperationMarkerCheck(inner: DecisionAuthority, declared?: DeclaredOperationSteps): DecisionAuthority;
|
|
20
31
|
//# sourceMappingURL=operation-marker-check.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"operation-marker-check.d.ts","sourceRoot":"","sources":["../../src/authz/operation-marker-check.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"operation-marker-check.d.ts","sourceRoot":"","sources":["../../src/authz/operation-marker-check.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,OAAO,KAAK,EAAY,iBAAiB,EAAE,MAAM,cAAc,CAAC;AAMhE,wFAAwF;AACxF,MAAM,WAAW,sBAAsB;IACrC,YAAY,CAAC,YAAY,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC;CAC9D;AASD,wBAAgB,wBAAwB,CACtC,KAAK,EAAE,iBAAiB,EACxB,QAAQ,CAAC,EAAE,sBAAsB,GAChC,iBAAiB,CAiCnB"}
|
|
@@ -4,9 +4,21 @@ exports.withOperationMarkerCheck = withOperationMarkerCheck;
|
|
|
4
4
|
const engine_1 = require("@astram/engine");
|
|
5
5
|
const MARKER = 'shield.delegation';
|
|
6
6
|
const SOD_FACTS = 'shield.separationOfDuties';
|
|
7
|
-
|
|
7
|
+
/** Plan D-5: the one decision for a principal bound to an undeclared operation step. */
|
|
8
|
+
const UNDECLARED_STEP_DENY = Object.freeze({
|
|
9
|
+
effect: 'deny',
|
|
10
|
+
reason: 'missing_object_type_grant',
|
|
11
|
+
detail: 'operation_step_not_declared',
|
|
12
|
+
});
|
|
13
|
+
function withOperationMarkerCheck(inner, declared) {
|
|
8
14
|
return {
|
|
9
15
|
decide: (principal, action, resource, context) => {
|
|
16
|
+
if (declared !== undefined) {
|
|
17
|
+
const bound = (0, engine_1.operationOf)(principal);
|
|
18
|
+
if (bound !== undefined && !declared.declaresStep(bound.operationKey, bound.stepKey)) {
|
|
19
|
+
return Promise.resolve(UNDECLARED_STEP_DENY);
|
|
20
|
+
}
|
|
21
|
+
}
|
|
10
22
|
const attributes = context.attributes;
|
|
11
23
|
if (attributes === undefined || !(MARKER in attributes || SOD_FACTS in attributes)) {
|
|
12
24
|
return inner.decide(principal, action, resource, context);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"wire-record-authorization.d.ts","sourceRoot":"","sources":["../../src/authz/wire-record-authorization.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,OAAO,KAAK,EACV,iBAAiB,EAEjB,cAAc,EAEd,mBAAmB,EACnB,SAAS,EAET,kBAAkB,EACnB,MAAM,cAAc,CAAC;AAMtB,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,+BAA+B,CAAC;AAC7E,OAAO,KAAK,EAAE,U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X,OAAO,CAAC;IAAE,GAAG,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,OAAO,EAAE,CAAA;CAAE,CAAC,CAAC;AAEjD;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,yBAAyB,GAAG,WAAW,CA2F/E"}
|
|
@@ -74,6 +74,10 @@ function buildRecordAuthorization(inputs, options = {}) {
|
|
|
74
74
|
? withRedisPermissionVersion(inputs.permissionFacts, options.versionCache)
|
|
75
75
|
: inputs.permissionFacts;
|
|
76
76
|
const schema = authzSchemaOf(inputs);
|
|
77
|
+
// Delegation / trusted-operation authority over the DECLARED manifest (no DB). Empty ⇒
|
|
78
|
+
// pass-through. The app supplies the entries; the framework owns the adapter. The marker check
|
|
79
|
+
// also uses it (plan D-5): a principal bound to an undeclared step is denied outright.
|
|
80
|
+
const operationAuthority = new manifest_operation_authority_adapter_js_1.ManifestOperationAuthorityAdapter(inputs.operationManifest ?? []);
|
|
77
81
|
return (0, operation_marker_check_js_1.withOperationMarkerCheck)((0, core_1.createWiredDecisionAuthority)({
|
|
78
82
|
registry: inputs.registry,
|
|
79
83
|
// The app-owned port, wrapped so a gate-5 reload inside an enforcement request notifies the
|
|
@@ -92,10 +96,8 @@ function buildRecordAuthorization(inputs, options = {}) {
|
|
|
92
96
|
// Cross-tenant consented grants over `shield_authz.cross_tenant_grant`. No active
|
|
93
97
|
// grant ⇒ null (deny-by-default for the cross-tenant reach).
|
|
94
98
|
crossTenantGrant: new mariadb_cross_tenant_grant_adapter_js_1.MariaDbCrossTenantGrantAdapter(inputs.pool, { schema }),
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
operationAuthority: new manifest_operation_authority_adapter_js_1.ManifestOperationAuthorityAdapter(inputs.operationManifest ?? []),
|
|
98
|
-
}));
|
|
99
|
+
operationAuthority,
|
|
100
|
+
}), operationAuthority);
|
|
99
101
|
}
|
|
100
102
|
/**
|
|
101
103
|
* Construct the engine-facing {@link ListScopeFn} — the LIST-form sibling to
|
|
@@ -11,7 +11,8 @@
|
|
|
11
11
|
*
|
|
12
12
|
* ─────────────────────────────────────────────────────────────────────────────
|
|
13
13
|
* ADR-0018 budget (the invariant this config feeds):
|
|
14
|
-
* workers × (Σ(per-account RUNTIME pool max) + 1 audit sealer) + headroom
|
|
14
|
+
* workers × (Σ(per-account RUNTIME pool max) + 1 audit sealer + 2 engine lock probe) + headroom
|
|
15
|
+
* ≤ maxConnections
|
|
15
16
|
*
|
|
16
17
|
* "Runtime" pools are the pools each PM2 cluster worker holds open: shield_core,
|
|
17
18
|
* shield_app_crud, shield_schema_svc. The deploy/ops accounts (migrate, backup,
|
|
@@ -20,7 +21,9 @@
|
|
|
20
21
|
*
|
|
21
22
|
* Defaults below agree byte-for-byte with infra/mariadb/conf.d/my.cnf
|
|
22
23
|
* (max_connections=250) and the local docker-compose substrate:
|
|
23
|
-
* 8 × (12 + 8 + 1 + 1 sealer) + 40 =
|
|
24
|
+
* 8 × (12 + 8 + 1 + 1 sealer + 2 lock probe) + 40 = 232 ≤ 250 ✓ (G-026: the sealer's own
|
|
25
|
+
* 1-connection pool; agent-proposals SPEC §5 J: the engine lock-probe pool's 2)
|
|
26
|
+
* Single layout defaults: 8 × (12 + 10 + 4 + 1 + 2) + 40 = 272 > 250 (size the host's budget).
|
|
24
27
|
* ─────────────────────────────────────────────────────────────────────────────
|
|
25
28
|
*/
|
|
26
29
|
import type { FrameworkSchemas, SecretsProvider } from '@astram/core';
|
|
@@ -261,6 +264,12 @@ export declare function poolTuningOf(config: Pick<AppConfig, 'poolTuning'>): Poo
|
|
|
261
264
|
* in the budget (5.F), whether or not `auth: true` starts the sealer.
|
|
262
265
|
*/
|
|
263
266
|
export declare const AUDIT_SEALER_POOL_CONNECTIONS = 1;
|
|
267
|
+
/**
|
|
268
|
+
* The engine lock-probe pool (agent-proposals SPEC §5 J, FW-R1/1): two connections per worker on
|
|
269
|
+
* the engine's runtime account (same config as the engine pool), always counted in the budget in
|
|
270
|
+
* both layouts, next to the sealer's. Must equal `@astram/engine`'s `LOCK_PROBE_POOL_CONNECTIONS`.
|
|
271
|
+
*/
|
|
272
|
+
export declare const ENGINE_LOCK_PROBE_POOL_CONNECTIONS = 2;
|
|
264
273
|
/**
|
|
265
274
|
* Build the {@link PoolBudgetConfig} from env with documented defaults.
|
|
266
275
|
* Field ↔ env name:
|
|
@@ -441,7 +450,10 @@ export declare const DEFAULT_OBJECT_STORAGE_MAX_BYTES: number;
|
|
|
441
450
|
export declare function loadObjectStorageConfig(env?: NodeJS.ProcessEnv, options?: LoadObjectStorageConfigOptions): ObjectStorageConfig | undefined;
|
|
442
451
|
/** Result of evaluating a {@link PoolBudgetConfig} against the ADR-0018 budget. */
|
|
443
452
|
export interface PoolBudgetEvaluation {
|
|
444
|
-
/**
|
|
453
|
+
/**
|
|
454
|
+
* Σ(per-account runtime pool max) + the audit sealer's 1 + the engine lock-probe pool's 2, for a
|
|
455
|
+
* single worker.
|
|
456
|
+
*/
|
|
445
457
|
readonly perWorkerConnections: number;
|
|
446
458
|
/** workers × perWorkerConnections — total runtime connections at full load. */
|
|
447
459
|
readonly runtimeConnections: number;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"app-config.d.ts","sourceRoot":"","sources":["../../src/config/app-config.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"app-config.d.ts","sourceRoot":"","sources":["../../src/config/app-config.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,OAAO,KAAK,EAAE,gBAAgB,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAWtE,MAAM,WAAW,SAAS;IACxB,yCAAyC;IACzC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,oEAAoE;IACpE,QAAQ,CAAC,WAAW,EAAE,aAAa,GAAG,MAAM,GAAG,YAAY,CAAC;IAC5D,wEAAwE;IACxE,QAAQ,CAAC,IAAI,EAAE,gBA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AO,CAAC;IAC/B,0EAA0E;IAC1E,QAAQ,CAAC,sBAAsB,EAAE,OAAO,CAAC;IACzC;;;OAGG;IACH,QAAQ,CAAC,gBAAgB,EAAE,OAAO,CAAC;CACpC;AAED;;;GAGG;AACH,wBAAgB,kBAAkB,CAAC,GAAG,EAAE,gBAAgB,GAAG,oBAAoB,CA6B9E"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.DEFAULT_OBJECT_STORAGE_MAX_BYTES = exports.DEFAULT_REDIS_URL = exports.DEFAULT_DB_CONFIG = exports.AUDIT_SEALER_POOL_CONNECTIONS = exports.DEFAULT_POOL_IDLE_TIMEOUT_S = exports.DEFAULT_POOL_MIN_IDLE = exports.SCHEMA_SVC_POOL_HARD_CAP = exports.DEFAULT_POOL_BUDGET = exports.DEFAULT_REDIS_COMMAND_TIMEOUT_MS = exports.DEFAULT_LOGIN_IP_LIMIT = void 0;
|
|
3
|
+
exports.DEFAULT_OBJECT_STORAGE_MAX_BYTES = exports.DEFAULT_REDIS_URL = exports.DEFAULT_DB_CONFIG = exports.ENGINE_LOCK_PROBE_POOL_CONNECTIONS = exports.AUDIT_SEALER_POOL_CONNECTIONS = exports.DEFAULT_POOL_IDLE_TIMEOUT_S = exports.DEFAULT_POOL_MIN_IDLE = exports.SCHEMA_SVC_POOL_HARD_CAP = exports.DEFAULT_POOL_BUDGET = exports.DEFAULT_REDIS_COMMAND_TIMEOUT_MS = exports.DEFAULT_LOGIN_IP_LIMIT = void 0;
|
|
4
4
|
exports.frameworkSchemasOf = frameworkSchemasOf;
|
|
5
5
|
exports.isDevOrTestNodeEnv = isDevOrTestNodeEnv;
|
|
6
6
|
exports.loadPoolTuning = loadPoolTuning;
|
|
@@ -146,6 +146,12 @@ function poolTuningOf(config) {
|
|
|
146
146
|
* in the budget (5.F), whether or not `auth: true` starts the sealer.
|
|
147
147
|
*/
|
|
148
148
|
exports.AUDIT_SEALER_POOL_CONNECTIONS = 1;
|
|
149
|
+
/**
|
|
150
|
+
* The engine lock-probe pool (agent-proposals SPEC §5 J, FW-R1/1): two connections per worker on
|
|
151
|
+
* the engine's runtime account (same config as the engine pool), always counted in the budget in
|
|
152
|
+
* both layouts, next to the sealer's. Must equal `@astram/engine`'s `LOCK_PROBE_POOL_CONNECTIONS`.
|
|
153
|
+
*/
|
|
154
|
+
exports.ENGINE_LOCK_PROBE_POOL_CONNECTIONS = 2;
|
|
149
155
|
/**
|
|
150
156
|
* Build the {@link PoolBudgetConfig} from env with documented defaults.
|
|
151
157
|
* Field ↔ env name:
|
|
@@ -528,12 +534,15 @@ function parseStorageMaxBytes(raw) {
|
|
|
528
534
|
*/
|
|
529
535
|
function evaluatePoolBudget(cfg) {
|
|
530
536
|
// Single layout (AC-12): one account opens core + engine + authz; app_crud/schema_svc are never opened.
|
|
531
|
-
// Both layouts add the audit sealer's own pool (G-026 spec 5.F: 1 per worker, always counted)
|
|
537
|
+
// Both layouts add the audit sealer's own pool (G-026 spec 5.F: 1 per worker, always counted) and
|
|
538
|
+
// the engine lock-probe pool (agent-proposals SPEC §5 J: 2 per worker, always counted).
|
|
532
539
|
const perWorkerConnections = (cfg.layout === 'single'
|
|
533
540
|
? cfg.perAccountMax.shield_core + (cfg.engineMax ?? 10) + (cfg.authzMax ?? 4)
|
|
534
541
|
: cfg.perAccountMax.shield_core +
|
|
535
542
|
cfg.perAccountMax.shield_app_crud +
|
|
536
|
-
cfg.perAccountMax.shield_schema_svc) +
|
|
543
|
+
cfg.perAccountMax.shield_schema_svc) +
|
|
544
|
+
exports.AUDIT_SEALER_POOL_CONNECTIONS +
|
|
545
|
+
exports.ENGINE_LOCK_PROBE_POOL_CONNECTIONS;
|
|
537
546
|
const runtimeConnections = cfg.workers * perWorkerConnections;
|
|
538
547
|
const requiredConnections = runtimeConnections + cfg.headroom;
|
|
539
548
|
const slack = cfg.maxConnections - requiredConnections;
|
package/dist/index.d.ts
CHANGED
|
@@ -51,8 +51,9 @@ export { loadNotificationConfig, type NotificationConfig } from './config/notifi
|
|
|
51
51
|
export { SHIELD_NOTIFICATIONS } from './auth/tokens.js';
|
|
52
52
|
export { ObjectStoreBootCheck } from './storage/object-store-boot-check.js';
|
|
53
53
|
export { FileIntake, FILE_INTAKE_REQUEST_KEY, FILE_INTAKE_DEFAULT_MAX_BYTES, type FileIntakeOptions, type FileIntakeResult, } from './storage/file-intake.interceptor.js';
|
|
54
|
-
export type { ShieldStorageOption } from './storage/storage.providers.js';
|
|
55
|
-
export {
|
|
54
|
+
export type { ShieldStorageOption, AppFileProfile } from './storage/storage.providers.js';
|
|
55
|
+
export { APP_CONTENT_TYPE_DENY_LIST, MAX_APP_FILE_PROFILES, isDeniedAppContentType, } from './storage/storage.providers.js';
|
|
56
|
+
export { SHIELD_OBJECT_STORE, SHIELD_FILE_INGEST, SHIELD_AGENT_FILE_READER, type AgentFileReader, type OpenedFileLike, SHIELD_PROPOSAL_PORT, SHIELD_PROPOSAL_READER, SHIELD_AGENT_TASK_CALLS, type ProposalPort, type ProposalReader, type ProposalReaderQuery, type ProposalReaderState, type ProposalDraftLike, type ProposalProvenanceLike, type SubmittedProposalLike, type ProposalSummaryLike, type ProposalSummaryPage, type AgentTaskCalls, } from './module/shield-tokens.js';
|
|
56
57
|
export { loadObjectStorageConfig, DEFAULT_OBJECT_STORAGE_MAX_BYTES, type ObjectStorageConfig, type LoadObjectStorageConfigOptions, } from './config/app-config.js';
|
|
57
58
|
export { MariaDbSessionRecordStore, SHIELD_SESSION_RECORD_STORE, RedisHotSessionStore, SHIELD_HOT_SESSION_STORE, RedisRecentRotationStore, type RedisRecentRotationStoreOptions, CryptoTokenGenerator, Sha256RefreshTokenHasher, SystemClock, cryptoTokenGeneratorProvider, refreshHasherProvider, systemClockProvider, SHIELD_TOKEN_GENERATOR, SHIELD_REFRESH_HASHER, SHIELD_CLOCK, HotRevokingSessionRecordStore, type SessionHotRevoker, type LineageSessionLookup, SHIELD_SESSION_LIFETIMES, ROTATE_GRACE_MS, accessBindingTtlMs, } from './session/index.js';
|
|
58
59
|
export { MariaDbRecordPermissionRuleAdapter, SHIELD_RECORD_RULE_PORT, type RuleQueryable, } from './authz/mariadb-record-rule-adapter.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,aAAa,EACb,kBAAkB,EAClB,UAAU,EACV,SAAS,EACT,KAAK,WAAW,EAChB,KAAK,eAAe,GACrB,MAAM,gCAAgC,CAAC;AAGxC,OAAO,EACL,YAAY,EACZ,yBAAyB,EAGzB,2BAA2B,EAC3B,KAAK,mBAAmB,EACxB,KAAK,wBAAwB,EAI7B,KAAK,yBAAyB,GAC/B,MAAM,2BAA2B,CAAC;AAGnC,OAAO,EACL,MAAM,EACN,UAAU,EACV,uBAAuB,EACvB,yBAAyB,EACzB,uBAAuB,GACxB,MAAM,2CAA2C,CAAC;AACnD,YAAY,EAAE,cAAc,EAAE,MAAM,2CAA2C,CAAC;AAKhF,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,iBAAiB,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AAKpG,OAAO,EAAE,yBAAyB,EAAE,MAAM,+CAA+C,CAAC;AAC1F,OAAO,EAAE,iBAAiB,EAAE,sBAAsB,EAAE,MAAM,sCAAsC,CAAC;AACjG,YAAY,EAAE,gBAAgB,EAAE,MAAM,sCAA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AM,gCAAgC,CAAC;AACvE,YAAY,EAAE,cAAc,EAAE,MAAM,iCAAiC,CAAC;AACtE,YAAY,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,kCAAkC,CAAC;AAClF,YAAY,EAAE,SAAS,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AAK5E,YAAY,EAAE,qBAAqB,EAAE,MAAM,yCAAyC,CAAC;AACrF,OAAO,EAAE,8BAA8B,EAAE,MAAM,kBAAkB,CAAC;AAMlE,YAAY,EAAE,oBAAoB,EAAE,MAAM,wCAAwC,CAAC;AACnF,OAAO,EAAE,6BAA6B,EAAE,MAAM,kBAAkB,CAAC;AAOjE,OAAO,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAC3D,OAAO,EACL,eAAe,EACf,oBAAoB,EACpB,KAAK,mBAAmB,GACzB,MAAM,6BAA6B,CAAC;AAGrC,OAAO,EACL,mBAAmB,EACnB,qBAAqB,EACrB,gBAAgB,EAChB,KAAK,SAAS,EACd,KAAK,eAAe,GACrB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EACL,kBAAkB,EAClB,kBAAkB,EAClB,0BAA0B,GAC3B,MAAM,kBAAkB,CAAC;AAK1B,OAAO,EACL,kBAAkB,EAClB,eAAe,EACf,qBAAqB,GACtB,MAAM,2BAA2B,CAAC;AAKnC,OAAO,EAAE,iBAAiB,EAAE,MAAM,8BAA8B,CAAC;AAEjE,OAAO,EAAE,sBAAsB,EAAE,MAAM,oCAAoC,CAAC;AAQ5E,OAAO,EACL,gBAAgB,EAChB,eAAe,EACf,eAAe,EACf,uBAAuB,EACvB,KAAK,SAAS,EACd,KAAK,UAAU,GAChB,MAAM,4BAA4B,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -17,10 +17,10 @@
|
|
|
17
17
|
*/
|
|
18
18
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
19
19
|
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.currentRequestPrincipal = 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.
|
|
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 = exports.hmacSha1 = exports.resolveTotpVerifier = exports.makeDefaultTotpVerifier = exports.AuthModule = void 0;
|
|
20
|
+
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_AGENT_TASK_CALLS = exports.SHIELD_PROPOSAL_READER = exports.SHIELD_PROPOSAL_PORT = exports.SHIELD_AGENT_FILE_READER = exports.SHIELD_FILE_INGEST = exports.SHIELD_OBJECT_STORE = exports.isDeniedAppContentType = exports.MAX_APP_FILE_PROFILES = exports.APP_CONTENT_TYPE_DENY_LIST = 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 = exports.resolveBootSecrets = void 0;
|
|
21
|
+
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 = exports.translateListScope = exports.SHIELD_LIST_SCOPE_PORT = exports.MariaDbListScopeAdapter = exports.SHIELD_POLICY_STORE = exports.MariaDbPolicyStore = exports.SHIELD_RECORD_RULE_PORT = exports.MariaDbRecordPermissionRuleAdapter = exports.accessBindingTtlMs = void 0;
|
|
22
|
+
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 = exports.DEFAULT_DB_CONFIG = exports.assertRefreshHmacKey = exports.loadRefreshHmacKey = exports.loadSessionLifetimes = exports.loadRedisConfig = exports.loadDbConfig = exports.SCHEMA_SVC_POOL_HARD_CAP = exports.DEFAULT_POOL_BUDGET = 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 = 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 = 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");
|
|
@@ -192,10 +192,19 @@ var file_intake_interceptor_js_1 = require("./storage/file-intake.interceptor.js
|
|
|
192
192
|
Object.defineProperty(exports, "FileIntake", { enumerable: true, get: function () { return file_intake_interceptor_js_1.FileIntake; } });
|
|
193
193
|
Object.defineProperty(exports, "FILE_INTAKE_REQUEST_KEY", { enumerable: true, get: function () { return file_intake_interceptor_js_1.FILE_INTAKE_REQUEST_KEY; } });
|
|
194
194
|
Object.defineProperty(exports, "FILE_INTAKE_DEFAULT_MAX_BYTES", { enumerable: true, get: function () { return file_intake_interceptor_js_1.FILE_INTAKE_DEFAULT_MAX_BYTES; } });
|
|
195
|
+
// DP1 (app-file-profiles SPEC §10): the content types an app profile may never use.
|
|
196
|
+
var storage_providers_js_1 = require("./storage/storage.providers.js");
|
|
197
|
+
Object.defineProperty(exports, "APP_CONTENT_TYPE_DENY_LIST", { enumerable: true, get: function () { return storage_providers_js_1.APP_CONTENT_TYPE_DENY_LIST; } });
|
|
198
|
+
Object.defineProperty(exports, "MAX_APP_FILE_PROFILES", { enumerable: true, get: function () { return storage_providers_js_1.MAX_APP_FILE_PROFILES; } });
|
|
199
|
+
Object.defineProperty(exports, "isDeniedAppContentType", { enumerable: true, get: function () { return storage_providers_js_1.isDeniedAppContentType; } });
|
|
195
200
|
var shield_tokens_js_1 = require("./module/shield-tokens.js");
|
|
196
201
|
Object.defineProperty(exports, "SHIELD_OBJECT_STORE", { enumerable: true, get: function () { return shield_tokens_js_1.SHIELD_OBJECT_STORE; } });
|
|
197
202
|
Object.defineProperty(exports, "SHIELD_FILE_INGEST", { enumerable: true, get: function () { return shield_tokens_js_1.SHIELD_FILE_INGEST; } });
|
|
198
203
|
Object.defineProperty(exports, "SHIELD_AGENT_FILE_READER", { enumerable: true, get: function () { return shield_tokens_js_1.SHIELD_AGENT_FILE_READER; } });
|
|
204
|
+
// agent-proposals SPEC v7 §5 F / §5 I, plan D-6.
|
|
205
|
+
Object.defineProperty(exports, "SHIELD_PROPOSAL_PORT", { enumerable: true, get: function () { return shield_tokens_js_1.SHIELD_PROPOSAL_PORT; } });
|
|
206
|
+
Object.defineProperty(exports, "SHIELD_PROPOSAL_READER", { enumerable: true, get: function () { return shield_tokens_js_1.SHIELD_PROPOSAL_READER; } });
|
|
207
|
+
Object.defineProperty(exports, "SHIELD_AGENT_TASK_CALLS", { enumerable: true, get: function () { return shield_tokens_js_1.SHIELD_AGENT_TASK_CALLS; } });
|
|
199
208
|
var app_config_js_1 = require("./config/app-config.js");
|
|
200
209
|
Object.defineProperty(exports, "loadObjectStorageConfig", { enumerable: true, get: function () { return app_config_js_1.loadObjectStorageConfig; } });
|
|
201
210
|
Object.defineProperty(exports, "DEFAULT_OBJECT_STORAGE_MAX_BYTES", { enumerable: true, get: function () { return app_config_js_1.DEFAULT_OBJECT_STORAGE_MAX_BYTES; } });
|
package/dist/internal.d.ts
CHANGED
|
@@ -76,6 +76,12 @@ export { requestFactsVersion } from './enforcement/global-enforcement.guard.js';
|
|
|
76
76
|
* fetch refuses a call made inside a request that has no principal (`@Public()` or refused).
|
|
77
77
|
*/
|
|
78
78
|
export { insideRequest } from './request-auth/request-principal-als.js';
|
|
79
|
+
/**
|
|
80
|
+
* For `@astram/agent` (mint) and `@astram/identity` (check) only (agent-proposals plan D-9):
|
|
81
|
+
* ⛔ UNFORGEABLE agent provenance. Only the agent executor mints; identity's proposal submit
|
|
82
|
+
* refuses `origin: 'agent'` unless the provenance is the minted object (`forbidden`).
|
|
83
|
+
*/
|
|
84
|
+
export { AGENT_PROVENANCE_ID_MAX, isMintedAgentProvenance, mintAgentProvenance, type AgentProvenance, } from './agent/agent-provenance.js';
|
|
79
85
|
/** For `@astram/agent` only (SPEC §5 `AgentModule` env): the runtime URL rule's loopback check. */
|
|
80
86
|
export { isLoopbackHost } from './config/loopback-host.js';
|
|
81
87
|
//# 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,MAA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AM,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;;;;GAIG;AACH,OAAO,EAAE,aAAa,EAAE,MAAM,yCAAyC,CAAC;AACxE;;;;GAIG;AACH,OAAO,EACL,uBAAuB,EACvB,uBAAuB,EACvB,mBAAmB,EACnB,KAAK,eAAe,GACrB,MAAM,6BAA6B,CAAC;AACrC,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.isLoopbackHost = exports.insideRequest = 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;
|
|
3
|
+
exports.isLoopbackHost = exports.mintAgentProvenance = exports.isMintedAgentProvenance = exports.AGENT_PROVENANCE_ID_MAX = exports.insideRequest = 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
|
*
|
|
@@ -98,6 +98,15 @@ Object.defineProperty(exports, "requestFactsVersion", { enumerable: true, get: f
|
|
|
98
98
|
*/
|
|
99
99
|
var request_principal_als_js_1 = require("./request-auth/request-principal-als.js");
|
|
100
100
|
Object.defineProperty(exports, "insideRequest", { enumerable: true, get: function () { return request_principal_als_js_1.insideRequest; } });
|
|
101
|
+
/**
|
|
102
|
+
* For `@astram/agent` (mint) and `@astram/identity` (check) only (agent-proposals plan D-9):
|
|
103
|
+
* ⛔ UNFORGEABLE agent provenance. Only the agent executor mints; identity's proposal submit
|
|
104
|
+
* refuses `origin: 'agent'` unless the provenance is the minted object (`forbidden`).
|
|
105
|
+
*/
|
|
106
|
+
var agent_provenance_js_1 = require("./agent/agent-provenance.js");
|
|
107
|
+
Object.defineProperty(exports, "AGENT_PROVENANCE_ID_MAX", { enumerable: true, get: function () { return agent_provenance_js_1.AGENT_PROVENANCE_ID_MAX; } });
|
|
108
|
+
Object.defineProperty(exports, "isMintedAgentProvenance", { enumerable: true, get: function () { return agent_provenance_js_1.isMintedAgentProvenance; } });
|
|
109
|
+
Object.defineProperty(exports, "mintAgentProvenance", { enumerable: true, get: function () { return agent_provenance_js_1.mintAgentProvenance; } });
|
|
101
110
|
/** For `@astram/agent` only (SPEC §5 `AgentModule` env): the runtime URL rule's loopback check. */
|
|
102
111
|
var loopback_host_js_1 = require("./config/loopback-host.js");
|
|
103
112
|
Object.defineProperty(exports, "isLoopbackHost", { enumerable: true, get: function () { return loopback_host_js_1.isLoopbackHost; } });
|
|
@@ -66,4 +66,107 @@ export interface AgentFileReader {
|
|
|
66
66
|
* token is the seam. Unbound without identity.
|
|
67
67
|
*/
|
|
68
68
|
export declare const SHIELD_AGENT_FILE_READER: unique symbol;
|
|
69
|
+
/** A proposal as submitted (SPEC §5 B): the kind's payload plus plain-text title and metadata. */
|
|
70
|
+
export interface ProposalDraftLike {
|
|
71
|
+
readonly kind: string;
|
|
72
|
+
readonly payload: unknown;
|
|
73
|
+
readonly title: string;
|
|
74
|
+
readonly rationale?: string;
|
|
75
|
+
readonly metadata?: unknown;
|
|
76
|
+
}
|
|
77
|
+
/**
|
|
78
|
+
* Who proposed (SPEC §5 B): set by the framework, never by a payload or a request body.
|
|
79
|
+
* `origin: 'agent'` provenance is minted only by the agent executor (`mintAgentProvenance`,
|
|
80
|
+
* `@astram/guard/internal`); app code that submits with an agent origin is refused (`forbidden`).
|
|
81
|
+
*/
|
|
82
|
+
export type ProposalProvenanceLike = {
|
|
83
|
+
readonly origin: 'user';
|
|
84
|
+
} | {
|
|
85
|
+
readonly origin: 'agent';
|
|
86
|
+
readonly taskId: string;
|
|
87
|
+
readonly callId: string;
|
|
88
|
+
};
|
|
89
|
+
/** What a submit returns (SPEC §5 E): counts only, never the payload. */
|
|
90
|
+
export interface SubmittedProposalLike {
|
|
91
|
+
/** The proposal's uuid (the agent turns it into a task handle; never sent to the runtime). */
|
|
92
|
+
readonly uuid: string;
|
|
93
|
+
readonly kind: string;
|
|
94
|
+
readonly title: string;
|
|
95
|
+
readonly items: number;
|
|
96
|
+
readonly refused: number;
|
|
97
|
+
readonly annotated: number;
|
|
98
|
+
readonly state: 'pending';
|
|
99
|
+
}
|
|
100
|
+
/**
|
|
101
|
+
* The submit port (SPEC §5 F): `submit` only. Bound by `@astram/identity` per request (the request's
|
|
102
|
+
* user, `decide()` on every call); `@astram/agent` injects it for a `propose` capability.
|
|
103
|
+
*/
|
|
104
|
+
export interface ProposalPort {
|
|
105
|
+
submit(draft: ProposalDraftLike, provenance: ProposalProvenanceLike): Promise<SubmittedProposalLike>;
|
|
106
|
+
}
|
|
107
|
+
/** The states the proposals reader may list (SPEC §5 I, §10). */
|
|
108
|
+
export type ProposalReaderState = 'pending' | 'approved' | 'rejected';
|
|
109
|
+
/** One reader query (SPEC §5 I): one kind; tenant and user come from the session only. */
|
|
110
|
+
export interface ProposalReaderQuery {
|
|
111
|
+
readonly kind: string;
|
|
112
|
+
readonly state: ProposalReaderState;
|
|
113
|
+
readonly page: number;
|
|
114
|
+
readonly pageSize: number;
|
|
115
|
+
}
|
|
116
|
+
/** One reader row (SPEC §5 I, §10): no payload, no items, no requester id or name. */
|
|
117
|
+
export interface ProposalSummaryLike {
|
|
118
|
+
/** The proposal's uuid: `@astram/agent` swaps it for a task handle before anything leaves. */
|
|
119
|
+
readonly uuid: string;
|
|
120
|
+
readonly kind: string;
|
|
121
|
+
readonly kindLabel: string;
|
|
122
|
+
readonly title: string;
|
|
123
|
+
readonly state: string;
|
|
124
|
+
readonly origin: 'user' | 'agent';
|
|
125
|
+
readonly requestedByMe: boolean;
|
|
126
|
+
readonly counts: {
|
|
127
|
+
readonly create: number;
|
|
128
|
+
readonly update: number;
|
|
129
|
+
};
|
|
130
|
+
readonly selected: number;
|
|
131
|
+
readonly createdAt: string;
|
|
132
|
+
readonly expiresAt: string;
|
|
133
|
+
readonly decidedAt?: string;
|
|
134
|
+
}
|
|
135
|
+
/** A reader page (SPEC §5 I): `total` is a COUNT over the same WHERE. */
|
|
136
|
+
export interface ProposalSummaryPage {
|
|
137
|
+
readonly rows: readonly ProposalSummaryLike[];
|
|
138
|
+
readonly total: number;
|
|
139
|
+
readonly page: number;
|
|
140
|
+
readonly pageSize: number;
|
|
141
|
+
}
|
|
142
|
+
/**
|
|
143
|
+
* The read-only proposals reader (SPEC §5 F, §5 I): `kinds()` (the bound kind ids, read at agent
|
|
144
|
+
* boot) and `list()` (the same `ProposalService.list` as `GET /identity/proposals`, as the
|
|
145
|
+
* request's user). No write, decision or apply method.
|
|
146
|
+
*/
|
|
147
|
+
export interface ProposalReader {
|
|
148
|
+
kinds(): readonly string[];
|
|
149
|
+
list(query: ProposalReaderQuery): Promise<ProposalSummaryPage>;
|
|
150
|
+
}
|
|
151
|
+
/**
|
|
152
|
+
* `ProposalPort` (SPEC §5 F), bound by `@astram/identity`'s `IdentityFeatureModule` in a framework
|
|
153
|
+
* module (request-scoped), injected by `@astram/agent`. Unbound without identity.
|
|
154
|
+
*/
|
|
155
|
+
export declare const SHIELD_PROPOSAL_PORT: unique symbol;
|
|
156
|
+
/**
|
|
157
|
+
* `ProposalReader` (SPEC §5 F, §5 I), bound by `@astram/identity` next to the port, read-only.
|
|
158
|
+
* Unbound without identity.
|
|
159
|
+
*/
|
|
160
|
+
export declare const SHIELD_PROPOSAL_READER: unique symbol;
|
|
161
|
+
/**
|
|
162
|
+
* The read-only evidence seam (plan D-6, SPEC §5 B): the call ids of one agent task, read for the
|
|
163
|
+
* REQUEST'S tenant AND user only (another tenant's or another user's task ⇒ `[]`). Exactly one
|
|
164
|
+
* method. Bound by `@astram/agent`'s `AgentModule` (request-scoped), injected optionally by
|
|
165
|
+
* identity's `ProposalService`; unbound ⇒ every `agent_action` evidence ref is dropped and counted.
|
|
166
|
+
*/
|
|
167
|
+
export interface AgentTaskCalls {
|
|
168
|
+
callIdsOf(taskId: string): Promise<readonly string[]>;
|
|
169
|
+
}
|
|
170
|
+
/** Token of {@link AgentTaskCalls} (plan D-6). */
|
|
171
|
+
export declare const SHIELD_AGENT_TASK_CALLS: unique symbol;
|
|
69
172
|
//# sourceMappingURL=shield-tokens.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"shield-tokens.d.ts","sourceRoot":"","sources":["../../src/module/shield-tokens.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH;;;;;;;;;;GAUG;AACH,OAAO,EAAE,yBAAyB,EAAE,MAAM,cAAc,CAAC;AAEzD;;;;;;;;;;GAUG;AACH,eAAO,MAAM,2BAA2B,eAAwC,CAAC;AAEjF;;;;GAIG;AACH,eAAO,MAAM,mBAAmB,eAAgC,CAAC;AAEjE;;;GAGG;AACH,eAAO,MAAM,kBAAkB,eAA+B,CAAC;AAE/D;;;;GAIG;AACH,MAAM,WAAW,cAAc;IAC7B,QAAQ,CAAC,KAAK,EAAE,UAAU,CAAC;IAC3B,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC;IAC9B,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;CAC5B;AAED,iGAAiG;AACjG,MAAM,WAAW,eAAe;IAC9B,qGAAqG;IACrG,IAAI,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,cAAc,CAAC,CAAC;CAC7C;AAED;;;;;;;;GAQG;AACH,eAAO,MAAM,wBAAwB,eAAqC,CAAC"}
|
|
1
|
+
{"version":3,"file":"shield-tokens.d.ts","sourceRoot":"","sources":["../../src/module/shield-tokens.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH;;;;;;;;;;GAUG;AACH,OAAO,EAAE,yBAAyB,EAAE,MAAM,cAAc,CAAC;AAEzD;;;;;;;;;;GAUG;AACH,eAAO,MAAM,2BAA2B,eAAwC,CAAC;AAEjF;;;;GAIG;AACH,eAAO,MAAM,mBAAmB,eAAgC,CAAC;AAEjE;;;GAGG;AACH,eAAO,MAAM,kBAAkB,eAA+B,C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;AAED,yEAAyE;AACzE,MAAM,WAAW,mBAAmB;IAClC,QAAQ,CAAC,IAAI,EAAE,SAAS,mBAAmB,EAAE,CAAC;IAC9C,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;CAC3B;AAED;;;;GAIG;AACH,MAAM,WAAW,cAAc;IAC7B,KAAK,IAAI,SAAS,MAAM,EAAE,CAAC;IAC3B,IAAI,CAAC,KAAK,EAAE,mBAAmB,GAAG,OAAO,CAAC,mBAAmB,CAAC,CAAC;CAChE;AAED;;;GAGG;AACH,eAAO,MAAM,oBAAoB,eAAiC,CAAC;AAEnE;;;GAGG;AACH,eAAO,MAAM,sBAAsB,eAAmC,CAAC;AAEvE;;;;;GAKG;AACH,MAAM,WAAW,cAAc;IAC7B,SAAS,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,SAAS,MAAM,EAAE,CAAC,CAAC;CACvD;AAED,kDAAkD;AAClD,eAAO,MAAM,uBAAuB,eAAoC,CAAC"}
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
* with no cycle. `shield.module.ts` re-exports these for the public barrel.
|
|
8
8
|
*/
|
|
9
9
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
-
exports.SHIELD_AGENT_FILE_READER = exports.SHIELD_FILE_INGEST = exports.SHIELD_OBJECT_STORE = exports.SHIELD_RECORD_AUTHORIZATION = exports.SHIELD_DECISION_AUTHORITY = void 0;
|
|
10
|
+
exports.SHIELD_AGENT_TASK_CALLS = exports.SHIELD_PROPOSAL_READER = exports.SHIELD_PROPOSAL_PORT = exports.SHIELD_AGENT_FILE_READER = exports.SHIELD_FILE_INGEST = exports.SHIELD_OBJECT_STORE = exports.SHIELD_RECORD_AUTHORIZATION = exports.SHIELD_DECISION_AUTHORITY = void 0;
|
|
11
11
|
/**
|
|
12
12
|
* The Core decision authority (`@astram/core`'s `DecisionAuthority`) — the single
|
|
13
13
|
* ADR-0001 decision entry both the global enforcement guard and the engine's
|
|
@@ -54,3 +54,15 @@ exports.SHIELD_FILE_INGEST = Symbol('SHIELD_FILE_INGEST');
|
|
|
54
54
|
* token is the seam. Unbound without identity.
|
|
55
55
|
*/
|
|
56
56
|
exports.SHIELD_AGENT_FILE_READER = Symbol('SHIELD_AGENT_FILE_READER');
|
|
57
|
+
/**
|
|
58
|
+
* `ProposalPort` (SPEC §5 F), bound by `@astram/identity`'s `IdentityFeatureModule` in a framework
|
|
59
|
+
* module (request-scoped), injected by `@astram/agent`. Unbound without identity.
|
|
60
|
+
*/
|
|
61
|
+
exports.SHIELD_PROPOSAL_PORT = Symbol('SHIELD_PROPOSAL_PORT');
|
|
62
|
+
/**
|
|
63
|
+
* `ProposalReader` (SPEC §5 F, §5 I), bound by `@astram/identity` next to the port, read-only.
|
|
64
|
+
* Unbound without identity.
|
|
65
|
+
*/
|
|
66
|
+
exports.SHIELD_PROPOSAL_READER = Symbol('SHIELD_PROPOSAL_READER');
|
|
67
|
+
/** Token of {@link AgentTaskCalls} (plan D-6). */
|
|
68
|
+
exports.SHIELD_AGENT_TASK_CALLS = Symbol('SHIELD_AGENT_TASK_CALLS');
|
|
@@ -18,7 +18,7 @@ import { type AppConfig } from '../config/app-config.js';
|
|
|
18
18
|
import { SHIELD_DECISION_AUTHORITY, SHIELD_RECORD_AUTHORIZATION } from './shield-tokens.js';
|
|
19
19
|
import type { SignInMethod } from '../authentication/sign-in-with.js';
|
|
20
20
|
export { SHIELD_DECISION_AUTHORITY, SHIELD_RECORD_AUTHORIZATION };
|
|
21
|
-
import { type ShieldStorageOption } from '../storage/storage.providers.js';
|
|
21
|
+
import { type AppFileProfile, 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
24
|
/**
|
|
@@ -247,6 +247,20 @@ export interface ShieldModuleOptions {
|
|
|
247
247
|
* profile's cap; otherwise each keeps its default (xlsx/csv/docx 10 MiB, pdf 20 MiB).
|
|
248
248
|
*/
|
|
249
249
|
readonly fileProfiles?: readonly ShippedFileProfileName[];
|
|
250
|
+
/**
|
|
251
|
+
* DP1 (app-file-profiles SPEC §5 A–B): up to 16 consumer-owned upload profiles registered on
|
|
252
|
+
* `SHIELD_FILE_INGEST` next to `fileProfiles`, each `{ name, profile }` (core `FileProfile` with
|
|
253
|
+
* its own `magic`). Checked at registration: name `^[a-z][a-z0-9_]{0,31}$` and not shipped;
|
|
254
|
+
* content types plain lower-case `type/subtype` (stricter than the SPEC, plan D-2), not denied
|
|
255
|
+
* (`isDeniedAppContentType`: html, octet-stream, xml and any `+xml`, php, wasm, shell/script,
|
|
256
|
+
* javascript variants; wider than the SPEC), never a shipped profile's (registered or not) or
|
|
257
|
+
* another app profile's; extensions `^\.[a-z0-9]{1,10}$`, not shared. A bad entry fails the boot
|
|
258
|
+
* naming its index and rule. An explicit `OBJECT_STORAGE_MAX_BYTES` can only LOWER an app
|
|
259
|
+
* profile's `maxBytes`, never raise it (stricter than the SPEC; shipped profiles keep the replace
|
|
260
|
+
* rule). A ZIP-based profile's `magic`
|
|
261
|
+
* MUST call core `zipWithinLimits` first. App types never reach the file analyser (DP2).
|
|
262
|
+
*/
|
|
263
|
+
readonly appFileProfiles?: readonly AppFileProfile[];
|
|
250
264
|
/**
|
|
251
265
|
* G-027 step 2 (notification-store SPEC §5C): the kinds app code may post notices under, each
|
|
252
266
|
* `{ kind, category: 'announcement' | 'personal' }`. Kind pattern
|
|
@@ -373,6 +387,8 @@ export interface ShieldModuleAsyncOptions {
|
|
|
373
387
|
readonly storage?: ShieldStorageOption;
|
|
374
388
|
/** See {@link ShieldModuleOptions.fileProfiles}. STATIC here (registration-time, like `storage`). */
|
|
375
389
|
readonly fileProfiles?: readonly ShippedFileProfileName[];
|
|
390
|
+
/** See {@link ShieldModuleOptions.appFileProfiles}. STATIC here (registration-time). */
|
|
391
|
+
readonly appFileProfiles?: readonly AppFileProfile[];
|
|
376
392
|
/** See {@link ShieldModuleOptions.notificationKinds}. STATIC here (registration-time). */
|
|
377
393
|
readonly notificationKinds?: readonly NotificationKindRegistration[];
|
|
378
394
|
}
|
|
@@ -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,EACV,kBAAkB,EAClB,cAAc,EAEd,sBAAsB,EACvB,MAAM,cAAc,CAAC;AAQtB,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,EAAE,MAAM,iCAAiC,CAAC;AACrE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,kCAAkC,CAAC;AACvE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,mCAAmC,CAAC;AACxE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,6BAA6B,CAAC;AAC7D,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,0CAA0C,CAAC;AACtF,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,yCAAyC,CAAC;AACpF,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,qCAAqC,CAAC;AAC7E,OAAO,KAAK,EAAE,qBAAqB,EAAE,M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let ShieldModule = class ShieldModule {
|
|
|
336
336
|
},
|
|
337
337
|
frameworkSchemasProvider,
|
|
338
338
|
migrationLedgerRegistryProvider,
|
|
339
|
-
...(0, storage_providers_js_1.storageProviders)(options.storage, options.fileProfiles),
|
|
339
|
+
...(0, storage_providers_js_1.storageProviders)(options.storage, options.fileProfiles, options.appFileProfiles),
|
|
340
340
|
],
|
|
341
341
|
// Re-export the composed AuthModule app-wide ONLY when auth is opted in — its
|
|
342
342
|
// own `exports` (SHIELD_AUTHENTICATOR / SHIELD_SESSION_AUTHORITY) then become
|
|
@@ -468,7 +468,7 @@ let ShieldModule = class ShieldModule {
|
|
|
468
468
|
authorityProvider,
|
|
469
469
|
frameworkSchemasProvider,
|
|
470
470
|
migrationLedgerRegistryProvider,
|
|
471
|
-
...(0, storage_providers_js_1.storageProviders)(options.storage, options.fileProfiles),
|
|
471
|
+
...(0, storage_providers_js_1.storageProviders)(options.storage, options.fileProfiles, options.appFileProfiles),
|
|
472
472
|
],
|
|
473
473
|
exports: [
|
|
474
474
|
config_module_js_1.APP_CONFIG,
|
|
@@ -11,6 +11,8 @@ export declare const FRAMEWORK_KIND_PREFIX = "shield.";
|
|
|
11
11
|
/**
|
|
12
12
|
* The framework's own kinds. G-027 step 3: `shield.access_changed` (identity's
|
|
13
13
|
* `AccessChangeNotifier`, a personal notice listing the recipient's gained / lost capabilities).
|
|
14
|
+
* G-036 M3 (agent-proposals SPEC §5 B, §10): `shield.proposal_pending` (identity's
|
|
15
|
+
* `ProposalService`, posted to the holders of a kind's `review` key when a proposal is submitted).
|
|
14
16
|
*/
|
|
15
17
|
export declare const FRAMEWORK_NOTIFICATION_KINDS: readonly NotificationKindRegistration[];
|
|
16
18
|
export interface NotificationPostInput {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"notification.service.d.ts","sourceRoot":"","sources":["../../src/notifications/notification.service.ts"],"names":[],"mappings":"AA4BA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,SAAS,CAAC;AACpC,OAAO,EAGL,KAAK,oBAAoB,EAC1B,MAAM,qCAAqC,CAAC;AAC7C,OAAO,EASL,KAAK,oBAAoB,EAEzB,KAAK,4BAA4B,EAEjC,KAAK,oBAAoB,EACzB,KAAK,iBAAiB,EACtB,KAAK,wBAAwB,EAC9B,MAAM,YAAY,CAAC;AAEpB,uBAAuB;AACvB,eAAO,MAAM,sBAAsB,MAAM,CAAC;AAC1C,eAAO,MAAM,qBAAqB,OAAO,CAAC;AAC1C,eAAO,MAAM,qBAAqB,MAAM,CAAC;AACzC,eAAO,MAAM,2BAA2B,OAAO,CAAC;AAchD,yDAAyD;AACzD,eAAO,MAAM,qBAAqB,YAAY,CAAC;AAE/C
|
|
1
|
+
{"version":3,"file":"notification.service.d.ts","sourceRoot":"","sources":["../../src/notifications/notification.service.ts"],"names":[],"mappings":"AA4BA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,SAAS,CAAC;AACpC,OAAO,EAGL,KAAK,oBAAoB,EAC1B,MAAM,qCAAqC,CAAC;AAC7C,OAAO,EASL,KAAK,oBAAoB,EAEzB,KAAK,4BAA4B,EAEjC,KAAK,oBAAoB,EACzB,KAAK,iBAAiB,EACtB,KAAK,wBAAwB,EAC9B,MAAM,YAAY,CAAC;AAEpB,uBAAuB;AACvB,eAAO,MAAM,sBAAsB,MAAM,CAAC;AAC1C,eAAO,MAAM,qBAAqB,OAAO,CAAC;AAC1C,eAAO,MAAM,qBAAqB,MAAM,CAAC;AACzC,eAAO,MAAM,2BAA2B,OAAO,CAAC;AAchD,yDAAyD;AACzD,eAAO,MAAM,qBAAqB,YAAY,CAAC;AAE/C;;;;;GAKG;AACH,eAAO,MAAM,4BAA4B,EAAE,SAAS,4BAA4B,EAa/E,CAAC;AAEF,MAAM,WAAW,qBAAqB;IACpC,kFAAkF;IAClF,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,oFAAoF;IACpF,QAAQ,CAAC,UAAU,EAAE,SAAS,MAAM,EA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IA8ClC,sFAAsF;YACxE,gBAAgB;CAwB/B"}
|
|
@@ -57,6 +57,8 @@ exports.FRAMEWORK_KIND_PREFIX = 'shield.';
|
|
|
57
57
|
/**
|
|
58
58
|
* The framework's own kinds. G-027 step 3: `shield.access_changed` (identity's
|
|
59
59
|
* `AccessChangeNotifier`, a personal notice listing the recipient's gained / lost capabilities).
|
|
60
|
+
* G-036 M3 (agent-proposals SPEC §5 B, §10): `shield.proposal_pending` (identity's
|
|
61
|
+
* `ProposalService`, posted to the holders of a kind's `review` key when a proposal is submitted).
|
|
60
62
|
*/
|
|
61
63
|
exports.FRAMEWORK_NOTIFICATION_KINDS = [
|
|
62
64
|
{
|
|
@@ -65,6 +67,12 @@ exports.FRAMEWORK_NOTIFICATION_KINDS = [
|
|
|
65
67
|
label: 'Access change',
|
|
66
68
|
severity: 'info',
|
|
67
69
|
},
|
|
70
|
+
{
|
|
71
|
+
kind: `${exports.FRAMEWORK_KIND_PREFIX}proposal_pending`,
|
|
72
|
+
category: 'personal',
|
|
73
|
+
label: 'Proposal to review',
|
|
74
|
+
severity: 'info',
|
|
75
|
+
},
|
|
68
76
|
];
|
|
69
77
|
/** Length in characters (code points), as `VARCHAR(n)` in utf8mb4 counts them. */
|
|
70
78
|
function codePoints(s) {
|
|
@@ -1,10 +1,43 @@
|
|
|
1
|
-
import type
|
|
2
|
-
import { type ObjectStore, type ShippedFileProfileName } from '@astram/core';
|
|
1
|
+
import { type Provider } from '@nestjs/common';
|
|
2
|
+
import { type FileProfile, type ObjectStore, type ShippedFileProfileName } from '@astram/core';
|
|
3
3
|
import { SHIELD_FILE_INGEST, SHIELD_OBJECT_STORE } from '../module/shield-tokens.js';
|
|
4
4
|
/** The `storage` option on `ShieldModule.forRoot` / `forRootAsync`. */
|
|
5
5
|
export type ShieldStorageOption = ObjectStore | 'env';
|
|
6
6
|
/** The tokens `ShieldModule` exports app-wide for the storage option. */
|
|
7
7
|
export declare const STORAGE_EXPORTS: readonly [typeof SHIELD_OBJECT_STORE, typeof SHIELD_FILE_INGEST];
|
|
8
|
+
/** One consumer-owned upload profile (`ShieldModule.forRoot({ appFileProfiles })`, DP1). */
|
|
9
|
+
export interface AppFileProfile {
|
|
10
|
+
/** `^[a-z][a-z0-9_]{0,31}$`, not a shipped name; the `FileIntake({ profile })` name. */
|
|
11
|
+
readonly name: string;
|
|
12
|
+
/**
|
|
13
|
+
* Core `FileProfile`: its own `magic` (a ZIP-based format MUST call core `zipWithinLimits`
|
|
14
|
+
* first), lower-case `type/subtype` content types (first = canonical), lower-case extensions.
|
|
15
|
+
*/
|
|
16
|
+
readonly profile: FileProfile;
|
|
17
|
+
}
|
|
18
|
+
/** At most this many app profiles (SPEC §10). */
|
|
19
|
+
export declare const MAX_APP_FILE_PROFILES = 16;
|
|
20
|
+
/**
|
|
21
|
+
* Types refused by exact match: the SPEC §10 list (html, xhtml, svg, javascript, shell,
|
|
22
|
+
* octet-stream) extended by the supervisor (2026-11-03, stricter than the SPEC) with xml, php,
|
|
23
|
+
* wasm, shell and script types and javascript variants. {@link isDeniedAppContentType} adds the
|
|
24
|
+
* class patterns (`+xml`, php, javascript family, shell and script subtypes).
|
|
25
|
+
*/
|
|
26
|
+
export declare const APP_CONTENT_TYPE_DENY_LIST: readonly string[];
|
|
27
|
+
/**
|
|
28
|
+
* True when an app profile may not use this (lower-case) content type: on the exact list or in a
|
|
29
|
+
* denied class. Types a browser could render or execute, scripts a server or desktop could run, or
|
|
30
|
+
* types that say nothing.
|
|
31
|
+
*/
|
|
32
|
+
export declare function isDeniedAppContentType(lowerType: string): boolean;
|
|
33
|
+
/**
|
|
34
|
+
* Validate `appFileProfiles` (SPEC §5 B, §10; plan D-2); throws at registration. Messages are
|
|
35
|
+
* fixed text naming the entry index and the rule (and a content type's or extension's position),
|
|
36
|
+
* never a value. `_shippedRegistered` is unused by the rules (a shipped type or extension is
|
|
37
|
+
* refused whether its profile is registered or not, technical answer 1) and kept for the call
|
|
38
|
+
* site's clarity.
|
|
39
|
+
*/
|
|
40
|
+
export declare function checkAppFileProfiles(entries: unknown, _shippedRegistered: readonly ShippedFileProfileName[]): readonly AppFileProfile[];
|
|
8
41
|
/** Build the storage providers for one `ShieldModule` registration (see the file header). */
|
|
9
|
-
export declare function storageProviders(storage: ShieldStorageOption | undefined, fileProfiles?: readonly ShippedFileProfileName[]): Provider[];
|
|
42
|
+
export declare function storageProviders(storage: ShieldStorageOption | undefined, fileProfiles?: readonly ShippedFileProfileName[], appFileProfiles?: readonly AppFileProfile[]): Provider[];
|
|
10
43
|
//# sourceMappingURL=storage.providers.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"storage.providers.d.ts","sourceRoot":"","sources":["../../src/storage/storage.providers.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"storage.providers.d.ts","sourceRoot":"","sources":["../../src/storage/storage.providers.ts"],"names":[],"mappings":"AAwBA,OAAO,EAAU,KAAK,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AACvD,OAAO,EAKL,KAAK,WAAW,EAChB,KAAK,WAAW,EAChB,KAAK,sBAAsB,EAC5B,MAAM,cAAc,CAAC;AAGtB,OAAO,EAAE,kBAAkB,EAAE,mBAAmB,EAAE,MAAM,4BAA4B,CAAC;AAIrF,uEAAuE;AACvE,MAAM,MAAM,mBAAmB,GAAG,WAAW,GAAG,KAAK,CAAC;AAEtD,yEAAyE;AACzE,eAAO,MAAM,eAAe,kEAAqD,CAAC;AA+BlF,4FAA4F;AAC5F,MAAM,WAAW,cAAc;IAC7B,wFAAwF;IACxF,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB;;;OAGG;IACH,QAAQ,CAAC,OAAO,EAAE,WAAW,CAAC;CAC/B;AAED,iDAAiD;AACjD,eAAO,MAAM,qBAAqB,KAAK,CAAC;AAKxC;;;;;GAKG;AACH,eAAO,MAAM,0BAA0B,EAAE,SAAS,MAAM,EA2CtD,CAAC;AAWH;;;;GAIG;AACH,wBAAgB,sBAAsB,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAIjE;AAaD;;;;;;GAMG;AACH,wBAAgB,oBAAoB,CAClC,OAAO,EAAE,OAAO,EAChB,kBAAkB,EAAE,SAAS,sBAAsB,EAAE,GACpD,SAAS,cAAc,EAAE,CA4E3B;AAED,6FAA6F;AAC7F,wBAAgB,gBAAgB,CAC9B,OAAO,EAAE,mBAAmB,GAAG,SAAS,EACxC,YAAY,GAAE,SAAS,sBAAsB,EAA0B,EACvE,eAAe,CAAC,EAAE,SAAS,cAAc,EAAE,GAC1C,QAAQ,EAAE,CAsEZ"}
|
|
@@ -33,7 +33,9 @@ var __importStar = (this && this.__importStar) || (function () {
|
|
|
33
33
|
};
|
|
34
34
|
})();
|
|
35
35
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
-
exports.STORAGE_EXPORTS = void 0;
|
|
36
|
+
exports.APP_CONTENT_TYPE_DENY_LIST = exports.MAX_APP_FILE_PROFILES = exports.STORAGE_EXPORTS = void 0;
|
|
37
|
+
exports.isDeniedAppContentType = isDeniedAppContentType;
|
|
38
|
+
exports.checkAppFileProfiles = checkAppFileProfiles;
|
|
37
39
|
exports.storageProviders = storageProviders;
|
|
38
40
|
/**
|
|
39
41
|
* `ShieldModule` providers for the `storage` and `fileProfiles` options (FILE_STORAGE SPEC §6,
|
|
@@ -50,9 +52,16 @@ exports.storageProviders = storageProviders;
|
|
|
50
52
|
* `fileProfiles` is validated when the providers are built, so a bad list aborts boot. Its
|
|
51
53
|
* messages are fixed text (an entry's position, never its value).
|
|
52
54
|
*
|
|
55
|
+
* `appFileProfiles` (app-file-profiles SPEC §5 A–B, DP1): up to 16 named consumer profiles
|
|
56
|
+
* registered on the same ingest next to the shipped ones, checked by {@link checkAppFileProfiles}
|
|
57
|
+
* at registration (index + rule in the message, never a value). Their content types and
|
|
58
|
+
* extensions never overlap a shipped profile (registered or not) or each other, so a stored type
|
|
59
|
+
* always maps to one profile and an app type is never read as a shipped analyser format.
|
|
60
|
+
*
|
|
53
61
|
* `S3ObjectStore` (and so `@aws-sdk/client-s3`) is loaded lazily, only for `'env'` with a bucket.
|
|
54
62
|
*/
|
|
55
63
|
const node_crypto_1 = require("node:crypto");
|
|
64
|
+
const common_1 = require("@nestjs/common");
|
|
56
65
|
const core_1 = require("@astram/core");
|
|
57
66
|
const app_config_js_1 = require("../config/app-config.js");
|
|
58
67
|
const boot_secrets_js_1 = require("../secrets/boot-secrets.js");
|
|
@@ -82,8 +91,179 @@ function checkFileProfiles(names) {
|
|
|
82
91
|
});
|
|
83
92
|
return names;
|
|
84
93
|
}
|
|
94
|
+
/** At most this many app profiles (SPEC §10). */
|
|
95
|
+
exports.MAX_APP_FILE_PROFILES = 16;
|
|
96
|
+
const APP_NAME_RE = /^[a-z][a-z0-9_]{0,31}$/;
|
|
97
|
+
const APP_EXTENSION_RE = /^\.[a-z0-9]{1,10}$/;
|
|
98
|
+
/** Plan D-2 (stricter than SPEC §5 B): a plain lower-case `type/subtype`, no parameters. */
|
|
99
|
+
const APP_CONTENT_TYPE_RE = /^[a-z0-9][a-z0-9!#$&^_.+-]{0,126}\/[a-z0-9][a-z0-9!#$&^_.+-]{0,126}$/;
|
|
100
|
+
/**
|
|
101
|
+
* Types refused by exact match: the SPEC §10 list (html, xhtml, svg, javascript, shell,
|
|
102
|
+
* octet-stream) extended by the supervisor (2026-11-03, stricter than the SPEC) with xml, php,
|
|
103
|
+
* wasm, shell and script types and javascript variants. {@link isDeniedAppContentType} adds the
|
|
104
|
+
* class patterns (`+xml`, php, javascript family, shell and script subtypes).
|
|
105
|
+
*/
|
|
106
|
+
exports.APP_CONTENT_TYPE_DENY_LIST = Object.freeze([
|
|
107
|
+
// SPEC §10
|
|
108
|
+
'text/html',
|
|
109
|
+
'application/xhtml+xml',
|
|
110
|
+
'image/svg+xml',
|
|
111
|
+
'application/javascript',
|
|
112
|
+
'text/javascript',
|
|
113
|
+
'application/x-sh',
|
|
114
|
+
'application/octet-stream',
|
|
115
|
+
// xml
|
|
116
|
+
'application/xml',
|
|
117
|
+
'text/xml',
|
|
118
|
+
// php
|
|
119
|
+
'application/x-httpd-php',
|
|
120
|
+
'application/x-php',
|
|
121
|
+
'application/php',
|
|
122
|
+
'text/x-php',
|
|
123
|
+
'text/php',
|
|
124
|
+
// wasm
|
|
125
|
+
'application/wasm',
|
|
126
|
+
// shell and script
|
|
127
|
+
'application/x-csh',
|
|
128
|
+
'application/x-shellscript',
|
|
129
|
+
'text/x-shellscript',
|
|
130
|
+
'text/x-sh',
|
|
131
|
+
'application/x-powershell',
|
|
132
|
+
'text/x-python',
|
|
133
|
+
'application/x-python-code',
|
|
134
|
+
'text/x-perl',
|
|
135
|
+
'application/x-perl',
|
|
136
|
+
'text/x-ruby',
|
|
137
|
+
'application/x-ruby',
|
|
138
|
+
'application/x-bat',
|
|
139
|
+
'application/x-msdos-program',
|
|
140
|
+
'application/x-msdownload',
|
|
141
|
+
// javascript variants
|
|
142
|
+
'application/x-javascript',
|
|
143
|
+
'text/x-javascript',
|
|
144
|
+
'application/ecmascript',
|
|
145
|
+
'text/ecmascript',
|
|
146
|
+
'application/x-ecmascript',
|
|
147
|
+
'text/jscript',
|
|
148
|
+
'text/livescript',
|
|
149
|
+
]);
|
|
150
|
+
const DENIED_EXACT = new Set(exports.APP_CONTENT_TYPE_DENY_LIST);
|
|
151
|
+
/** Subtype patterns per class (supervisor 2026-11-03): any `+xml`; php; javascript family; shells. */
|
|
152
|
+
const DENIED_SUBTYPE_PATTERNS = Object.freeze([
|
|
153
|
+
/\+xml$/,
|
|
154
|
+
/php/,
|
|
155
|
+
/(java|ecma|j|live)script/,
|
|
156
|
+
/^(x-)?(sh|csh|bash|zsh|ksh|fish|shellscript|powershell|bat|cmd)$/,
|
|
157
|
+
]);
|
|
158
|
+
/**
|
|
159
|
+
* True when an app profile may not use this (lower-case) content type: on the exact list or in a
|
|
160
|
+
* denied class. Types a browser could render or execute, scripts a server or desktop could run, or
|
|
161
|
+
* types that say nothing.
|
|
162
|
+
*/
|
|
163
|
+
function isDeniedAppContentType(lowerType) {
|
|
164
|
+
if (DENIED_EXACT.has(lowerType))
|
|
165
|
+
return true;
|
|
166
|
+
const subtype = lowerType.slice(lowerType.indexOf('/') + 1);
|
|
167
|
+
return DENIED_SUBTYPE_PATTERNS.some((re) => re.test(subtype));
|
|
168
|
+
}
|
|
169
|
+
/** Every shipped profile's content types / extensions, lower-cased (registered or not). */
|
|
170
|
+
const SHIPPED_TYPES = new Set(Object.values(core_1.SHIPPED_FILE_PROFILES).flatMap((p) => p.contentTypes.map((t) => t.toLowerCase())));
|
|
171
|
+
const SHIPPED_EXTENSIONS = new Set(Object.values(core_1.SHIPPED_FILE_PROFILES).flatMap((p) => p.extensions.map((e) => e.toLowerCase())));
|
|
172
|
+
const isRecord = (v) => typeof v === 'object' && v !== null && !Array.isArray(v);
|
|
173
|
+
/**
|
|
174
|
+
* Validate `appFileProfiles` (SPEC §5 B, §10; plan D-2); throws at registration. Messages are
|
|
175
|
+
* fixed text naming the entry index and the rule (and a content type's or extension's position),
|
|
176
|
+
* never a value. `_shippedRegistered` is unused by the rules (a shipped type or extension is
|
|
177
|
+
* refused whether its profile is registered or not, technical answer 1) and kept for the call
|
|
178
|
+
* site's clarity.
|
|
179
|
+
*/
|
|
180
|
+
function checkAppFileProfiles(entries, _shippedRegistered) {
|
|
181
|
+
if (entries === undefined)
|
|
182
|
+
return [];
|
|
183
|
+
if (!Array.isArray(entries) || entries.length > exports.MAX_APP_FILE_PROFILES) {
|
|
184
|
+
throw new Error(`ShieldModule appFileProfiles must be a list of at most ${exports.MAX_APP_FILE_PROFILES} entries`);
|
|
185
|
+
}
|
|
186
|
+
const names = new Set();
|
|
187
|
+
const types = new Set();
|
|
188
|
+
const extensions = new Set();
|
|
189
|
+
const out = [];
|
|
190
|
+
entries.forEach((raw, i) => {
|
|
191
|
+
const fail = (rule) => {
|
|
192
|
+
throw new Error(`ShieldModule appFileProfiles entry ${i} ${rule}`);
|
|
193
|
+
};
|
|
194
|
+
if (!isRecord(raw))
|
|
195
|
+
fail('is not an object');
|
|
196
|
+
const e = raw;
|
|
197
|
+
if (!isRecord(e.profile))
|
|
198
|
+
fail('profile is not an object');
|
|
199
|
+
const p = e.profile;
|
|
200
|
+
const name = e.name;
|
|
201
|
+
if (typeof name !== 'string' || !APP_NAME_RE.test(name)) {
|
|
202
|
+
fail('name must match ^[a-z][a-z0-9_]{0,31}$');
|
|
203
|
+
}
|
|
204
|
+
if (Object.hasOwn(core_1.SHIPPED_FILE_PROFILES, name)) {
|
|
205
|
+
fail('name is a shipped profile name');
|
|
206
|
+
}
|
|
207
|
+
if (names.has(name))
|
|
208
|
+
fail('repeats an earlier name');
|
|
209
|
+
if (typeof p.magic !== 'function')
|
|
210
|
+
fail('magic must be a function');
|
|
211
|
+
const maxBytes = p.maxBytes;
|
|
212
|
+
if (typeof maxBytes !== 'number' ||
|
|
213
|
+
!Number.isInteger(maxBytes) ||
|
|
214
|
+
maxBytes <= 0 ||
|
|
215
|
+
maxBytes > core_1.FILE_MAX_BYTES_CEILING) {
|
|
216
|
+
fail(`maxBytes must be a positive integer at most ${core_1.FILE_MAX_BYTES_CEILING}`);
|
|
217
|
+
}
|
|
218
|
+
if (!Array.isArray(p.contentTypes) || p.contentTypes.length === 0) {
|
|
219
|
+
fail('contentTypes must be a non-empty list');
|
|
220
|
+
}
|
|
221
|
+
if (!Array.isArray(p.extensions) || p.extensions.length === 0) {
|
|
222
|
+
fail('extensions must be a non-empty list');
|
|
223
|
+
}
|
|
224
|
+
const ownTypes = p.contentTypes.map((t, j) => {
|
|
225
|
+
if (typeof t !== 'string' || !APP_CONTENT_TYPE_RE.test(t)) {
|
|
226
|
+
fail(`content type ${j} must be a plain lower-case type/subtype`);
|
|
227
|
+
}
|
|
228
|
+
const lower = t.toLowerCase();
|
|
229
|
+
if (isDeniedAppContentType(lower))
|
|
230
|
+
fail(`content type ${j} is on the deny list`);
|
|
231
|
+
if (SHIPPED_TYPES.has(lower))
|
|
232
|
+
fail(`content type ${j} belongs to a shipped profile`);
|
|
233
|
+
if (types.has(lower))
|
|
234
|
+
fail(`content type ${j} is used by another app profile`);
|
|
235
|
+
return lower;
|
|
236
|
+
});
|
|
237
|
+
const ownExtensions = p.extensions.map((x, j) => {
|
|
238
|
+
if (typeof x !== 'string' || !APP_EXTENSION_RE.test(x)) {
|
|
239
|
+
fail(`extension ${j} must match ^\\.[a-z0-9]{1,10}$`);
|
|
240
|
+
}
|
|
241
|
+
const lower = x.toLowerCase();
|
|
242
|
+
if (SHIPPED_EXTENSIONS.has(lower))
|
|
243
|
+
fail(`extension ${j} belongs to a shipped profile`);
|
|
244
|
+
if (extensions.has(lower))
|
|
245
|
+
fail(`extension ${j} is used by another app profile`);
|
|
246
|
+
return lower;
|
|
247
|
+
});
|
|
248
|
+
names.add(name);
|
|
249
|
+
for (const t of ownTypes)
|
|
250
|
+
types.add(t);
|
|
251
|
+
for (const x of ownExtensions)
|
|
252
|
+
extensions.add(x);
|
|
253
|
+
// Frozen copies of what was checked: a later change to the app's own objects cannot reach the
|
|
254
|
+
// ingest (review P2-3).
|
|
255
|
+
const checked = Object.freeze({
|
|
256
|
+
maxBytes: maxBytes,
|
|
257
|
+
contentTypes: Object.freeze([...p.contentTypes]),
|
|
258
|
+
extensions: Object.freeze([...p.extensions]),
|
|
259
|
+
magic: p.magic,
|
|
260
|
+
});
|
|
261
|
+
out.push(Object.freeze({ name: name, profile: checked }));
|
|
262
|
+
});
|
|
263
|
+
return Object.freeze(out);
|
|
264
|
+
}
|
|
85
265
|
/** Build the storage providers for one `ShieldModule` registration (see the file header). */
|
|
86
|
-
function storageProviders(storage, fileProfiles = DEFAULT_FILE_PROFILES) {
|
|
266
|
+
function storageProviders(storage, fileProfiles = DEFAULT_FILE_PROFILES, appFileProfiles) {
|
|
87
267
|
if (storage !== undefined && storage !== 'env') {
|
|
88
268
|
const s = storage;
|
|
89
269
|
if (STORE_METHODS.some((m) => typeof s?.[m] !== 'function')) {
|
|
@@ -91,6 +271,7 @@ function storageProviders(storage, fileProfiles = DEFAULT_FILE_PROFILES) {
|
|
|
91
271
|
}
|
|
92
272
|
}
|
|
93
273
|
const profileNames = [...checkFileProfiles(fileProfiles)];
|
|
274
|
+
const apps = checkAppFileProfiles(appFileProfiles, profileNames);
|
|
94
275
|
const configToken = Symbol('SHIELD_OBJECT_STORAGE_CONFIG');
|
|
95
276
|
return [
|
|
96
277
|
{
|
|
@@ -125,7 +306,26 @@ function storageProviders(storage, fileProfiles = DEFAULT_FILE_PROFILES) {
|
|
|
125
306
|
? { ...shipped, maxBytes: config.maxBytes }
|
|
126
307
|
: shipped;
|
|
127
308
|
}
|
|
128
|
-
|
|
309
|
+
// App profiles (DP1; supervisor 2026-11-03, stricter than the SPEC): an explicit
|
|
310
|
+
// OBJECT_STORAGE_MAX_BYTES can only LOWER an app's declared cap, never raise it
|
|
311
|
+
// (shipped profiles above keep the replace rule).
|
|
312
|
+
for (const app of apps) {
|
|
313
|
+
profiles[app.name] =
|
|
314
|
+
config?.maxBytesExplicit && config.maxBytes < app.profile.maxBytes
|
|
315
|
+
? { ...app.profile, maxBytes: config.maxBytes }
|
|
316
|
+
: app.profile;
|
|
317
|
+
}
|
|
318
|
+
const ingest = (0, core_1.createFileIngest)({
|
|
319
|
+
digest: new node_sha256_digest_js_1.NodeSha256Digest(),
|
|
320
|
+
newId: node_crypto_1.randomUUID,
|
|
321
|
+
profiles,
|
|
322
|
+
});
|
|
323
|
+
if (apps.length > 0) {
|
|
324
|
+
// Names only: never a content type, extension or anything of `magic`.
|
|
325
|
+
new common_1.Logger('ShieldStorage').log(`app file profiles registered: ${apps.map((a) => a.name).join(', ')} ` +
|
|
326
|
+
'(a ZIP-based profile magic must call zipWithinLimits first)');
|
|
327
|
+
}
|
|
328
|
+
return ingest;
|
|
129
329
|
},
|
|
130
330
|
inject: [configToken],
|
|
131
331
|
},
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@astram/guard",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.32.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/engine": "0.19.0",
|
|
40
|
+
"@astram/core": "1.19.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.20"
|
|
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.20"
|
|
72
72
|
},
|
|
73
73
|
"repository": {
|
|
74
74
|
"type": "git",
|