@decionis/agent-safe-pipeline 0.1.4 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +170 -10
- package/dist/Index.d.ts +8 -0
- package/dist/Index.d.ts.map +1 -1
- package/dist/Index.js +7 -0
- package/dist/Index.js.map +1 -1
- package/dist/audit/AuditRecorder.d.ts +1 -1
- package/dist/audit/AuditRecorder.d.ts.map +1 -1
- package/dist/audit/AuditRecorder.js.map +1 -1
- package/dist/decision/CreateGate.d.ts +123 -0
- package/dist/decision/CreateGate.d.ts.map +1 -0
- package/dist/decision/CreateGate.js +211 -0
- package/dist/decision/CreateGate.js.map +1 -0
- package/dist/decision/DecionisGate.d.ts +18 -1
- package/dist/decision/DecionisGate.d.ts.map +1 -1
- package/dist/decision/DecionisGate.js +31 -3
- package/dist/decision/DecionisGate.js.map +1 -1
- package/dist/decision/DecisionAuthority.d.ts +26 -0
- package/dist/decision/DecisionAuthority.d.ts.map +1 -1
- package/dist/decision/DecisionAuthority.js.map +1 -1
- package/dist/decision/ImmutableGateDecision.d.ts.map +1 -1
- package/dist/decision/ImmutableGateDecision.js +8 -0
- package/dist/decision/ImmutableGateDecision.js.map +1 -1
- package/dist/decision/Provision.d.ts +33 -0
- package/dist/decision/Provision.d.ts.map +1 -0
- package/dist/decision/Provision.js +116 -0
- package/dist/decision/Provision.js.map +1 -0
- package/dist/decision/ShadowGate.d.ts +31 -0
- package/dist/decision/ShadowGate.d.ts.map +1 -0
- package/dist/decision/ShadowGate.js +79 -0
- package/dist/decision/ShadowGate.js.map +1 -0
- package/dist/execution/ActionRegistry.d.ts +40 -0
- package/dist/execution/ActionRegistry.d.ts.map +1 -1
- package/dist/execution/ActionRegistry.js +47 -2
- package/dist/execution/ActionRegistry.js.map +1 -1
- package/dist/execution/AuthorizationVerifier.d.ts +147 -1
- package/dist/execution/AuthorizationVerifier.d.ts.map +1 -1
- package/dist/execution/AuthorizationVerifier.js +209 -6
- package/dist/execution/AuthorizationVerifier.js.map +1 -1
- package/dist/execution/SafeExecutor.d.ts +34 -3
- package/dist/execution/SafeExecutor.d.ts.map +1 -1
- package/dist/execution/SafeExecutor.js +42 -5
- package/dist/execution/SafeExecutor.js.map +1 -1
- package/dist/http/ClientIdentification.d.ts +22 -0
- package/dist/http/ClientIdentification.d.ts.map +1 -0
- package/dist/http/ClientIdentification.js +44 -0
- package/dist/http/ClientIdentification.js.map +1 -0
- package/dist/http/Credential.d.ts +17 -0
- package/dist/http/Credential.d.ts.map +1 -0
- package/dist/http/Credential.js +5 -0
- package/dist/http/Credential.js.map +1 -0
- package/dist/http/StoredCredentials.d.ts +34 -0
- package/dist/http/StoredCredentials.d.ts.map +1 -0
- package/dist/http/StoredCredentials.js +85 -0
- package/dist/http/StoredCredentials.js.map +1 -0
- package/dist/intent/CanonicalIntentHasher.d.ts.map +1 -1
- package/dist/intent/CanonicalIntentHasher.js +3 -0
- package/dist/intent/CanonicalIntentHasher.js.map +1 -1
- package/dist/intent/ExecutionIntent.d.ts +13 -1
- package/dist/intent/ExecutionIntent.d.ts.map +1 -1
- package/dist/intent/ExecutionIntent.js +4 -0
- package/dist/intent/ExecutionIntent.js.map +1 -1
- package/dist/intent/IntentCapture.d.ts.map +1 -1
- package/dist/intent/IntentCapture.js +3 -0
- package/dist/intent/IntentCapture.js.map +1 -1
- package/dist/report/DecisionReport.d.ts +22 -0
- package/dist/report/DecisionReport.d.ts.map +1 -0
- package/dist/report/DecisionReport.js +37 -0
- package/dist/report/DecisionReport.js.map +1 -0
- package/dist/report/DossierReport.d.ts +43 -0
- package/dist/report/DossierReport.d.ts.map +1 -0
- package/dist/report/DossierReport.js +130 -0
- package/dist/report/DossierReport.js.map +1 -0
- package/dist/report/HostedOutcome.d.ts +18 -0
- package/dist/report/HostedOutcome.d.ts.map +1 -0
- package/dist/report/HostedOutcome.js +24 -0
- package/dist/report/HostedOutcome.js.map +1 -0
- package/dist/testing/Index.d.ts +1 -1
- package/dist/testing/Index.d.ts.map +1 -1
- package/dist/testing/Index.js +1 -1
- package/dist/testing/Index.js.map +1 -1
- package/dist/testing/LocalAuthority.d.ts +156 -0
- package/dist/testing/LocalAuthority.d.ts.map +1 -1
- package/dist/testing/LocalAuthority.js +531 -9
- package/dist/testing/LocalAuthority.js.map +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Prints what Decionis said about a decision, when it was asked. A decision
|
|
3
|
+
* with no `hosted` evaluation prints nothing, so a caller that never set a
|
|
4
|
+
* key sees exactly the output it saw before.
|
|
5
|
+
*
|
|
6
|
+
* The verify lines name the record by identifier only. The page, when the
|
|
7
|
+
* authority attached one, verifies it for anyone who opens it; the command
|
|
8
|
+
* needs the signed record, fetched with the caller's key, and the public
|
|
9
|
+
* JWKS, fetched by anyone; the signature check itself runs offline and needs
|
|
10
|
+
* no account.
|
|
11
|
+
*/
|
|
12
|
+
export function printDecision(decision, options = {}) {
|
|
13
|
+
const hosted = decision.hosted;
|
|
14
|
+
if (hosted === undefined)
|
|
15
|
+
return;
|
|
16
|
+
const out = options.out ?? process.stdout;
|
|
17
|
+
const verifyCommand = options.verifyCommand ?? ((dossierId) => `pnpm decionis:verify ${dossierId}`);
|
|
18
|
+
out.write(`verdict: ${decision.verdict}\n`);
|
|
19
|
+
out.write(`decionis: ${hosted.verdict} (${hosted.mode}, ${standing(hosted)})\n`);
|
|
20
|
+
for (const code of hosted.reasonCodes)
|
|
21
|
+
out.write(` - ${code}\n`);
|
|
22
|
+
if (hosted.dossierId === null) {
|
|
23
|
+
out.write("dossier: none\n");
|
|
24
|
+
return;
|
|
25
|
+
}
|
|
26
|
+
out.write(`dossier: ${hosted.dossierId}\n`);
|
|
27
|
+
if (hosted.verificationUrl !== null) {
|
|
28
|
+
out.write(`verify it in a browser, no account needed: ${hosted.verificationUrl}\n`);
|
|
29
|
+
}
|
|
30
|
+
out.write(`verify it yourself, no account needed: ${verifyCommand(hosted.dossierId)}\n`);
|
|
31
|
+
}
|
|
32
|
+
function standing(hosted) {
|
|
33
|
+
if (hosted.failClosed)
|
|
34
|
+
return "failed closed";
|
|
35
|
+
return hosted.governs ? "governs" : "recorded beside the local verdict";
|
|
36
|
+
}
|
|
37
|
+
//# sourceMappingURL=DecisionReport.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DecisionReport.js","sourceRoot":"","sources":["../../src/report/DecisionReport.ts"],"names":[],"mappings":"AASA;;;;;;;;;;GAUG;AACH,MAAM,UAAU,aAAa,CAAC,QAAsB,EAAE,UAAiC,EAAE;IACvF,MAAM,MAAM,GAAG,QAAQ,CAAC,MAAM,CAAC;IAC/B,IAAI,MAAM,KAAK,SAAS;QAAE,OAAO;IACjC,MAAM,GAAG,GAAG,OAAO,CAAC,GAAG,IAAI,OAAO,CAAC,MAAM,CAAC;IAC1C,MAAM,aAAa,GACjB,OAAO,CAAC,aAAa,IAAI,CAAC,CAAC,SAAiB,EAAU,EAAE,CAAC,wBAAwB,SAAS,EAAE,CAAC,CAAC;IAEhG,GAAG,CAAC,KAAK,CAAC,YAAY,QAAQ,CAAC,OAAO,IAAI,CAAC,CAAC;IAC5C,GAAG,CAAC,KAAK,CAAC,aAAa,MAAM,CAAC,OAAO,KAAK,MAAM,CAAC,IAAI,KAAK,QAAQ,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;IACjF,KAAK,MAAM,IAAI,IAAI,MAAM,CAAC,WAAW;QAAE,GAAG,CAAC,KAAK,CAAC,OAAO,IAAI,IAAI,CAAC,CAAC;IAClE,IAAI,MAAM,CAAC,SAAS,KAAK,IAAI,EAAE,CAAC;QAC9B,GAAG,CAAC,KAAK,CAAC,iBAAiB,CAAC,CAAC;QAC7B,OAAO;IACT,CAAC;IACD,GAAG,CAAC,KAAK,CAAC,YAAY,MAAM,CAAC,SAAS,IAAI,CAAC,CAAC;IAC5C,IAAI,MAAM,CAAC,eAAe,KAAK,IAAI,EAAE,CAAC;QACpC,GAAG,CAAC,KAAK,CAAC,8CAA8C,MAAM,CAAC,eAAe,IAAI,CAAC,CAAC;IACtF,CAAC;IACD,GAAG,CAAC,KAAK,CAAC,0CAA0C,aAAa,CAAC,MAAM,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC;AAC3F,CAAC;AAED,SAAS,QAAQ,CAAC,MAAwB;IACxC,IAAI,MAAM,CAAC,UAAU;QAAE,OAAO,eAAe,CAAC;IAC9C,OAAO,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,mCAAmC,CAAC;AAC1E,CAAC"}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { type ClientSource } from "../http/ClientIdentification.js";
|
|
2
|
+
export interface DossierFetchOptions {
|
|
3
|
+
readonly baseUrl: string;
|
|
4
|
+
readonly apiKey: string;
|
|
5
|
+
readonly tenantId: string;
|
|
6
|
+
readonly dossierId: string;
|
|
7
|
+
readonly allowInsecureLoopback?: boolean;
|
|
8
|
+
readonly fetch?: typeof fetch;
|
|
9
|
+
readonly timeoutMs?: number;
|
|
10
|
+
readonly source?: ClientSource;
|
|
11
|
+
}
|
|
12
|
+
/** What the proof bundle says about the record, for a person to read. */
|
|
13
|
+
export interface SignedDossierSummary {
|
|
14
|
+
readonly dossierId: string;
|
|
15
|
+
readonly outcome: string | null;
|
|
16
|
+
readonly generatedAt: string | null;
|
|
17
|
+
readonly algorithm: string | null;
|
|
18
|
+
readonly keyId: string | null;
|
|
19
|
+
readonly issuedAt: string | null;
|
|
20
|
+
readonly artifacts: number;
|
|
21
|
+
/** The issuer tier the record carries, `provisional_anonymous` for a workspace without an account. */
|
|
22
|
+
readonly issuerTier: string | null;
|
|
23
|
+
readonly bytes: number;
|
|
24
|
+
}
|
|
25
|
+
export declare class DossierFetchError extends Error {
|
|
26
|
+
readonly code: "DOSSIER_UNAVAILABLE" | "DOSSIER_REFUSED" | "DOSSIER_NOT_FOUND" | "DOSSIER_RESPONSE_INVALID" | "DOSSIER_TIMED_OUT";
|
|
27
|
+
readonly status: number | null;
|
|
28
|
+
constructor(code: "DOSSIER_UNAVAILABLE" | "DOSSIER_REFUSED" | "DOSSIER_NOT_FOUND" | "DOSSIER_RESPONSE_INVALID" | "DOSSIER_TIMED_OUT", status: number | null);
|
|
29
|
+
}
|
|
30
|
+
/** The summary of one `GET /v1/protocol/dossiers/{id}` body; null when it holds no signed payload. */
|
|
31
|
+
export declare function summarizeDossier(body: unknown, bytes: number): SignedDossierSummary | null;
|
|
32
|
+
/** Fetches the signed record with the caller's key and summarizes its proof. */
|
|
33
|
+
export declare function fetchSignedDossier(options: DossierFetchOptions): Promise<{
|
|
34
|
+
readonly summary: SignedDossierSummary;
|
|
35
|
+
readonly body: unknown;
|
|
36
|
+
}>;
|
|
37
|
+
/** The signed record, in three lines a person can read. */
|
|
38
|
+
export declare function printSignedDossier(summary: SignedDossierSummary, options?: {
|
|
39
|
+
readonly out?: {
|
|
40
|
+
write(chunk: string): unknown;
|
|
41
|
+
};
|
|
42
|
+
}): void;
|
|
43
|
+
//# sourceMappingURL=DossierReport.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DossierReport.d.ts","sourceRoot":"","sources":["../../src/report/DossierReport.ts"],"names":[],"mappings":"AAYA,OAAO,EAAa,KAAK,YAAY,EAAE,MAAM,iCAAiC,CAAC;AAE/E,MAAM,WAAW,mBAAmB;IAClC,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,qBAAqB,CAAC,EAAE,OAAO,CAAC;IACzC,QAAQ,CAAC,KAAK,CAAC,EAAE,OAAO,KAAK,CAAC;IAC9B,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC;IAC5B,QAAQ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AC7B,OAAO,GAAE;IAAE,QAAQ,CAAC,GAAG,CAAC,EAAE;QAAE,KAAK,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAA;KAAE,CAAA;CAAO,GACjE,IAAI,CAaN"}
|
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The signed record itself, at the end of a run. `enforce-and-bind` names
|
|
3
|
+
* the Decision Dossier it left; this fetches that record with the caller's
|
|
4
|
+
* key from `GET /v1/protocol/dossiers/{id}`, reads the proof bundle it
|
|
5
|
+
* carries, and prints what a person needs to know it is signed: the
|
|
6
|
+
* algorithm, the key, when it was issued, how many artifacts it covers and
|
|
7
|
+
* under which issuer tier. The signature check itself is `@decionis/verify`'s
|
|
8
|
+
* (the `decionis:verify` script, or the public page); this shows the proof,
|
|
9
|
+
* it does not re-implement it.
|
|
10
|
+
*/
|
|
11
|
+
import { AuthorityBaseUrl } from "../http/AuthorityBaseUrl.js";
|
|
12
|
+
import { BoundedResponseBody } from "../http/BoundedResponseBody.js";
|
|
13
|
+
import { userAgent } from "../http/ClientIdentification.js";
|
|
14
|
+
export class DossierFetchError extends Error {
|
|
15
|
+
code;
|
|
16
|
+
status;
|
|
17
|
+
constructor(code, status) {
|
|
18
|
+
super(code);
|
|
19
|
+
this.code = code;
|
|
20
|
+
this.status = status;
|
|
21
|
+
this.name = "DossierFetchError";
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
/** A signed record with its inputs snapshot can be large; the reader's own bound. */
|
|
25
|
+
const MAX_RESPONSE_BYTES = 2 * 1024 * 1024;
|
|
26
|
+
const DEFAULT_TIMEOUT_MS = 10_000;
|
|
27
|
+
const DOSSIER_ID_PATTERN = /^[\w-]{1,200}$/;
|
|
28
|
+
function record(value) {
|
|
29
|
+
return typeof value === "object" && value !== null && !Array.isArray(value)
|
|
30
|
+
? value
|
|
31
|
+
: null;
|
|
32
|
+
}
|
|
33
|
+
function text(value) {
|
|
34
|
+
return typeof value === "string" && value.length > 0 && value.length <= 500 ? value : null;
|
|
35
|
+
}
|
|
36
|
+
/** The summary of one `GET /v1/protocol/dossiers/{id}` body; null when it holds no signed payload. */
|
|
37
|
+
export function summarizeDossier(body, bytes) {
|
|
38
|
+
const payload = record(record(record(body)?.["dossier"])?.["dossier_payload"]);
|
|
39
|
+
if (payload === null)
|
|
40
|
+
return null;
|
|
41
|
+
const dossierId = text(payload["dossier_id"]);
|
|
42
|
+
if (dossierId === null)
|
|
43
|
+
return null;
|
|
44
|
+
const routing = record(payload["routing_decision"]);
|
|
45
|
+
const bundle = record(record(payload["integrity"])?.["proof_bundle"]);
|
|
46
|
+
const artifacts = bundle?.["artifacts"];
|
|
47
|
+
const portable = record(payload["portable_artifact"]);
|
|
48
|
+
const issuer = record(portable?.["issuer_context"]) ?? record(payload["issuer_context"]) ?? null;
|
|
49
|
+
return {
|
|
50
|
+
dossierId,
|
|
51
|
+
outcome: text(routing?.["outcome"]),
|
|
52
|
+
generatedAt: text(payload["generated_at"]),
|
|
53
|
+
algorithm: text(bundle?.["algorithm"]),
|
|
54
|
+
keyId: text(bundle?.["key_id"]),
|
|
55
|
+
issuedAt: text(bundle?.["issued_at"]),
|
|
56
|
+
artifacts: Array.isArray(artifacts) ? artifacts.length : 0,
|
|
57
|
+
issuerTier: text(issuer?.["tier"]),
|
|
58
|
+
bytes,
|
|
59
|
+
};
|
|
60
|
+
}
|
|
61
|
+
/** Fetches the signed record with the caller's key and summarizes its proof. */
|
|
62
|
+
export async function fetchSignedDossier(options) {
|
|
63
|
+
if (!DOSSIER_ID_PATTERN.test(options.dossierId)) {
|
|
64
|
+
throw new DossierFetchError("DOSSIER_RESPONSE_INVALID", null);
|
|
65
|
+
}
|
|
66
|
+
const baseUrl = AuthorityBaseUrl.normalize(options.baseUrl, options.allowInsecureLoopback ?? false);
|
|
67
|
+
const url = `${baseUrl}/v1/protocol/dossiers/${encodeURIComponent(options.dossierId)}?org_id=${encodeURIComponent(options.tenantId)}`;
|
|
68
|
+
const doFetch = options.fetch ?? fetch;
|
|
69
|
+
const controller = new AbortController();
|
|
70
|
+
const timer = setTimeout(() => controller.abort(), options.timeoutMs ?? DEFAULT_TIMEOUT_MS);
|
|
71
|
+
let response;
|
|
72
|
+
try {
|
|
73
|
+
response = await doFetch(url, {
|
|
74
|
+
method: "GET",
|
|
75
|
+
headers: {
|
|
76
|
+
accept: "application/json",
|
|
77
|
+
authorization: `Bearer ${options.apiKey}`,
|
|
78
|
+
"user-agent": userAgent(options.source),
|
|
79
|
+
},
|
|
80
|
+
redirect: "error",
|
|
81
|
+
signal: controller.signal,
|
|
82
|
+
});
|
|
83
|
+
}
|
|
84
|
+
catch {
|
|
85
|
+
clearTimeout(timer);
|
|
86
|
+
throw new DossierFetchError(controller.signal.aborted ? "DOSSIER_TIMED_OUT" : "DOSSIER_UNAVAILABLE", null);
|
|
87
|
+
}
|
|
88
|
+
let raw;
|
|
89
|
+
try {
|
|
90
|
+
raw = await BoundedResponseBody.read(response, MAX_RESPONSE_BYTES);
|
|
91
|
+
}
|
|
92
|
+
catch {
|
|
93
|
+
raw = null;
|
|
94
|
+
}
|
|
95
|
+
finally {
|
|
96
|
+
clearTimeout(timer);
|
|
97
|
+
}
|
|
98
|
+
if (response.status === 404)
|
|
99
|
+
throw new DossierFetchError("DOSSIER_NOT_FOUND", 404);
|
|
100
|
+
if (response.status === 401 || response.status === 403) {
|
|
101
|
+
throw new DossierFetchError("DOSSIER_REFUSED", response.status);
|
|
102
|
+
}
|
|
103
|
+
if (response.status >= 500)
|
|
104
|
+
throw new DossierFetchError("DOSSIER_UNAVAILABLE", response.status);
|
|
105
|
+
if (response.status !== 200 || raw === null) {
|
|
106
|
+
throw new DossierFetchError("DOSSIER_RESPONSE_INVALID", response.status);
|
|
107
|
+
}
|
|
108
|
+
let body;
|
|
109
|
+
try {
|
|
110
|
+
body = JSON.parse(raw);
|
|
111
|
+
}
|
|
112
|
+
catch {
|
|
113
|
+
throw new DossierFetchError("DOSSIER_RESPONSE_INVALID", response.status);
|
|
114
|
+
}
|
|
115
|
+
const summary = summarizeDossier(body, Buffer.byteLength(raw, "utf8"));
|
|
116
|
+
if (summary === null)
|
|
117
|
+
throw new DossierFetchError("DOSSIER_RESPONSE_INVALID", response.status);
|
|
118
|
+
return { summary, body };
|
|
119
|
+
}
|
|
120
|
+
/** The signed record, in three lines a person can read. */
|
|
121
|
+
export function printSignedDossier(summary, options = {}) {
|
|
122
|
+
const out = options.out ?? process.stdout;
|
|
123
|
+
const signed = summary.keyId === null
|
|
124
|
+
? "unsigned record"
|
|
125
|
+
: `${summary.algorithm ?? "signed"} by key ${summary.keyId}${summary.issuedAt === null ? "" : ` at ${summary.issuedAt}`}`;
|
|
126
|
+
out.write(`signed dossier: ${summary.dossierId} (${String(summary.bytes)} bytes${summary.outcome === null ? "" : `, ${summary.outcome}`})\n`);
|
|
127
|
+
out.write(` ${signed}, ${String(summary.artifacts)} signed artifact(s)\n`);
|
|
128
|
+
out.write(` issuer: ${summary.issuerTier ?? "not stated"}${summary.issuerTier === "provisional_anonymous" ? " (a workspace without an account; claim it to keep it)" : ""}\n`);
|
|
129
|
+
}
|
|
130
|
+
//# sourceMappingURL=DossierReport.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DossierReport.js","sourceRoot":"","sources":["../../src/report/DossierReport.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,OAAO,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAC;AAC/D,OAAO,EAAE,mBAAmB,EAAE,MAAM,gCAAgC,CAAC;AACrE,OAAO,EAAE,SAAS,EAAqB,MAAM,iCAAiC,CAAC;AA2B/E,MAAM,OAAO,iBAAkB,SAAQ,KAAK;IAExB;IAMA;IAPlB,YACkB,IAKO,EACP,MAAqB;QAErC,KAAK,CAAC,IAAI,CAAC,CAAC;QARI,SAAI,GAAJ,IAAI,CAKG;QACP,WAAM,GAAN,MAAM,CAAe;QAGrC,IAAI,CAAC,IAAI,GAAG,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,WAAW,OAAO,CAAC,KAAK,GAAG,OAAO,CAAC,QAAQ,KAAK,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,OAAO,OAAO,CAAC,QAAQ,EAAE,EAAE,CAAC;IAC9H,GAAG,CAAC,KAAK,CACP,mBAAmB,OAAO,CAAC,SAAS,KAAK,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC,SAAS,OAAO,CAAC,OAAO,KAAK,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,KAAK,OAAO,CAAC,OAAO,EAAE,KAAK,CACnI,CAAC;IACF,GAAG,CAAC,KAAK,CAAC,KAAK,MAAM,KAAK,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC,uBAAuB,CAAC,CAAC;IAC5E,GAAG,CAAC,KAAK,CACP,aAAa,OAAO,CAAC,UAAU,IAAI,YAAY,GAAG,OAAO,CAAC,UAAU,KAAK,uBAAuB,CAAC,CAAC,CAAC,wDAAwD,CAAC,CAAC,CAAC,EAAE,IAAI,CACrK,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* How an example ends. A local run ends with its verdict and one line that
|
|
3
|
+
* says what the hosted path adds. A hosted run ends with what Decionis
|
|
4
|
+
* decided, the Decision Dossier it left, the page that verifies it (when
|
|
5
|
+
* the authority attached one), the command that verifies it offline, and
|
|
6
|
+
* the signed record itself, fetched with the run's own key and shown by its
|
|
7
|
+
* proof: the thing the local path cannot produce.
|
|
8
|
+
*/
|
|
9
|
+
import type { HostedGate } from "../decision/CreateGate.js";
|
|
10
|
+
import type { GateDecision } from "../decision/DecisionAuthority.js";
|
|
11
|
+
import { type DecisionReportOptions } from "./DecisionReport.js";
|
|
12
|
+
export interface HostedOutcomeOptions extends DecisionReportOptions {
|
|
13
|
+
/** Whether a local run prints the line about the hosted path; on by default. */
|
|
14
|
+
readonly hint?: boolean;
|
|
15
|
+
}
|
|
16
|
+
export declare const HOSTED_HINT = "hint: DECIONIS_HOSTED=1 has Decionis evaluate the same intent and sign a Decision Dossier; no account, no card, one variable";
|
|
17
|
+
export declare function printHostedOutcome(gate: HostedGate, decision: GateDecision, options?: HostedOutcomeOptions): Promise<void>;
|
|
18
|
+
//# sourceMappingURL=HostedOutcome.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"HostedOutcome.d.ts","sourceRoot":"","sources":["../../src/report/HostedOutcome.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AAC5D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,kCAAkC,CAAC;AACrE,OAAO,EAAiB,KAAK,qBAAqB,EAAE,MAAM,qBAAqB,CAAC;AAGhF,MAAM,WAAW,oBAAqB,SAAQ,qBAAqB;IACjE,gFAAgF;IAChF,QAAQ,CAAC,IAAI,CAAC,EAAE,OAAO,CAAC;CACzB;AAED,eAAO,MAAM,WAAW,iIACwG,CAAC;AAEjI,wBAAsB,kBAAkB,CACtC,IAAI,EAAE,UAAU,EAChB,QAAQ,EAAE,YAAY,EACtB,OAAO,GAAE,oBAAyB,GACjC,OAAO,CAAC,IAAI,CAAC,CAgBf"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { printDecision } from "./DecisionReport.js";
|
|
2
|
+
import { DossierFetchError, printSignedDossier } from "./DossierReport.js";
|
|
3
|
+
export const HOSTED_HINT = "hint: DECIONIS_HOSTED=1 has Decionis evaluate the same intent and sign a Decision Dossier; no account, no card, one variable";
|
|
4
|
+
export async function printHostedOutcome(gate, decision, options = {}) {
|
|
5
|
+
const out = options.out ?? process.stdout;
|
|
6
|
+
if (gate.credentials === null || gate.fetchDossier === null) {
|
|
7
|
+
if (options.hint !== false)
|
|
8
|
+
out.write(`${HOSTED_HINT}\n`);
|
|
9
|
+
return;
|
|
10
|
+
}
|
|
11
|
+
printDecision(decision, options);
|
|
12
|
+
const dossierId = decision.hosted?.dossierId ?? null;
|
|
13
|
+
if (dossierId === null)
|
|
14
|
+
return;
|
|
15
|
+
try {
|
|
16
|
+
const { summary } = await gate.fetchDossier(dossierId);
|
|
17
|
+
printSignedDossier(summary, { out });
|
|
18
|
+
}
|
|
19
|
+
catch (error) {
|
|
20
|
+
const code = error instanceof DossierFetchError ? error.code : "DOSSIER_UNAVAILABLE";
|
|
21
|
+
out.write(`signed dossier: not fetched (${code}); the record is still there under your key\n`);
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
//# sourceMappingURL=HostedOutcome.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"HostedOutcome.js","sourceRoot":"","sources":["../../src/report/HostedOutcome.ts"],"names":[],"mappings":"AAUA,OAAO,EAAE,aAAa,EAA8B,MAAM,qBAAqB,CAAC;AAChF,OAAO,EAAE,iBAAiB,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AAO3E,MAAM,CAAC,MAAM,WAAW,GACtB,8HAA8H,CAAC;AAEjI,MAAM,CAAC,KAAK,UAAU,kBAAkB,CACtC,IAAgB,EAChB,QAAsB,EACtB,UAAgC,EAAE;IAElC,MAAM,GAAG,GAAG,OAAO,CAAC,GAAG,IAAI,OAAO,CAAC,MAAM,CAAC;IAC1C,IAAI,IAAI,CAAC,WAAW,KAAK,IAAI,IAAI,IAAI,CAAC,YAAY,KAAK,IAAI,EAAE,CAAC;QAC5D,IAAI,OAAO,CAAC,IAAI,KAAK,KAAK;YAAE,GAAG,CAAC,KAAK,CAAC,GAAG,WAAW,IAAI,CAAC,CAAC;QAC1D,OAAO;IACT,CAAC;IACD,aAAa,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC;IACjC,MAAM,SAAS,GAAG,QAAQ,CAAC,MAAM,EAAE,SAAS,IAAI,IAAI,CAAC;IACrD,IAAI,SAAS,KAAK,IAAI;QAAE,OAAO;IAC/B,IAAI,CAAC;QACH,MAAM,EAAE,OAAO,EAAE,GAAG,MAAM,IAAI,CAAC,YAAY,CAAC,SAAS,CAAC,CAAC;QACvD,kBAAkB,CAAC,OAAO,EAAE,EAAE,GAAG,EAAE,CAAC,CAAC;IACvC,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,MAAM,IAAI,GAAG,KAAK,YAAY,iBAAiB,CAAC,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,qBAAqB,CAAC;QACrF,GAAG,CAAC,KAAK,CAAC,gCAAgC,IAAI,+CAA+C,CAAC,CAAC;IACjG,CAAC;AACH,CAAC"}
|
package/dist/testing/Index.d.ts
CHANGED
|
@@ -8,5 +8,5 @@
|
|
|
8
8
|
export { FixtureAuthorizationVerifier, FixtureDecisionAuthority, createFixtureAuthorityPair, type FixtureAuthorityPair, type FixtureCommitRecord, type FixtureVerdictResolver, type UnsafeFixtureAuthorityOptions, } from "../decision/FixtureDecisionAuthority.js";
|
|
9
9
|
export { InMemoryReplayStore } from "../execution/ReplayStore.js";
|
|
10
10
|
export { LocalPresence, LOCAL_PRESENCE_API_KEY, readBody, type LocalAuthenticator, type LocalCeremonyResponse, type LocalPresenceOptions, type LocalPresenceRequestRecord, type LocalReceipt, type LocalReceiptBinding, type LocalReceiptVerification, type LocalVerificationRecord, type LocalVerificationStatus, } from "./LocalPresence.js";
|
|
11
|
-
export { AUTONOMOUS_LIMIT_MINOR, HUMAN_LIMIT_MINOR, LocalAuthority, LOCAL_AUTHORITY_API_KEY, hashBinding, stableStringify, type LocalAuthorityOptions, type LocalAuthorityPolicy, type LocalAuthorityRequestRecord, type LocalGrantRecord, type LocalManagedEscalationRecord, type LocalRouteOverride, } from "./LocalAuthority.js";
|
|
11
|
+
export { AUTONOMOUS_LIMIT_MINOR, CLAIM_ATTESTATION_TYPE, EFFECT_RECEIPT_TYPE, HUMAN_LIMIT_MINOR, LocalAuthority, LOCAL_AUTHORITY_API_KEY, LOCAL_AUTHORITY_ISSUER, LOCAL_AUTHORITY_JWKS_PATH, hashBinding, stableStringify, type LocalAuthorityOptions, type LocalClaimAttestationClaims, type LocalEffectReceiptCode, type LocalEffectReceiptRecord, type LocalProviderKey, type LocalAuthorityPolicy, type LocalAuthorityRequestRecord, type LocalGrantRecord, type LocalManagedEscalationRecord, type LocalRouteOverride, } from "./LocalAuthority.js";
|
|
12
12
|
//# sourceMappingURL=Index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Index.d.ts","sourceRoot":"","sources":["../../src/testing/Index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,OAAO,EACL,4BAA4B,EAC5B,wBAAwB,EACxB,0BAA0B,EAC1B,KAAK,oBAAoB,EACzB,KAAK,mBAAmB,EACxB,KAAK,sBAAsB,EAC3B,KAAK,6BAA6B,GACnC,MAAM,yCAAyC,CAAC;AACjD,OAAO,EAAE,mBAAmB,EAAE,MAAM,6BAA6B,CAAC;AAClE,OAAO,EACL,aAAa,EACb,sBAAsB,EACtB,QAAQ,EACR,KAAK,kBAAkB,EACvB,KAAK,qBAAqB,EAC1B,KAAK,oBAAoB,EACzB,KAAK,0BAA0B,EAC/B,KAAK,YAAY,EACjB,KAAK,mBAAmB,EACxB,KAAK,wBAAwB,EAC7B,KAAK,uBAAuB,EAC5B,KAAK,uBAAuB,GAC7B,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EACL,sBAAsB,EACtB,iBAAiB,EACjB,cAAc,EACd,uBAAuB,EACvB,WAAW,EACX,eAAe,EACf,KAAK,qBAAqB,EAC1B,KAAK,oBAAoB,EACzB,KAAK,2BAA2B,EAChC,KAAK,gBAAgB,EACrB,KAAK,4BAA4B,EACjC,KAAK,kBAAkB,GACxB,MAAM,qBAAqB,CAAC"}
|
|
1
|
+
{"version":3,"file":"Index.d.ts","sourceRoot":"","sources":["../../src/testing/Index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,OAAO,EACL,4BAA4B,EAC5B,wBAAwB,EACxB,0BAA0B,EAC1B,KAAK,oBAAoB,EACzB,KAAK,mBAAmB,EACxB,KAAK,sBAAsB,EAC3B,KAAK,6BAA6B,GACnC,MAAM,yCAAyC,CAAC;AACjD,OAAO,EAAE,mBAAmB,EAAE,MAAM,6BAA6B,CAAC;AAClE,OAAO,EACL,aAAa,EACb,sBAAsB,EACtB,QAAQ,EACR,KAAK,kBAAkB,EACvB,KAAK,qBAAqB,EAC1B,KAAK,oBAAoB,EACzB,KAAK,0BAA0B,EAC/B,KAAK,YAAY,EACjB,KAAK,mBAAmB,EACxB,KAAK,wBAAwB,EAC7B,KAAK,uBAAuB,EAC5B,KAAK,uBAAuB,GAC7B,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EACL,sBAAsB,EACtB,sBAAsB,EACtB,mBAAmB,EACnB,iBAAiB,EACjB,cAAc,EACd,uBAAuB,EACvB,sBAAsB,EACtB,yBAAyB,EACzB,WAAW,EACX,eAAe,EACf,KAAK,qBAAqB,EAC1B,KAAK,2BAA2B,EAChC,KAAK,sBAAsB,EAC3B,KAAK,wBAAwB,EAC7B,KAAK,gBAAgB,EACrB,KAAK,oBAAoB,EACzB,KAAK,2BAA2B,EAChC,KAAK,gBAAgB,EACrB,KAAK,4BAA4B,EACjC,KAAK,kBAAkB,GACxB,MAAM,qBAAqB,CAAC"}
|
package/dist/testing/Index.js
CHANGED
|
@@ -8,5 +8,5 @@
|
|
|
8
8
|
export { FixtureAuthorizationVerifier, FixtureDecisionAuthority, createFixtureAuthorityPair, } from "../decision/FixtureDecisionAuthority.js";
|
|
9
9
|
export { InMemoryReplayStore } from "../execution/ReplayStore.js";
|
|
10
10
|
export { LocalPresence, LOCAL_PRESENCE_API_KEY, readBody, } from "./LocalPresence.js";
|
|
11
|
-
export { AUTONOMOUS_LIMIT_MINOR, HUMAN_LIMIT_MINOR, LocalAuthority, LOCAL_AUTHORITY_API_KEY, hashBinding, stableStringify, } from "./LocalAuthority.js";
|
|
11
|
+
export { AUTONOMOUS_LIMIT_MINOR, CLAIM_ATTESTATION_TYPE, EFFECT_RECEIPT_TYPE, HUMAN_LIMIT_MINOR, LocalAuthority, LOCAL_AUTHORITY_API_KEY, LOCAL_AUTHORITY_ISSUER, LOCAL_AUTHORITY_JWKS_PATH, hashBinding, stableStringify, } from "./LocalAuthority.js";
|
|
12
12
|
//# sourceMappingURL=Index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Index.js","sourceRoot":"","sources":["../../src/testing/Index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,OAAO,EACL,4BAA4B,EAC5B,wBAAwB,EACxB,0BAA0B,GAK3B,MAAM,yCAAyC,CAAC;AACjD,OAAO,EAAE,mBAAmB,EAAE,MAAM,6BAA6B,CAAC;AAClE,OAAO,EACL,aAAa,EACb,sBAAsB,EACtB,QAAQ,GAUT,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EACL,sBAAsB,EACtB,iBAAiB,EACjB,cAAc,EACd,uBAAuB,EACvB,WAAW,EACX,eAAe,
|
|
1
|
+
{"version":3,"file":"Index.js","sourceRoot":"","sources":["../../src/testing/Index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,OAAO,EACL,4BAA4B,EAC5B,wBAAwB,EACxB,0BAA0B,GAK3B,MAAM,yCAAyC,CAAC;AACjD,OAAO,EAAE,mBAAmB,EAAE,MAAM,6BAA6B,CAAC;AAClE,OAAO,EACL,aAAa,EACb,sBAAsB,EACtB,QAAQ,GAUT,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EACL,sBAAsB,EACtB,sBAAsB,EACtB,mBAAmB,EACnB,iBAAiB,EACjB,cAAc,EACd,uBAAuB,EACvB,sBAAsB,EACtB,yBAAyB,EACzB,WAAW,EACX,eAAe,GAWhB,MAAM,qBAAqB,CAAC"}
|
|
@@ -1,8 +1,33 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Loopback stand-in for the Decionis execution-authority routes that
|
|
3
|
+
* `@decionis/agent-safe-pipeline` consumes: enforce-and-bind (including
|
|
4
|
+
* shadow mode and managed escalation), escalation status and cancellation,
|
|
5
|
+
* claim-token with its consume-token alias, and finalize-token.
|
|
6
|
+
*
|
|
7
|
+
* It validates every request against the published OpenAPI contract with its
|
|
8
|
+
* own canonicalizer, so a hash it recomputes is independent evidence that the
|
|
9
|
+
* package binds intents the way Decionis does. Direct Presence evidence is
|
|
10
|
+
* verified against a `LocalPresence`, and a managed escalation is orchestrated
|
|
11
|
+
* through that same `LocalPresence` the way Decionis orchestrates Presence:
|
|
12
|
+
* create a request bound to the exact intent hash, wait for the ceremony,
|
|
13
|
+
* verify the receipt, re-evaluate policy, then expose a normal grant.
|
|
14
|
+
*
|
|
15
|
+
* Grants, claims, escalations, and commit outcomes are synthetic in-memory
|
|
16
|
+
* state. Nothing here is a real policy, tenant, or credential.
|
|
17
|
+
*/
|
|
18
|
+
import { type KeyObject } from "node:crypto";
|
|
1
19
|
import { z } from "zod";
|
|
2
20
|
import { type LocalPresence } from "./LocalPresence.js";
|
|
3
21
|
export declare const LOCAL_AUTHORITY_API_KEY = "test-key";
|
|
4
22
|
export declare const AUTONOMOUS_LIMIT_MINOR = 10000;
|
|
5
23
|
export declare const HUMAN_LIMIT_MINOR = 100000;
|
|
24
|
+
/** The issuer the fixture's grants and attestations name; a provider double checks it. */
|
|
25
|
+
export declare const LOCAL_AUTHORITY_ISSUER = "synthetic-authority";
|
|
26
|
+
/** Where the fixture publishes its attestation key, at the path Decionis documents. */
|
|
27
|
+
export declare const LOCAL_AUTHORITY_JWKS_PATH = "/.well-known/decionis-execution-grant-jwks.json";
|
|
28
|
+
export declare const CLAIM_ATTESTATION_TYPE = "decionis-claim-attestation+jwt";
|
|
29
|
+
/** The protected header `typ` of a verifying provider's effect receipt (VP-3). */
|
|
30
|
+
export declare const EFFECT_RECEIPT_TYPE = "decionis-effect-receipt+jwt";
|
|
6
31
|
/** `ExecutionAuthorityRequest`: the binding plus hash, mode, evidence, and managed constraints. */
|
|
7
32
|
declare const AuthorityRequestSchema: z.ZodObject<{
|
|
8
33
|
intent_hash: z.ZodString;
|
|
@@ -57,6 +82,7 @@ declare const AuthorityRequestSchema: z.ZodObject<{
|
|
|
57
82
|
operation: z.ZodString;
|
|
58
83
|
endpoint: z.ZodOptional<z.ZodString>;
|
|
59
84
|
}, z.core.$strict>;
|
|
85
|
+
expected_effect_digest: z.ZodOptional<z.ZodString>;
|
|
60
86
|
}, z.core.$strict>;
|
|
61
87
|
export type LocalAuthorityRequest = z.infer<typeof AuthorityRequestSchema>;
|
|
62
88
|
type Verdict = "ALLOW" | "ESCALATE" | "BLOCK";
|
|
@@ -102,6 +128,10 @@ export interface LocalGrantRecord {
|
|
|
102
128
|
readonly expiresAt: number;
|
|
103
129
|
readonly nonce: string;
|
|
104
130
|
readonly bindingDigest: string;
|
|
131
|
+
/** The digest the authority bound over the canonical action parameters. */
|
|
132
|
+
readonly payloadDigest: string;
|
|
133
|
+
/** The expected-effect digest committed at enforce-and-bind; null when none was bound. */
|
|
134
|
+
readonly expectedEffectDigest: string | null;
|
|
105
135
|
/** Present for direct grants issued on client-supplied evidence; null for managed grants. */
|
|
106
136
|
readonly receiptDossierId: string | null;
|
|
107
137
|
claimed: boolean;
|
|
@@ -109,6 +139,28 @@ export interface LocalGrantRecord {
|
|
|
109
139
|
correlationId: string | null;
|
|
110
140
|
consumedBy: string | null;
|
|
111
141
|
finalized: "COMMITTED" | "FAILED" | "INDETERMINATE" | null;
|
|
142
|
+
/** The provider's effect receipt as this authority read it at finalization, when one came. */
|
|
143
|
+
receipt: LocalEffectReceiptRecord | null;
|
|
144
|
+
}
|
|
145
|
+
/** The verdict codes the hosted authority records for a receipt, and this double with it. */
|
|
146
|
+
export type LocalEffectReceiptCode = "EFFECT_RECEIPT_VERIFIED" | "EFFECT_RECEIPT_MALFORMED" | "EFFECT_RECEIPT_KEY_UNKNOWN" | "EFFECT_RECEIPT_SIGNATURE_INVALID" | "EFFECT_RECEIPT_BINDING_MISMATCH";
|
|
147
|
+
export interface LocalEffectReceiptRecord {
|
|
148
|
+
readonly token: string;
|
|
149
|
+
readonly verified: boolean;
|
|
150
|
+
readonly verification_code: LocalEffectReceiptCode;
|
|
151
|
+
readonly provider_key_id: string | null;
|
|
152
|
+
readonly issuer: string | null;
|
|
153
|
+
readonly effect_status: "EFFECTED" | "REFUSED" | "INDETERMINATE" | null;
|
|
154
|
+
readonly effect_digest: string | null;
|
|
155
|
+
readonly effect_reference: string | null;
|
|
156
|
+
readonly effected_at: string | null;
|
|
157
|
+
}
|
|
158
|
+
/** A verifying provider's registered receipt key: the public half, its `kid`, the `iss` it signs as. */
|
|
159
|
+
export interface LocalProviderKey {
|
|
160
|
+
readonly kid: string;
|
|
161
|
+
readonly issuer: string;
|
|
162
|
+
readonly publicKey: KeyObject;
|
|
163
|
+
readonly label: string | null;
|
|
112
164
|
}
|
|
113
165
|
export interface LocalManagedEscalationRecord {
|
|
114
166
|
readonly escalationId: string;
|
|
@@ -135,7 +187,46 @@ export interface LocalAuthorityOptions {
|
|
|
135
187
|
readonly policy?: LocalAuthorityPolicy;
|
|
136
188
|
/** Subject routed to for a managed escalation without an approver principal. */
|
|
137
189
|
readonly managedApproverId?: string;
|
|
190
|
+
/**
|
|
191
|
+
* API-key identities this deployment accepts as effect observers, mirroring
|
|
192
|
+
* `DECIONIS_TRUSTED_EFFECT_OBSERVER_API_KEY_IDS`. Empty by default, exactly as
|
|
193
|
+
* the hosted authority is by default, so `CONFIRMED` evidence is refused
|
|
194
|
+
* unless a test opts in. As in the hosted route, the allowlist is intersected
|
|
195
|
+
* with the caller's own authenticated identity — this double's `apiKey` — so
|
|
196
|
+
* naming any other id confirms nothing.
|
|
197
|
+
*/
|
|
198
|
+
readonly trustedEffectObserverIds?: readonly string[];
|
|
138
199
|
readonly clock?: () => number;
|
|
200
|
+
/**
|
|
201
|
+
* Attach a verification envelope to every decision, as the hosted
|
|
202
|
+
* `evaluate-decision` does and `enforce-and-bind` may: a page URL under
|
|
203
|
+
* this double's own origin, so a test can see the link travel end to end.
|
|
204
|
+
*/
|
|
205
|
+
readonly verificationLinks?: boolean;
|
|
206
|
+
}
|
|
207
|
+
/** The organization a provisioned synthetic workspace belongs to. */
|
|
208
|
+
export declare const LOCAL_AUTHORITY_PROVISIONAL_ORG_ID = "00000000-0000-4000-8000-000000000008";
|
|
209
|
+
/** What one claim attestation says, as the fixture signs it and a provider double reads it. */
|
|
210
|
+
export interface LocalClaimAttestationClaims {
|
|
211
|
+
readonly iss: string;
|
|
212
|
+
readonly sub: string;
|
|
213
|
+
readonly org_id: string;
|
|
214
|
+
readonly dossier_id: string;
|
|
215
|
+
readonly decision_id: string;
|
|
216
|
+
readonly binding: {
|
|
217
|
+
readonly intent_hash: string;
|
|
218
|
+
readonly execution_payload_digest: string;
|
|
219
|
+
readonly execution_payload_canonicalization_profile: string;
|
|
220
|
+
readonly expected_effect_digest?: string;
|
|
221
|
+
readonly execution_nonce: string;
|
|
222
|
+
readonly execution_correlation_id: string;
|
|
223
|
+
};
|
|
224
|
+
readonly claim_token_digest: string;
|
|
225
|
+
readonly claim_validated_at: string;
|
|
226
|
+
readonly jti: string;
|
|
227
|
+
readonly iat: number;
|
|
228
|
+
readonly nbf: number;
|
|
229
|
+
readonly exp: number;
|
|
139
230
|
}
|
|
140
231
|
/**
|
|
141
232
|
* Independent canonicalization: keys sorted by UTF-16 code unit, values encoded
|
|
@@ -151,19 +242,66 @@ export declare class LocalAuthority {
|
|
|
151
242
|
readonly grants: Map<string, LocalGrantRecord>;
|
|
152
243
|
/** Managed escalations keyed by their opaque identifier. */
|
|
153
244
|
readonly escalations: Map<string, LocalManagedEscalationRecord>;
|
|
245
|
+
/** The verifying providers' receipt keys, by `kid`, as `/v1/execution/provider-keys` registers them. */
|
|
246
|
+
readonly providerKeys: Map<string, LocalProviderKey>;
|
|
154
247
|
private readonly apiKey;
|
|
155
248
|
private readonly presence;
|
|
156
249
|
private readonly legacyVerifyReceipt;
|
|
157
250
|
private readonly policy;
|
|
158
251
|
private readonly managedApproverId;
|
|
252
|
+
private readonly trustedEffectObserverIds;
|
|
159
253
|
private readonly clock;
|
|
254
|
+
private readonly attestationKey;
|
|
255
|
+
/** The `kid` the fixture's attestations name; a provider double looks it up in the JWKS. */
|
|
256
|
+
readonly attestationKeyId = "synthetic-exec-grant-1";
|
|
257
|
+
/**
|
|
258
|
+
* A drill knob: when set, the next claim binds a digest over parameters
|
|
259
|
+
* other than the ones captured, which is what a tampered or mismatched
|
|
260
|
+
* authority looks like from the executor's side, and what BEAP-L3-BND-01
|
|
261
|
+
* says the executor must refuse.
|
|
262
|
+
*/
|
|
263
|
+
misbindNextPayloadDigest: boolean;
|
|
160
264
|
private readonly overrides;
|
|
161
265
|
private readonly managedByIntent;
|
|
162
266
|
private nextManagedLifecycle;
|
|
163
267
|
private decisions;
|
|
268
|
+
/** Every decision minted, by dossier id, for `GET /v1/protocol/dossiers/{id}`. */
|
|
269
|
+
private readonly dossiers;
|
|
270
|
+
private readonly verificationLinks;
|
|
164
271
|
private server;
|
|
165
272
|
private port;
|
|
166
273
|
constructor(options?: LocalAuthorityOptions);
|
|
274
|
+
/** The fixture's JWKS, as `GET /.well-known/decionis-execution-grant-jwks.json` serves it. */
|
|
275
|
+
get jwks(): {
|
|
276
|
+
readonly keys: readonly Record<string, unknown>[];
|
|
277
|
+
};
|
|
278
|
+
/**
|
|
279
|
+
* A compact JWS over the claim, signed the way Decionis signs one: EdDSA,
|
|
280
|
+
* the grant key, the attestation type in the protected header. Built with
|
|
281
|
+
* `node:crypto` alone so the fixture stays an independent implementation.
|
|
282
|
+
*/
|
|
283
|
+
private attest;
|
|
284
|
+
/**
|
|
285
|
+
* Registers the public half of a provider's receipt key, as the hosted
|
|
286
|
+
* `POST /v1/execution/provider-keys` does; a test or a demo provider calls
|
|
287
|
+
* it directly rather than over HTTP.
|
|
288
|
+
*/
|
|
289
|
+
registerProviderKey(input: {
|
|
290
|
+
readonly kid: string;
|
|
291
|
+
readonly issuer: string;
|
|
292
|
+
readonly publicJwk: JsonWebKey;
|
|
293
|
+
readonly label?: string;
|
|
294
|
+
}): void;
|
|
295
|
+
/**
|
|
296
|
+
* Reads a receipt the way the hosted authority does: the protected header
|
|
297
|
+
* names an Ed25519 key the organisation registered; the signature verifies
|
|
298
|
+
* under it; the issuer is the one registered with the key and the audience
|
|
299
|
+
* is this authority; and the claims describe this grant and this claim,
|
|
300
|
+
* through `sub`, the decision and dossier ids and the digest of the claim
|
|
301
|
+
* token being finalized. Anything else is recorded with its code, and the
|
|
302
|
+
* finalization proceeds regardless.
|
|
303
|
+
*/
|
|
304
|
+
private readEffectReceipt;
|
|
167
305
|
get baseUrl(): string;
|
|
168
306
|
start(): Promise<void>;
|
|
169
307
|
stop(): Promise<void>;
|
|
@@ -176,7 +314,18 @@ export declare class LocalAuthority {
|
|
|
176
314
|
/** Statuses returned, in order, for the next managed escalation instead of orchestration. */
|
|
177
315
|
scriptNextManagedLifecycle(statuses: readonly LifecycleEntry[]): void;
|
|
178
316
|
private handle;
|
|
317
|
+
/** `POST /v1/execution/provider-keys`: the public half only, or a 400 naming why. */
|
|
318
|
+
private registerProviderKeyRoute;
|
|
179
319
|
private enforceAndBind;
|
|
320
|
+
/** Keeps a minted decision for its dossier route, with the envelope when links are on. */
|
|
321
|
+
private remember;
|
|
322
|
+
/**
|
|
323
|
+
* The persisted record, shaped as `GET /v1/protocol/dossiers/{id}` returns
|
|
324
|
+
* it: a payload with the routing decision, the inputs and a proof bundle
|
|
325
|
+
* naming this double's key. The artifacts are not signed; the record says
|
|
326
|
+
* so in its issuer tier, and nothing here claims otherwise.
|
|
327
|
+
*/
|
|
328
|
+
private dossierRecord;
|
|
180
329
|
/** Policy plus evidence handling: a valid receipt turns an escalation into an allow. */
|
|
181
330
|
private evaluate;
|
|
182
331
|
private verifyEvidence;
|
|
@@ -193,6 +342,13 @@ export declare class LocalAuthority {
|
|
|
193
342
|
private cancelManaged;
|
|
194
343
|
private claim;
|
|
195
344
|
private finalize;
|
|
345
|
+
/**
|
|
346
|
+
* The hosted route never trusts the allowlist alone: it returns at most the
|
|
347
|
+
* caller's own authenticated API-key identity, so a confirmed observation
|
|
348
|
+
* must name the identity that presented the credential. This double has one
|
|
349
|
+
* credential, so that credential is its identity.
|
|
350
|
+
*/
|
|
351
|
+
private effectObserverIds;
|
|
196
352
|
/** Recomputes the hash independently and applies the contract's time rules. */
|
|
197
353
|
private assertBinding;
|
|
198
354
|
private respond;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LocalAuthority.d.ts","sourceRoot":"","sources":["../../src/testing/LocalAuthority.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"LocalAuthority.d.ts","sourceRoot":"","sources":["../../src/testing/LocalAuthority.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AACH,OAAO,EAQL,KAAK,SAAS,EACf,MAAM,aAAa,CAAC;AAErB,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAY,KAAK,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAElE,eAAO,MAAM,uBAAuB,aAAa,CAAC;AAClD,eAAO,MAAM,sBAAsB,QAAS,CAAC;AAC7C,eAAO,MAAM,iBAAiB,SAAU,CAAC;AAQzC,0FAA0F;AAC1F,eAAO,MAAM,sBAAsB,wBAAwB,CAAC;AAC5D,uFAAuF;AACvF,eAAO,MAAM,yBAAyB,oDAAoD,CAAC;AAC3F,eAAO,MAAM,sBAAsB,mCAAmC,CAAC;AACvE,kFAAkF;AAClF,eAAO,MAAM,mBAAmB,gCAAgC,CAAC;AA4HjE,mGAAmG;AACnG,QAAA,MAAM,sBAAsB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kBAM1B,CAAC;AA+CH,MAAM,MAAM,qBAAqB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,sBAAsB,CAAC,CAAC;AAE3E,KAAK,OAAO,GAAG,OAAO,G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