@astram/guard 0.30.1 → 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/README.md +43 -0
- 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/enforcement/enforcement.module.d.ts +8 -1
- package/dist/enforcement/enforcement.module.d.ts.map +1 -1
- package/dist/enforcement/enforcement.module.js +9 -0
- package/dist/enforcement/global-enforcement.guard.d.ts.map +1 -1
- package/dist/enforcement/global-enforcement.guard.js +7 -0
- package/dist/index.d.ts +4 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +20 -5
- package/dist/internal.d.ts +12 -0
- package/dist/internal.d.ts.map +1 -1
- package/dist/internal.js +17 -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/request-auth/request-principal-als.d.ts +65 -0
- package/dist/request-auth/request-principal-als.d.ts.map +1 -0
- package/dist/request-auth/request-principal-als.js +83 -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
package/README.md
CHANGED
|
@@ -18,6 +18,7 @@ host's NestJS runtime.
|
|
|
18
18
|
| Core seam | `src/enforcement/core-seam.ts` | Type-only import of `@astram/core`'s `DecisionAuthority` (ADR-0003) + the fail-closed stub. |
|
|
19
19
|
| Boot-pool assertion | `src/boot/boot-sequence.ts` | ADR-0018 connection-pool budget check at boot (fail-closed). |
|
|
20
20
|
| App config | `src/config/app-config.ts` | Port / environment / ADR-0018 pool budget (env loader, pure). |
|
|
21
|
+
| Request principal | `src/request-auth/request-principal-als.ts` | Read-only `currentRequestPrincipal()`: the current request's `{ tenantId, userId }` (below). |
|
|
21
22
|
|
|
22
23
|
## The registration seam (ADR-0023 §4)
|
|
23
24
|
|
|
@@ -53,6 +54,48 @@ export class AppModule {}
|
|
|
53
54
|
in this layer): the factory resolves the same options at startup; the guard/boot
|
|
54
55
|
wiring is identical.
|
|
55
56
|
|
|
57
|
+
## Request principal (`currentRequestPrincipal`)
|
|
58
|
+
|
|
59
|
+
```ts
|
|
60
|
+
import { currentRequestPrincipal } from '@astram/guard';
|
|
61
|
+
|
|
62
|
+
const p = currentRequestPrincipal(); // Readonly<{ tenantId: string; userId: string }> | undefined
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
Framework code that runs inside a request but has no `req` in hand (for example `@astram/agent`'s
|
|
66
|
+
`createAuditedFetch`) reads the caller's tenant and principal id here. Spec:
|
|
67
|
+
`docs/features/capability-outbound-audit/SPEC.md` v6 §5 G.
|
|
68
|
+
|
|
69
|
+
- **Read-only.** A framework middleware (`EnforcementModule`, every route) opens a module-private
|
|
70
|
+
`AsyncLocalStorage` with an empty holder per request. The global enforcement guard is its only
|
|
71
|
+
writer: once, on the allow path, after authentication, from the principal it resolved from the
|
|
72
|
+
session or API key (never from the body, headers or query). The value is frozen. The storage, the
|
|
73
|
+
middleware and the writer are not exported, so app code cannot enter the scope or overwrite it.
|
|
74
|
+
- **`undefined`** outside a request (a scheduled job), on a `@Public()` route, for a request the
|
|
75
|
+
guard refused, and for a request that did not pass the middleware.
|
|
76
|
+
- **`userId` is the principal id**: a user or a service account. The value does not say which kind
|
|
77
|
+
(GAPS #46); look the id up if you need it.
|
|
78
|
+
- Work that resumes outside the request's async context (for example some stream consumers) reads
|
|
79
|
+
`undefined`, never another request's value (an interleaved four-request test holds this). Read it
|
|
80
|
+
in the request's own call chain; a callback run by shared code (a listener on an app-wide emitter)
|
|
81
|
+
runs in the context of whoever triggered it, so do not read it there.
|
|
82
|
+
- **Start background work at boot (`onApplicationBootstrap`), never lazily from inside a
|
|
83
|
+
request.** Async resources created inside a request (a timer, a promise chain, a queue drain a
|
|
84
|
+
handler starts on first use) keep that request's context, including its principal or its lack of
|
|
85
|
+
one.
|
|
86
|
+
- Routes excluded from `app.setGlobalPrefix(prefix, { exclude })` pass the middleware too (an e2e
|
|
87
|
+
test holds this).
|
|
88
|
+
- `@astram/guard/internal` (framework use only) also exports a read-only `insideRequest()`: `true`
|
|
89
|
+
inside a request that passed the middleware, with or without a principal. `@astram/agent`'s
|
|
90
|
+
audited fetch uses it to refuse calls from `@Public()` and refused requests.
|
|
91
|
+
- **Express only.** `currentRequestPrincipal` is proven on `@nestjs/platform-express`; Fastify is
|
|
92
|
+
unsupported until it has its own e2e test.
|
|
93
|
+
- **Nest routes only.** The holder is opened by a Nest middleware, so a handler mounted directly on
|
|
94
|
+
the HTTP adapter (outside Nest routing) runs "outside a request": `insideRequest()` is `false` and
|
|
95
|
+
`@astram/agent`'s `createAuditedFetch` takes the scheduled-job branch there (the app must then
|
|
96
|
+
supply a server-held tenant). Keep connector code in Nest handlers or boot-started jobs.
|
|
97
|
+
- In memory only: no database or Redis read is added to the request path (Shield #12).
|
|
98
|
+
|
|
56
99
|
## Peer dependencies (ADR-0023 §2)
|
|
57
100
|
|
|
58
101
|
`@astram/guard` **peer-depends** on the host runtime so the consumer owns exactly
|
|
@@ -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;;;;;;;;;;;;;;;;;;;;;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AAwB,CACtC,MAAM,EAAE,yBAAyB,EACjC,OAAO,GAAE,+BAAoC,GAC5C,iBAAiB,CAiCnB;AAED;;;;;;;;;GASG;AACH,MAAM,MAAM,WAAW,GAAG,CACxB,GAAG,EAAE,UAAU,EACf,KAAK,EAAE,SAAS,EAChB,MAAM,EAAE,MAAM,KACX,OAAO,CAAC;IAAE,GAAG,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,OAAO,EAAE,CAAA;CAAE,CAAC,CAAC;AAEjD;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,yBAAyB,GAAG,WAAW,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,MAA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AQ,CAAC,kBAAkB,EAAE,MAAM,CAAC;IACpC,0EAA0E;IAC1E,QAAQ,CAAC,mBAAmB,EAAE,MAAM,CAAC;IACrC,qEAAqE;IACrE,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,qDAAqD;IACrD,QAAQ,CAAC,YAAY,EAAE,OAAO,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;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { type MiddlewareConsumer, type NestModule } from '@nestjs/common';
|
|
1
2
|
/** Framework-module marker (G-036 M1, agent-read-capabilities SPEC §5 A); see `ShieldModule`. */
|
|
2
3
|
declare const FRAMEWORK_MODULE: unique symbol;
|
|
3
4
|
/**
|
|
@@ -15,8 +16,14 @@ declare const FRAMEWORK_MODULE: unique symbol;
|
|
|
15
16
|
* this the single `APP_GUARD` definition (instead of re-inlining it in
|
|
16
17
|
* `ShieldModule`) guarantees exactly one wiring path for the guard.
|
|
17
18
|
*/
|
|
18
|
-
export declare class EnforcementModule {
|
|
19
|
+
export declare class EnforcementModule implements NestModule {
|
|
19
20
|
static readonly [FRAMEWORK_MODULE] = true;
|
|
21
|
+
/**
|
|
22
|
+
* Request principal (capability-outbound-audit SPEC v6 §5 G): open the module-private request
|
|
23
|
+
* principal scope, with an empty holder, around every route. The global guard above is the only
|
|
24
|
+
* writer of that holder; `currentRequestPrincipal()` is the only reader the barrel exports.
|
|
25
|
+
*/
|
|
26
|
+
configure(consumer: MiddlewareConsumer): void;
|
|
20
27
|
}
|
|
21
28
|
export {};
|
|
22
29
|
//# 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":"
|
|
1
|
+
{"version":3,"file":"enforcement.module.d.ts","sourceRoot":"","sources":["../../src/enforcement/enforcement.module.ts"],"names":[],"mappings":"AAAA,OAAO,EAAyB,KAAK,kBAAkB,EAAE,KAAK,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAMjG,iGAAiG;AACjG,QAAA,MAAM,gBAAgB,eAAwC,CAAC;AAE/D;;;;;;;;;;;;;;GAcG;AACH,qBAgBa,iBAAkB,YAAW,UAAU;IAClD,MAAM,CAAC,QAAQ,CAAC,CAAC,gBAAgB,CAAC,QAAQ;IAE1C;;;;OAIG;IACH,SAAS,CAAC,QAAQ,EAAE,kBAAkB,GAAG,IAAI;CAG9C"}
|
|
@@ -9,6 +9,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
9
9
|
exports.EnforcementModule = void 0;
|
|
10
10
|
const common_1 = require("@nestjs/common");
|
|
11
11
|
const core_1 = require("@nestjs/core");
|
|
12
|
+
const request_principal_als_js_1 = require("../request-auth/request-principal-als.js");
|
|
12
13
|
const global_enforcement_guard_js_1 = require("./global-enforcement.guard.js");
|
|
13
14
|
const engine_error_filter_js_1 = require("./engine-error.filter.js");
|
|
14
15
|
/** Framework-module marker (G-036 M1, agent-read-capabilities SPEC §5 A); see `ShieldModule`. */
|
|
@@ -30,6 +31,14 @@ const FRAMEWORK_MODULE = Symbol.for('astram.framework-module');
|
|
|
30
31
|
*/
|
|
31
32
|
let EnforcementModule = class EnforcementModule {
|
|
32
33
|
static [FRAMEWORK_MODULE] = true;
|
|
34
|
+
/**
|
|
35
|
+
* Request principal (capability-outbound-audit SPEC v6 §5 G): open the module-private request
|
|
36
|
+
* principal scope, with an empty holder, around every route. The global guard above is the only
|
|
37
|
+
* writer of that holder; `currentRequestPrincipal()` is the only reader the barrel exports.
|
|
38
|
+
*/
|
|
39
|
+
configure(consumer) {
|
|
40
|
+
consumer.apply(request_principal_als_js_1.requestPrincipalMiddleware).forRoutes({ path: '*', method: common_1.RequestMethod.ALL });
|
|
41
|
+
}
|
|
33
42
|
};
|
|
34
43
|
exports.EnforcementModule = EnforcementModule;
|
|
35
44
|
exports.EnforcementModule = EnforcementModule = __decorate([
|
|
@@ -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;
|
|
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;AAQpF,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;IA0LjC;;;;OAIG;IACH,OAAO,CAAC,kBAAkB;IAW1B;;;;;OAKG;YACW,oBAAoB;IAuBlC;;;;;;;;;;;;;;;;OAgBG;YACW,4BAA4B;CA8C3C"}
|
|
@@ -23,6 +23,7 @@ const session_token_binder_js_1 = require("../request-auth/session-token-binder.
|
|
|
23
23
|
const request_principal_js_1 = require("../request-auth/request-principal.js");
|
|
24
24
|
const tokens_js_2 = require("../auth/tokens.js");
|
|
25
25
|
const session_facts_als_js_1 = require("../request-auth/session-facts-als.js");
|
|
26
|
+
const request_principal_als_js_1 = require("../request-auth/request-principal-als.js");
|
|
26
27
|
const reenroll_allowlist_js_1 = require("./reenroll-allowlist.js");
|
|
27
28
|
const session_restriction_js_1 = require("../session/session-restriction.js");
|
|
28
29
|
const mfa_requirement_service_js_1 = require("../session/mfa-requirement-service.js");
|
|
@@ -272,6 +273,12 @@ let GlobalEnforcementGuard = class GlobalEnforcementGuard {
|
|
|
272
273
|
if (enforced !== claims)
|
|
273
274
|
this.enforceRestriction(enforced, req);
|
|
274
275
|
if (decision.effect === 'allow') {
|
|
276
|
+
// Request principal (capability-outbound-audit SPEC v6 §5 G): this guard is its only writer,
|
|
277
|
+
// once, after authentication and the allow, from the principal resolved from the bearer token
|
|
278
|
+
// above (never body, headers or query; core #7). `userId` is the principal id for every kind
|
|
279
|
+
// (user, service account). A request with no holder (it did not pass the framework middleware)
|
|
280
|
+
// makes this a no-op. In-memory only: no DB or Redis read (Shield #12).
|
|
281
|
+
(0, request_principal_als_js_1.writeRequestPrincipal)(principal.tenantId, principal.id);
|
|
275
282
|
return true;
|
|
276
283
|
}
|
|
277
284
|
// Deny (or any non-allow) → 403. Do NOT leak the reason detail to the caller.
|
package/dist/index.d.ts
CHANGED
|
@@ -32,6 +32,7 @@ export type { BoundPrincipalClaims, SessionTokenBinderOptions, } from './request
|
|
|
32
32
|
export { resolveRequestPrincipal, resolveRequestAuth, principalFromClaims, extractBearerToken, isApiKey, } from './request-auth/request-principal.js';
|
|
33
33
|
export { MariaDbApiKeyStore } from './authentication/mariadb-api-key-store.js';
|
|
34
34
|
export { SHIELD_SESSION_FACTS_ALS, NO_SESSION_FACTS, type SessionFactsStore, } from './request-auth/session-facts-als.js';
|
|
35
|
+
export { currentRequestPrincipal } from './request-auth/request-principal-als.js';
|
|
35
36
|
export { GlobalEnforcementGuard } from './enforcement/global-enforcement.guard.js';
|
|
36
37
|
export { stubDecisionAuthority, type Effect, type CoreDecisionAuthority, type CoreDecision, type Principal, } from './enforcement/core-seam.js';
|
|
37
38
|
export { Argon2idPasswordHasher, argon2idHasherProvider, SHIELD_PASSWORD_HASHER, lockedPasswordHash, isLockedHash, type Argon2idParams, } from './authentication/argon2id-password-hasher.js';
|
|
@@ -50,8 +51,9 @@ export { loadNotificationConfig, type NotificationConfig } from './config/notifi
|
|
|
50
51
|
export { SHIELD_NOTIFICATIONS } from './auth/tokens.js';
|
|
51
52
|
export { ObjectStoreBootCheck } from './storage/object-store-boot-check.js';
|
|
52
53
|
export { FileIntake, FILE_INTAKE_REQUEST_KEY, FILE_INTAKE_DEFAULT_MAX_BYTES, type FileIntakeOptions, type FileIntakeResult, } from './storage/file-intake.interceptor.js';
|
|
53
|
-
export type { ShieldStorageOption } from './storage/storage.providers.js';
|
|
54
|
-
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';
|
|
55
57
|
export { loadObjectStorageConfig, DEFAULT_OBJECT_STORAGE_MAX_BYTES, type ObjectStorageConfig, type LoadObjectStorageConfigOptions, } from './config/app-config.js';
|
|
56
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';
|
|
57
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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