@openvtc/trust-tasks 0.12.16 → 0.13.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 +27 -3
- package/dist/_runtime/canonical.d.ts +40 -0
- package/dist/_runtime/canonical.d.ts.map +1 -0
- package/dist/_runtime/canonical.js +147 -0
- package/dist/_runtime/canonical.js.map +1 -0
- package/dist/_runtime/consume.d.ts +108 -2
- package/dist/_runtime/consume.d.ts.map +1 -1
- package/dist/_runtime/consume.js +174 -8
- package/dist/_runtime/consume.js.map +1 -1
- package/dist/_runtime/document.d.ts +17 -4
- package/dist/_runtime/document.d.ts.map +1 -1
- package/dist/_runtime/document.js +17 -4
- package/dist/_runtime/document.js.map +1 -1
- package/dist/_runtime/freshness.d.ts +105 -0
- package/dist/_runtime/freshness.d.ts.map +1 -0
- package/dist/_runtime/freshness.js +142 -0
- package/dist/_runtime/freshness.js.map +1 -0
- package/dist/_runtime/index.d.ts +4 -1
- package/dist/_runtime/index.d.ts.map +1 -1
- package/dist/_runtime/index.js +4 -1
- package/dist/_runtime/index.js.map +1 -1
- package/dist/_runtime/replay.d.ts +176 -0
- package/dist/_runtime/replay.d.ts.map +1 -0
- package/dist/_runtime/replay.js +147 -0
- package/dist/_runtime/replay.js.map +1 -0
- package/dist/keys/create/0.1/payload.d.ts +27 -13
- package/dist/keys/create/0.1/payload.d.ts.map +1 -1
- package/dist/keys/create/0.1/payload.js +11 -5
- package/dist/keys/create/0.1/payload.js.map +1 -1
- package/dist/keys/import/0.1/payload.d.ts +10 -10
- package/dist/keys/import/0.1/payload.d.ts.map +1 -1
- package/dist/keys/import/0.1/payload.js +6 -4
- package/dist/keys/import/0.1/payload.js.map +1 -1
- package/dist/keys/list/0.1/payload.d.ts +10 -10
- package/dist/keys/list/0.1/payload.d.ts.map +1 -1
- package/dist/keys/list/0.1/payload.js +6 -4
- package/dist/keys/list/0.1/payload.js.map +1 -1
- package/dist/keys/show/0.1/payload.d.ts +10 -10
- package/dist/keys/show/0.1/payload.d.ts.map +1 -1
- package/dist/keys/show/0.1/payload.js +6 -4
- package/dist/keys/show/0.1/payload.js.map +1 -1
- package/package.json +1 -1
- package/src/_runtime/canonical.ts +159 -0
- package/src/_runtime/consume.ts +267 -10
- package/src/_runtime/document.ts +17 -4
- package/src/_runtime/freshness.ts +183 -0
- package/src/_runtime/index.ts +30 -0
- package/src/_runtime/replay.ts +250 -0
- package/src/keys/create/0.1/payload.ts +20 -8
- package/src/keys/import/0.1/payload.ts +8 -6
- package/src/keys/list/0.1/payload.ts +8 -6
- package/src/keys/show/0.1/payload.ts +8 -6
package/dist/_runtime/index.d.ts
CHANGED
|
@@ -12,5 +12,8 @@
|
|
|
12
12
|
export { TRUST_TASK_ERROR_TYPE_URI, enforceAudienceBinding, enforceSpecPolicy, rejectWith, rejectWithRecipient, respondWith, toErrorPayload, validateBasic, type ErrorPayload, type ErrorResponse, type InResponseTo, type Proof, type RejectReason, type SpecPolicy, type TrustTaskDocument, } from "./document.js";
|
|
13
13
|
export { STANDARD_CODES, extendedCode, familyCode, isStandardCode, normalizeCode, slugFromTypeUri, type StandardCode, } from "./codes.js";
|
|
14
14
|
export { StaticTransport, UnauthenticatedTransport, identityMismatchReason, reject, resolveParties, type ConsistencyError, type ResolvedParties, type TransportContext, type TransportHandler, } from "./transport.js";
|
|
15
|
-
export { PROOF_NOT_ACCEPTED_BY_POLICY, consumeInbound, refuse, type ConsumeOptions, type ConsumeOutcome, type PayloadPolicy, type PayloadValidator, type ProofPolicy, type ProofVerifier, } from "./consume.js";
|
|
15
|
+
export { ID_CONFLICT_WIRE_MESSAGE, PROOF_INVALID_WIRE_MESSAGE, PROOF_NOT_ACCEPTED_BY_POLICY, REPLAY_RECORD_UNAVAILABLE, consequentialChecks, consumeInbound, notConsequentialChecks, refuse, type ConsumeChecks, type ConsumeOptions, type ConsumeOutcome, type PayloadPolicy, type PayloadValidator, type ProofPolicy, type ProofVerifier, } from "./consume.js";
|
|
16
|
+
export { canonicalJson, sha256Hex } from "./canonical.js";
|
|
17
|
+
export { CONSEQUENTIAL_FRESHNESS, DEFAULT_FRESHNESS, DEFAULT_MAX_AGE_MS, DEFAULT_SKEW_MS, EXPIRY_NOT_AFTER_ISSUANCE, FUTURE_ISSUED_AT, ISSUED_AT_REQUIRED, STALE_WIRE_MESSAGE, recordExpiry, validateFreshness, type FreshnessPolicy, } from "./freshness.js";
|
|
18
|
+
export { InMemoryReplayGuard, documentDigest, type ReplayGuard, type ReplayPolicy, type ReplayVerdict, } from "./replay.js";
|
|
16
19
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/_runtime/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,EACL,yBAAyB,EACzB,sBAAsB,EACtB,iBAAiB,EACjB,UAAU,EACV,mBAAmB,EACnB,WAAW,EACX,cAAc,EACd,aAAa,EACb,KAAK,YAAY,EACjB,KAAK,aAAa,EAClB,KAAK,YAAY,EACjB,KAAK,KAAK,EACV,KAAK,YAAY,EACjB,KAAK,UAAU,EACf,KAAK,iBAAiB,GACvB,MAAM,eAAe,CAAC;AAEvB,OAAO,EACL,cAAc,EACd,YAAY,EACZ,UAAU,EACV,cAAc,EACd,aAAa,EACb,eAAe,EACf,KAAK,YAAY,GAClB,MAAM,YAAY,CAAC;AAEpB,OAAO,EACL,eAAe,EACf,wBAAwB,EACxB,sBAAsB,EACtB,MAAM,EACN,cAAc,EACd,KAAK,gBAAgB,EACrB,KAAK,eAAe,EACpB,KAAK,gBAAgB,EACrB,KAAK,gBAAgB,GACtB,MAAM,gBAAgB,CAAC;AAExB,OAAO,EACL,4BAA4B,EAC5B,cAAc,EACd,MAAM,EACN,KAAK,cAAc,EACnB,KAAK,cAAc,EACnB,KAAK,aAAa,EAClB,KAAK,gBAAgB,EACrB,KAAK,WAAW,EAChB,KAAK,aAAa,GACnB,MAAM,cAAc,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/_runtime/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,EACL,yBAAyB,EACzB,sBAAsB,EACtB,iBAAiB,EACjB,UAAU,EACV,mBAAmB,EACnB,WAAW,EACX,cAAc,EACd,aAAa,EACb,KAAK,YAAY,EACjB,KAAK,aAAa,EAClB,KAAK,YAAY,EACjB,KAAK,KAAK,EACV,KAAK,YAAY,EACjB,KAAK,UAAU,EACf,KAAK,iBAAiB,GACvB,MAAM,eAAe,CAAC;AAEvB,OAAO,EACL,cAAc,EACd,YAAY,EACZ,UAAU,EACV,cAAc,EACd,aAAa,EACb,eAAe,EACf,KAAK,YAAY,GAClB,MAAM,YAAY,CAAC;AAEpB,OAAO,EACL,eAAe,EACf,wBAAwB,EACxB,sBAAsB,EACtB,MAAM,EACN,cAAc,EACd,KAAK,gBAAgB,EACrB,KAAK,eAAe,EACpB,KAAK,gBAAgB,EACrB,KAAK,gBAAgB,GACtB,MAAM,gBAAgB,CAAC;AAExB,OAAO,EACL,wBAAwB,EACxB,0BAA0B,EAC1B,4BAA4B,EAC5B,yBAAyB,EACzB,mBAAmB,EACnB,cAAc,EACd,sBAAsB,EACtB,MAAM,EACN,KAAK,aAAa,EAClB,KAAK,cAAc,EACnB,KAAK,cAAc,EACnB,KAAK,aAAa,EAClB,KAAK,gBAAgB,EACrB,KAAK,WAAW,EAChB,KAAK,aAAa,GACnB,MAAM,cAAc,CAAC;AAEtB,OAAO,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAE1D,OAAO,EACL,uBAAuB,EACvB,iBAAiB,EACjB,kBAAkB,EAClB,eAAe,EACf,yBAAyB,EACzB,gBAAgB,EAChB,kBAAkB,EAClB,kBAAkB,EAClB,YAAY,EACZ,iBAAiB,EACjB,KAAK,eAAe,GACrB,MAAM,gBAAgB,CAAC;AAExB,OAAO,EACL,mBAAmB,EACnB,cAAc,EACd,KAAK,WAAW,EAChB,KAAK,YAAY,EACjB,KAAK,aAAa,GACnB,MAAM,aAAa,CAAC"}
|
package/dist/_runtime/index.js
CHANGED
|
@@ -12,5 +12,8 @@
|
|
|
12
12
|
export { TRUST_TASK_ERROR_TYPE_URI, enforceAudienceBinding, enforceSpecPolicy, rejectWith, rejectWithRecipient, respondWith, toErrorPayload, validateBasic, } from "./document.js";
|
|
13
13
|
export { STANDARD_CODES, extendedCode, familyCode, isStandardCode, normalizeCode, slugFromTypeUri, } from "./codes.js";
|
|
14
14
|
export { StaticTransport, UnauthenticatedTransport, identityMismatchReason, reject, resolveParties, } from "./transport.js";
|
|
15
|
-
export { PROOF_NOT_ACCEPTED_BY_POLICY, consumeInbound, refuse, } from "./consume.js";
|
|
15
|
+
export { ID_CONFLICT_WIRE_MESSAGE, PROOF_INVALID_WIRE_MESSAGE, PROOF_NOT_ACCEPTED_BY_POLICY, REPLAY_RECORD_UNAVAILABLE, consequentialChecks, consumeInbound, notConsequentialChecks, refuse, } from "./consume.js";
|
|
16
|
+
export { canonicalJson, sha256Hex } from "./canonical.js";
|
|
17
|
+
export { CONSEQUENTIAL_FRESHNESS, DEFAULT_FRESHNESS, DEFAULT_MAX_AGE_MS, DEFAULT_SKEW_MS, EXPIRY_NOT_AFTER_ISSUANCE, FUTURE_ISSUED_AT, ISSUED_AT_REQUIRED, STALE_WIRE_MESSAGE, recordExpiry, validateFreshness, } from "./freshness.js";
|
|
18
|
+
export { InMemoryReplayGuard, documentDigest, } from "./replay.js";
|
|
16
19
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/_runtime/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,EACL,yBAAyB,EACzB,sBAAsB,EACtB,iBAAiB,EACjB,UAAU,EACV,mBAAmB,EACnB,WAAW,EACX,cAAc,EACd,aAAa,GAQd,MAAM,eAAe,CAAC;AAEvB,OAAO,EACL,cAAc,EACd,YAAY,EACZ,UAAU,EACV,cAAc,EACd,aAAa,EACb,eAAe,GAEhB,MAAM,YAAY,CAAC;AAEpB,OAAO,EACL,eAAe,EACf,wBAAwB,EACxB,sBAAsB,EACtB,MAAM,EACN,cAAc,GAKf,MAAM,gBAAgB,CAAC;AAExB,OAAO,EACL,4BAA4B,EAC5B,cAAc,EACd,MAAM,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/_runtime/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,EACL,yBAAyB,EACzB,sBAAsB,EACtB,iBAAiB,EACjB,UAAU,EACV,mBAAmB,EACnB,WAAW,EACX,cAAc,EACd,aAAa,GAQd,MAAM,eAAe,CAAC;AAEvB,OAAO,EACL,cAAc,EACd,YAAY,EACZ,UAAU,EACV,cAAc,EACd,aAAa,EACb,eAAe,GAEhB,MAAM,YAAY,CAAC;AAEpB,OAAO,EACL,eAAe,EACf,wBAAwB,EACxB,sBAAsB,EACtB,MAAM,EACN,cAAc,GAKf,MAAM,gBAAgB,CAAC;AAExB,OAAO,EACL,wBAAwB,EACxB,0BAA0B,EAC1B,4BAA4B,EAC5B,yBAAyB,EACzB,mBAAmB,EACnB,cAAc,EACd,sBAAsB,EACtB,MAAM,GAQP,MAAM,cAAc,CAAC;AAEtB,OAAO,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAE1D,OAAO,EACL,uBAAuB,EACvB,iBAAiB,EACjB,kBAAkB,EAClB,eAAe,EACf,yBAAyB,EACzB,gBAAgB,EAChB,kBAAkB,EAClB,kBAAkB,EAClB,YAAY,EACZ,iBAAiB,GAElB,MAAM,gBAAgB,CAAC;AAExB,OAAO,EACL,mBAAmB,EACnB,cAAc,GAIf,MAAM,aAAa,CAAC"}
|
|
@@ -0,0 +1,176 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Duplicate-execution protection — SPEC §7.2 item 11, §8.4, §10.1.
|
|
3
|
+
*
|
|
4
|
+
* Mirrors `replay.rs` in trust-tasks-rs, check for check.
|
|
5
|
+
*
|
|
6
|
+
* # The rule
|
|
7
|
+
*
|
|
8
|
+
* §7.2 item 11 is normative and unconditional for a *consequential Trust
|
|
9
|
+
* Task*: once a consumer has accepted a document with a given `id` for
|
|
10
|
+
* execution, receiving that same document again **MUST NOT** cause the
|
|
11
|
+
* consequential effect a second time, and receiving a *different* document
|
|
12
|
+
* under the same `id` **MUST** be rejected with `idConflict`.
|
|
13
|
+
*
|
|
14
|
+
* §8.4 is the same mechanism from the producer's end: a retry is a bit-for-bit
|
|
15
|
+
* identical resend, and it is safe *precisely because* item 11 obliges the
|
|
16
|
+
* consumer to absorb it. Every transport binding in this repo delegates replay
|
|
17
|
+
* defence to the consumer — `bindings/https/0.2` §5 says "Freshness / replay:
|
|
18
|
+
* None", and the DIDComm and TSP bindings say the same — so if the consumer
|
|
19
|
+
* does not do it, nobody does, and an ordinary mediator redelivery grants an
|
|
20
|
+
* ACL entry twice by accident. §10.1: "The rule deliberately does not
|
|
21
|
+
* distinguish a hostile replay from a legitimate transport retry, because at
|
|
22
|
+
* the document layer the two are indistinguishable."
|
|
23
|
+
*
|
|
24
|
+
* # The key
|
|
25
|
+
*
|
|
26
|
+
* The `id` **alone** — "Transport request identifiers, transport message
|
|
27
|
+
* identifiers, and execution handles **MUST NOT** substitute" — plus a digest
|
|
28
|
+
* of the canonical serialization, because "an `id` alone cannot distinguish
|
|
29
|
+
* the retry it must absorb from the conflict it must reject".
|
|
30
|
+
*
|
|
31
|
+
* {@link documentDigest} hashes {@link canonicalJson} of the whole document
|
|
32
|
+
* rather than the octets as received: a re-indented body or a member order
|
|
33
|
+
* chosen by an intermediary would otherwise make a legitimate §8.4 retry look
|
|
34
|
+
* like a *different* document.
|
|
35
|
+
*
|
|
36
|
+
* The digest covers the **entire** document, `proof` included. That differs
|
|
37
|
+
* deliberately from the §4.9.3 *task digest*, computed over
|
|
38
|
+
* `JCS(document ∖ proof)`, and the spec spells the distinction out: "Item 11
|
|
39
|
+
* and §8.4 ask *which serialization arrived*, so a re-signed `proof` over
|
|
40
|
+
* identical content makes a different document — that is the `idConflict`
|
|
41
|
+
* case, and the distinction is the whole point of the rule."
|
|
42
|
+
*/
|
|
43
|
+
import type { TrustTaskDocument } from "./document.js";
|
|
44
|
+
/**
|
|
45
|
+
* The content identity of a document, per SPEC §7.2's keying paragraph:
|
|
46
|
+
* SHA-256 over the canonical serialization of the whole document, as hex.
|
|
47
|
+
*
|
|
48
|
+
* Consumer-local. Never on the wire, and **not** the §4.9.3 task digest.
|
|
49
|
+
*/
|
|
50
|
+
export declare function documentDigest<P>(doc: TrustTaskDocument<P>): string;
|
|
51
|
+
/** What a {@link ReplayGuard} says about a document offered for execution. */
|
|
52
|
+
export type ReplayVerdict =
|
|
53
|
+
/** Not seen before. The caller may execute. */
|
|
54
|
+
{
|
|
55
|
+
kind: "fresh";
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* Already accepted under the *same* digest — a §8.4 retry, or a replay. The
|
|
59
|
+
* caller **MUST NOT** execute again.
|
|
60
|
+
*/
|
|
61
|
+
| {
|
|
62
|
+
kind: "duplicate";
|
|
63
|
+
/** The response the first execution produced, where one was retained. */
|
|
64
|
+
priorResponse?: unknown;
|
|
65
|
+
/** Whether that first execution is still running. */
|
|
66
|
+
inFlight: boolean;
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* Already accepted under a *different* digest. §7.2 item 11 requires
|
|
70
|
+
* `idConflict`, and requires that this not be treated as a retry.
|
|
71
|
+
*/
|
|
72
|
+
| {
|
|
73
|
+
kind: "conflict";
|
|
74
|
+
};
|
|
75
|
+
/**
|
|
76
|
+
* The consumer-side record that makes SPEC §7.2 item 11 true.
|
|
77
|
+
*
|
|
78
|
+
* An interface, so a deployment can back it with Redis, Postgres, or anything
|
|
79
|
+
* that survives a process restart. {@link InMemoryReplayGuard} is the default
|
|
80
|
+
* and is correct for a single-process consumer; it is **not** correct behind a
|
|
81
|
+
* load balancer, where two replicas would each accept the same document once.
|
|
82
|
+
*/
|
|
83
|
+
export interface ReplayGuard {
|
|
84
|
+
/**
|
|
85
|
+
* Claim `id` for execution on behalf of a document with identity `digest`.
|
|
86
|
+
*
|
|
87
|
+
* `retainUntil` is the instant past which the record may be dropped —
|
|
88
|
+
* {@link recordExpiry}, which SPEC §7.2 makes the same instant as the end of
|
|
89
|
+
* the consumer's willingness to execute the document. An implementation
|
|
90
|
+
* SHOULD treat a record whose `retainUntil` has passed as absent, so the key
|
|
91
|
+
* is released rather than conflicting forever with a document nobody would
|
|
92
|
+
* execute.
|
|
93
|
+
*
|
|
94
|
+
* Implementations **MUST** make claim-and-record atomic with respect to
|
|
95
|
+
* concurrent calls: two simultaneous deliveries of the same document must
|
|
96
|
+
* not both receive `fresh`. That is the whole guarantee.
|
|
97
|
+
*
|
|
98
|
+
* Throwing means the record could not be consulted. {@link consumeInbound}
|
|
99
|
+
* fails closed on that, mapping it to `unavailable` with `retryable: true` —
|
|
100
|
+
* a consumer that cannot establish whether a document is a duplicate has not
|
|
101
|
+
* satisfied item 11, and executing anyway is the double execution the rule
|
|
102
|
+
* forbids.
|
|
103
|
+
*/
|
|
104
|
+
claim(id: string, digest: string, retainUntil: number | undefined, now: number): Promise<ReplayVerdict> | ReplayVerdict;
|
|
105
|
+
/**
|
|
106
|
+
* Attach the response a completed execution produced, so a later duplicate
|
|
107
|
+
* can be answered with it per §7.2 (*Disposition of a duplicate*) rather
|
|
108
|
+
* than merely absorbed in silence.
|
|
109
|
+
*
|
|
110
|
+
* Optional: a guard that records nothing still satisfies item 11 — the
|
|
111
|
+
* effect does not happen twice — and is the right shape for a
|
|
112
|
+
* fire-and-forget specification, which has no response to return.
|
|
113
|
+
*/
|
|
114
|
+
recordResponse?(id: string, response: unknown): Promise<void> | void;
|
|
115
|
+
/**
|
|
116
|
+
* Release a claim whose execution is not to stand — for example a refusal
|
|
117
|
+
* the consumer marked `retryable`, where §8.4 has just invited the producer
|
|
118
|
+
* to re-send the same bytes. Without this, that invited retry would come
|
|
119
|
+
* back as an absorbed duplicate carrying the same failure forever.
|
|
120
|
+
*/
|
|
121
|
+
release?(id: string, digest: string): Promise<void> | void;
|
|
122
|
+
}
|
|
123
|
+
/** How a consumer applies SPEC §7.2 item 11 in {@link consumeInbound}. */
|
|
124
|
+
export type ReplayPolicy =
|
|
125
|
+
/** Apply item 11 using this guard. Correct for any consequential spec. */
|
|
126
|
+
{
|
|
127
|
+
kind: "guard";
|
|
128
|
+
guard: ReplayGuard;
|
|
129
|
+
}
|
|
130
|
+
/**
|
|
131
|
+
* Keep no duplicate-execution record. Conformant **only** where the task is
|
|
132
|
+
* not consequential (§2), or where the specification "explicitly declares
|
|
133
|
+
* repeated execution safe and intended" — a property of the operation, not
|
|
134
|
+
* of the consumer's convenience.
|
|
135
|
+
*/
|
|
136
|
+
| {
|
|
137
|
+
kind: "notConsequential";
|
|
138
|
+
};
|
|
139
|
+
/**
|
|
140
|
+
* A bounded, in-process {@link ReplayGuard}: an LRU map from `id` to the
|
|
141
|
+
* digest accepted under it, its retention deadline, and the response it
|
|
142
|
+
* produced.
|
|
143
|
+
*
|
|
144
|
+
* **Suitable when** one process is the sole consumer for the `recipient` VID
|
|
145
|
+
* it serves and losing the record on restart is acceptable.
|
|
146
|
+
*
|
|
147
|
+
* **Not suitable when** the consumer is replicated: two replicas hold separate
|
|
148
|
+
* maps, so a document accepted by replica A is `fresh` at replica B and the
|
|
149
|
+
* effect happens twice — the exact failure item 11 exists to prevent.
|
|
150
|
+
* Replicated deployments MUST back the guard with a shared store.
|
|
151
|
+
*
|
|
152
|
+
* Eviction is by capacity as well as by `retainUntil`: a burst of distinct
|
|
153
|
+
* documents can push an older record out before its deadline, and a replay
|
|
154
|
+
* arriving after that would be accepted. Size the capacity above the number of
|
|
155
|
+
* distinct documents the widest acceptance window can hold.
|
|
156
|
+
*
|
|
157
|
+
* `Map` preserves insertion order, which is what makes the LRU a delete-then-
|
|
158
|
+
* reinsert rather than a second index.
|
|
159
|
+
*/
|
|
160
|
+
export declare class InMemoryReplayGuard implements ReplayGuard {
|
|
161
|
+
#private;
|
|
162
|
+
/**
|
|
163
|
+
* @param capacity Maximum records retained. Must be positive: a guard that
|
|
164
|
+
* retains nothing answers `fresh` to everything, which is a silent total
|
|
165
|
+
* defeat of item 11 rather than a visible misconfiguration.
|
|
166
|
+
*/
|
|
167
|
+
constructor(capacity?: number);
|
|
168
|
+
/** Number of records currently retained. For tests and metrics. */
|
|
169
|
+
get size(): number;
|
|
170
|
+
/** Drop every record whose `retainUntil` has passed. */
|
|
171
|
+
purgeExpired(now: number): void;
|
|
172
|
+
claim(id: string, digest: string, retainUntil: number | undefined, now: number): ReplayVerdict;
|
|
173
|
+
recordResponse(id: string, response: unknown): void;
|
|
174
|
+
release(id: string, digest: string): void;
|
|
175
|
+
}
|
|
176
|
+
//# sourceMappingURL=replay.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"replay.d.ts","sourceRoot":"","sources":["../../src/_runtime/replay.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAyCG;AAGH,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AAEvD;;;;;GAKG;AACH,wBAAgB,cAAc,CAAC,CAAC,EAAE,GAAG,EAAE,iBAAiB,CAAC,CAAC,CAAC,GAAG,MAAM,CAEnE;AAED,8EAA8E;AAC9E,MAAM,MAAM,aAAa;AACvB,+CAA+C;AAC7C;IAAE,IAAI,EAAE,OAAO,CAAA;CAAE;AACnB;;;GAGG;GACD;IACE,IAAI,EAAE,WAAW,CAAC;IAClB,yEAAyE;IACzE,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,qDAAqD;IACrD,QAAQ,EAAE,OAAO,CAAC;CACnB;AACH;;;GAGG;GACD;IAAE,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M,GAAG,IAAI;CAS1C"}
|
|
@@ -0,0 +1,147 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Duplicate-execution protection — SPEC §7.2 item 11, §8.4, §10.1.
|
|
3
|
+
*
|
|
4
|
+
* Mirrors `replay.rs` in trust-tasks-rs, check for check.
|
|
5
|
+
*
|
|
6
|
+
* # The rule
|
|
7
|
+
*
|
|
8
|
+
* §7.2 item 11 is normative and unconditional for a *consequential Trust
|
|
9
|
+
* Task*: once a consumer has accepted a document with a given `id` for
|
|
10
|
+
* execution, receiving that same document again **MUST NOT** cause the
|
|
11
|
+
* consequential effect a second time, and receiving a *different* document
|
|
12
|
+
* under the same `id` **MUST** be rejected with `idConflict`.
|
|
13
|
+
*
|
|
14
|
+
* §8.4 is the same mechanism from the producer's end: a retry is a bit-for-bit
|
|
15
|
+
* identical resend, and it is safe *precisely because* item 11 obliges the
|
|
16
|
+
* consumer to absorb it. Every transport binding in this repo delegates replay
|
|
17
|
+
* defence to the consumer — `bindings/https/0.2` §5 says "Freshness / replay:
|
|
18
|
+
* None", and the DIDComm and TSP bindings say the same — so if the consumer
|
|
19
|
+
* does not do it, nobody does, and an ordinary mediator redelivery grants an
|
|
20
|
+
* ACL entry twice by accident. §10.1: "The rule deliberately does not
|
|
21
|
+
* distinguish a hostile replay from a legitimate transport retry, because at
|
|
22
|
+
* the document layer the two are indistinguishable."
|
|
23
|
+
*
|
|
24
|
+
* # The key
|
|
25
|
+
*
|
|
26
|
+
* The `id` **alone** — "Transport request identifiers, transport message
|
|
27
|
+
* identifiers, and execution handles **MUST NOT** substitute" — plus a digest
|
|
28
|
+
* of the canonical serialization, because "an `id` alone cannot distinguish
|
|
29
|
+
* the retry it must absorb from the conflict it must reject".
|
|
30
|
+
*
|
|
31
|
+
* {@link documentDigest} hashes {@link canonicalJson} of the whole document
|
|
32
|
+
* rather than the octets as received: a re-indented body or a member order
|
|
33
|
+
* chosen by an intermediary would otherwise make a legitimate §8.4 retry look
|
|
34
|
+
* like a *different* document.
|
|
35
|
+
*
|
|
36
|
+
* The digest covers the **entire** document, `proof` included. That differs
|
|
37
|
+
* deliberately from the §4.9.3 *task digest*, computed over
|
|
38
|
+
* `JCS(document ∖ proof)`, and the spec spells the distinction out: "Item 11
|
|
39
|
+
* and §8.4 ask *which serialization arrived*, so a re-signed `proof` over
|
|
40
|
+
* identical content makes a different document — that is the `idConflict`
|
|
41
|
+
* case, and the distinction is the whole point of the rule."
|
|
42
|
+
*/
|
|
43
|
+
import { canonicalJson, sha256Hex } from "./canonical.js";
|
|
44
|
+
/**
|
|
45
|
+
* The content identity of a document, per SPEC §7.2's keying paragraph:
|
|
46
|
+
* SHA-256 over the canonical serialization of the whole document, as hex.
|
|
47
|
+
*
|
|
48
|
+
* Consumer-local. Never on the wire, and **not** the §4.9.3 task digest.
|
|
49
|
+
*/
|
|
50
|
+
export function documentDigest(doc) {
|
|
51
|
+
return sha256Hex(canonicalJson(doc));
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* A bounded, in-process {@link ReplayGuard}: an LRU map from `id` to the
|
|
55
|
+
* digest accepted under it, its retention deadline, and the response it
|
|
56
|
+
* produced.
|
|
57
|
+
*
|
|
58
|
+
* **Suitable when** one process is the sole consumer for the `recipient` VID
|
|
59
|
+
* it serves and losing the record on restart is acceptable.
|
|
60
|
+
*
|
|
61
|
+
* **Not suitable when** the consumer is replicated: two replicas hold separate
|
|
62
|
+
* maps, so a document accepted by replica A is `fresh` at replica B and the
|
|
63
|
+
* effect happens twice — the exact failure item 11 exists to prevent.
|
|
64
|
+
* Replicated deployments MUST back the guard with a shared store.
|
|
65
|
+
*
|
|
66
|
+
* Eviction is by capacity as well as by `retainUntil`: a burst of distinct
|
|
67
|
+
* documents can push an older record out before its deadline, and a replay
|
|
68
|
+
* arriving after that would be accepted. Size the capacity above the number of
|
|
69
|
+
* distinct documents the widest acceptance window can hold.
|
|
70
|
+
*
|
|
71
|
+
* `Map` preserves insertion order, which is what makes the LRU a delete-then-
|
|
72
|
+
* reinsert rather than a second index.
|
|
73
|
+
*/
|
|
74
|
+
export class InMemoryReplayGuard {
|
|
75
|
+
#entries = new Map();
|
|
76
|
+
#capacity;
|
|
77
|
+
/**
|
|
78
|
+
* @param capacity Maximum records retained. Must be positive: a guard that
|
|
79
|
+
* retains nothing answers `fresh` to everything, which is a silent total
|
|
80
|
+
* defeat of item 11 rather than a visible misconfiguration.
|
|
81
|
+
*/
|
|
82
|
+
constructor(capacity = 10_000) {
|
|
83
|
+
if (!Number.isInteger(capacity) || capacity < 1) {
|
|
84
|
+
throw new RangeError("InMemoryReplayGuard capacity must be a positive integer");
|
|
85
|
+
}
|
|
86
|
+
this.#capacity = capacity;
|
|
87
|
+
}
|
|
88
|
+
/** Number of records currently retained. For tests and metrics. */
|
|
89
|
+
get size() {
|
|
90
|
+
return this.#entries.size;
|
|
91
|
+
}
|
|
92
|
+
/** Drop every record whose `retainUntil` has passed. */
|
|
93
|
+
purgeExpired(now) {
|
|
94
|
+
for (const [id, entry] of this.#entries) {
|
|
95
|
+
if (entry.retainUntil !== undefined && entry.retainUntil <= now)
|
|
96
|
+
this.#entries.delete(id);
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
claim(id, digest, retainUntil, now) {
|
|
100
|
+
const existing = this.#entries.get(id);
|
|
101
|
+
// An expired record is treated as absent: the consumer would refuse the
|
|
102
|
+
// document under §7.2 item 4 or the acceptance window anyway, so holding
|
|
103
|
+
// the key would only manufacture a permanent `idConflict` for an `id`
|
|
104
|
+
// nobody can use.
|
|
105
|
+
if (existing !== undefined && existing.retainUntil !== undefined && existing.retainUntil <= now) {
|
|
106
|
+
this.#entries.delete(id);
|
|
107
|
+
}
|
|
108
|
+
else if (existing !== undefined) {
|
|
109
|
+
if (existing.digest !== digest) {
|
|
110
|
+
// A conflicting document is not a *use* of the record, so it does not
|
|
111
|
+
// refresh recency — otherwise a flood of conflicts could pin an entry
|
|
112
|
+
// and evict live ones.
|
|
113
|
+
return { kind: "conflict" };
|
|
114
|
+
}
|
|
115
|
+
this.#entries.delete(id);
|
|
116
|
+
this.#entries.set(id, existing);
|
|
117
|
+
return existing.response === undefined
|
|
118
|
+
? { kind: "duplicate", inFlight: !existing.completed }
|
|
119
|
+
: { kind: "duplicate", priorResponse: existing.response, inFlight: !existing.completed };
|
|
120
|
+
}
|
|
121
|
+
this.#entries.set(id, { digest, retainUntil, response: undefined, completed: false });
|
|
122
|
+
while (this.#entries.size > this.#capacity) {
|
|
123
|
+
const oldest = this.#entries.keys().next();
|
|
124
|
+
if (oldest.done === true)
|
|
125
|
+
break;
|
|
126
|
+
this.#entries.delete(oldest.value);
|
|
127
|
+
}
|
|
128
|
+
return { kind: "fresh" };
|
|
129
|
+
}
|
|
130
|
+
recordResponse(id, response) {
|
|
131
|
+
const entry = this.#entries.get(id);
|
|
132
|
+
if (entry === undefined)
|
|
133
|
+
return;
|
|
134
|
+
entry.response = response;
|
|
135
|
+
entry.completed = true;
|
|
136
|
+
}
|
|
137
|
+
release(id, digest) {
|
|
138
|
+
const entry = this.#entries.get(id);
|
|
139
|
+
// Only release the claim this digest made, and only while it is
|
|
140
|
+
// unfinished: a concurrent arrival that legitimately holds the key must
|
|
141
|
+
// not have it taken away by another document's cleanup.
|
|
142
|
+
if (entry !== undefined && entry.digest === digest && !entry.completed) {
|
|
143
|
+
this.#entries.delete(id);
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
//# sourceMappingURL=replay.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"replay.js","sourceRoot":"","sources":["../../src/_runtime/replay.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAyCG;AAEH,OAAO,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAG1D;;;;;GAKG;AACH,MAAM,UAAU,cAAc,CAAI,GAAyB;IACzD,OAAO,SAAS,CAAC,aAAa,CAAC,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IAAI,KAAK,KAAK,SAAS;YAAE,OAAO;QAChC,KAAK,CAAC,QAAQ,GAAG,QAAQ,CAAC;QAC1B,KAAK,CAAC,SAAS,GAAG,IAAI,CAAC;IACzB,CAAC;IAED,OAAO,CAAC,EAAU,EAAE,MAAc;QAChC,MAAM,KAAK,GAAG,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;QACpC,gEAAgE;QAChE,wEAAwE;QACxE,wDAAwD;QACxD,IAAI,KAAK,KAAK,SAAS,IAAI,KAAK,CAAC,MAAM,KAAK,MAAM,IAAI,CAAC,KAAK,CAAC,SAAS,EAAE,CAAC;YACvE,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;QAC3B,CAAC;IACH,CAAC;CACF"}
|
|
@@ -15,15 +15,21 @@ export type KeyType1 = "ed25519" | "x25519" | "p256";
|
|
|
15
15
|
*/
|
|
16
16
|
export type KeyStatus = "active" | "revoked";
|
|
17
17
|
/**
|
|
18
|
-
* Where the private key came from. `derived` means the maintainer generated it from a seed it holds and can reproduce it from `derivationPath`; `imported` means it arrived from outside and exists only as stored material. The distinction is operationally load-bearing: a `derived` key survives a seed restore, an `imported` one is lost unless it was backed up separately.
|
|
18
|
+
* Where the private key came from. `derived` means the maintainer generated it from a seed it holds and can reproduce it from `derivationPath`; `imported` means it arrived from outside and exists only as stored material; `internal` means the maintainer generated it from a CSPRNG and it is reproducible from nothing at all. The distinction is operationally load-bearing: a `derived` key survives a seed restore, an `imported` one is lost unless it was backed up separately, and an `internal` one cannot be recovered by any means once the maintainer's storage is gone. This member is also the only way a consumer can confirm that a `keys/create` request for an `internal` key was honoured rather than silently downgraded to a derived one — see that specification's `internal` member.
|
|
19
19
|
*/
|
|
20
|
-
export type KeyOrigin = "derived" | "imported";
|
|
20
|
+
export type KeyOrigin = "derived" | "imported" | "internal";
|
|
21
21
|
export interface KeysCreatePayload {
|
|
22
22
|
keyType: KeyType;
|
|
23
23
|
/**
|
|
24
|
-
* Hierarchical-deterministic path to derive at. Where the custodian derives from a seed, supplying the path makes the key reproducible from that seed; omitting it leaves the choice to the custodian.
|
|
24
|
+
* Hierarchical-deterministic path to derive at. Where the custodian derives from a seed, supplying the path makes the key reproducible from that seed; omitting it leaves the choice to the custodian. MUST NOT be combined with `internal: true`, which derives from no seed and records no path — a request carrying both is contradictory and the maintainer SHOULD reject it.
|
|
25
25
|
*/
|
|
26
26
|
derivationPath?: string;
|
|
27
|
+
/**
|
|
28
|
+
* Absent is the same as `false`, and this member deliberately declares no JSON Schema `default`: a declared default is materialised by generated bindings, so an absent `internal` would reappear as an explicit `false` on re-serialisation and break round-trip idempotence for every existing request document. Request a key generated from the maintainer's CSPRNG rather than derived from a seed. Such a key is reproducible from nothing: it is not recoverable from a recovery phrase, and a maintainer offering it SHOULD exclude it from backup and export. A consumer asks for this when the key's value lies in being unexportable — the maintainer can sign with it and nothing can take it away — and accepts that losing the maintainer's storage destroys it permanently.
|
|
29
|
+
*
|
|
30
|
+
* A maintainer that cannot mint such a key MUST reject the request rather than silently return a derived one, because the consumer's whole reason for asking is a property the derived key does not have. Consumers MUST confirm the outcome by reading `origin` on the returned record, which is `internal` iff the request was honoured; a maintainer that ignored an unrecognised member returns `derived`, and that difference is the consumer's only reliable signal.
|
|
31
|
+
*/
|
|
32
|
+
internal?: boolean;
|
|
27
33
|
/**
|
|
28
34
|
* BIP-39 phrase to derive from instead of the custodian's own seed. Supplying it makes this an import of externally-generated seed material wearing create's clothes: the phrase reconstitutes the key anywhere, so it is secret-bearing in exactly the way the rest of this payload is not. A custodian MUST refuse it on any transport that is not end-to-end confidential, for the reason `keys/import` refuses its cleartext carrier, and MUST NOT log or echo it.
|
|
29
35
|
*/
|
|
@@ -129,7 +135,11 @@ export declare const PAYLOAD_SCHEMA: {
|
|
|
129
135
|
};
|
|
130
136
|
readonly derivationPath: {
|
|
131
137
|
readonly type: "string";
|
|
132
|
-
readonly description: "Hierarchical-deterministic path to derive at. Where the custodian derives from a seed, supplying the path makes the key reproducible from that seed; omitting it leaves the choice to the custodian.";
|
|
138
|
+
readonly description: "Hierarchical-deterministic path to derive at. Where the custodian derives from a seed, supplying the path makes the key reproducible from that seed; omitting it leaves the choice to the custodian. MUST NOT be combined with `internal: true`, which derives from no seed and records no path — a request carrying both is contradictory and the maintainer SHOULD reject it.";
|
|
139
|
+
};
|
|
140
|
+
readonly internal: {
|
|
141
|
+
readonly type: "boolean";
|
|
142
|
+
readonly description: "Absent is the same as `false`, and this member deliberately declares no JSON Schema `default`: a declared default is materialised by generated bindings, so an absent `internal` would reappear as an explicit `false` on re-serialisation and break round-trip idempotence for every existing request document. Request a key generated from the maintainer's CSPRNG rather than derived from a seed. Such a key is reproducible from nothing: it is not recoverable from a recovery phrase, and a maintainer offering it SHOULD exclude it from backup and export. A consumer asks for this when the key's value lies in being unexportable — the maintainer can sign with it and nothing can take it away — and accepts that losing the maintainer's storage destroys it permanently.\n\nA maintainer that cannot mint such a key MUST reject the request rather than silently return a derived one, because the consumer's whole reason for asking is a property the derived key does not have. Consumers MUST confirm the outcome by reading `origin` on the returned record, which is `internal` iff the request was honoured; a maintainer that ignored an unrecognised member returns `derived`, and that difference is the consumer's only reliable signal.";
|
|
133
143
|
};
|
|
134
144
|
readonly mnemonic: {
|
|
135
145
|
readonly type: "string";
|
|
@@ -236,8 +246,8 @@ export declare const PAYLOAD_SCHEMA: {
|
|
|
236
246
|
readonly KeyOrigin: {
|
|
237
247
|
readonly title: "KeyOrigin";
|
|
238
248
|
readonly type: "string";
|
|
239
|
-
readonly enum: readonly ["derived", "imported"];
|
|
240
|
-
readonly description: "Where the private key came from. `derived` means the maintainer generated it from a seed it holds and can reproduce it from `derivationPath`; `imported` means it arrived from outside and exists only as stored material. The distinction is operationally load-bearing: a `derived` key survives a seed restore, an `imported` one is lost unless it was backed up separately.";
|
|
249
|
+
readonly enum: readonly ["derived", "imported", "internal"];
|
|
250
|
+
readonly description: "Where the private key came from. `derived` means the maintainer generated it from a seed it holds and can reproduce it from `derivationPath`; `imported` means it arrived from outside and exists only as stored material; `internal` means the maintainer generated it from a CSPRNG and it is reproducible from nothing at all. The distinction is operationally load-bearing: a `derived` key survives a seed restore, an `imported` one is lost unless it was backed up separately, and an `internal` one cannot be recovered by any means once the maintainer's storage is gone. This member is also the only way a consumer can confirm that a `keys/create` request for an `internal` key was honoured rather than silently downgraded to a derived one — see that specification's `internal` member.";
|
|
241
251
|
readonly default: "derived";
|
|
242
252
|
};
|
|
243
253
|
readonly KeyStatus: {
|
|
@@ -346,8 +356,8 @@ export declare const RESPONSE_PAYLOAD_SCHEMA: {
|
|
|
346
356
|
readonly KeyOrigin: {
|
|
347
357
|
readonly title: "KeyOrigin";
|
|
348
358
|
readonly type: "string";
|
|
349
|
-
readonly enum: readonly ["derived", "imported"];
|
|
350
|
-
readonly description: "Where the private key came from. `derived` means the maintainer generated it from a seed it holds and can reproduce it from `derivationPath`; `imported` means it arrived from outside and exists only as stored material. The distinction is operationally load-bearing: a `derived` key survives a seed restore, an `imported` one is lost unless it was backed up separately.";
|
|
359
|
+
readonly enum: readonly ["derived", "imported", "internal"];
|
|
360
|
+
readonly description: "Where the private key came from. `derived` means the maintainer generated it from a seed it holds and can reproduce it from `derivationPath`; `imported` means it arrived from outside and exists only as stored material; `internal` means the maintainer generated it from a CSPRNG and it is reproducible from nothing at all. The distinction is operationally load-bearing: a `derived` key survives a seed restore, an `imported` one is lost unless it was backed up separately, and an `internal` one cannot be recovered by any means once the maintainer's storage is gone. This member is also the only way a consumer can confirm that a `keys/create` request for an `internal` key was honoured rather than silently downgraded to a derived one — see that specification's `internal` member.";
|
|
351
361
|
readonly default: "derived";
|
|
352
362
|
};
|
|
353
363
|
readonly KeyStatus: {
|
|
@@ -389,7 +399,11 @@ export declare const SPEC: {
|
|
|
389
399
|
};
|
|
390
400
|
readonly derivationPath: {
|
|
391
401
|
readonly type: "string";
|
|
392
|
-
readonly description: "Hierarchical-deterministic path to derive at. Where the custodian derives from a seed, supplying the path makes the key reproducible from that seed; omitting it leaves the choice to the custodian.";
|
|
402
|
+
readonly description: "Hierarchical-deterministic path to derive at. Where the custodian derives from a seed, supplying the path makes the key reproducible from that seed; omitting it leaves the choice to the custodian. MUST NOT be combined with `internal: true`, which derives from no seed and records no path — a request carrying both is contradictory and the maintainer SHOULD reject it.";
|
|
403
|
+
};
|
|
404
|
+
readonly internal: {
|
|
405
|
+
readonly type: "boolean";
|
|
406
|
+
readonly description: "Absent is the same as `false`, and this member deliberately declares no JSON Schema `default`: a declared default is materialised by generated bindings, so an absent `internal` would reappear as an explicit `false` on re-serialisation and break round-trip idempotence for every existing request document. Request a key generated from the maintainer's CSPRNG rather than derived from a seed. Such a key is reproducible from nothing: it is not recoverable from a recovery phrase, and a maintainer offering it SHOULD exclude it from backup and export. A consumer asks for this when the key's value lies in being unexportable — the maintainer can sign with it and nothing can take it away — and accepts that losing the maintainer's storage destroys it permanently.\n\nA maintainer that cannot mint such a key MUST reject the request rather than silently return a derived one, because the consumer's whole reason for asking is a property the derived key does not have. Consumers MUST confirm the outcome by reading `origin` on the returned record, which is `internal` iff the request was honoured; a maintainer that ignored an unrecognised member returns `derived`, and that difference is the consumer's only reliable signal.";
|
|
393
407
|
};
|
|
394
408
|
readonly mnemonic: {
|
|
395
409
|
readonly type: "string";
|
|
@@ -496,8 +510,8 @@ export declare const SPEC: {
|
|
|
496
510
|
readonly KeyOrigin: {
|
|
497
511
|
readonly title: "KeyOrigin";
|
|
498
512
|
readonly type: "string";
|
|
499
|
-
readonly enum: readonly ["derived", "imported"];
|
|
500
|
-
readonly description: "Where the private key came from. `derived` means the maintainer generated it from a seed it holds and can reproduce it from `derivationPath`; `imported` means it arrived from outside and exists only as stored material. The distinction is operationally load-bearing: a `derived` key survives a seed restore, an `imported` one is lost unless it was backed up separately.";
|
|
513
|
+
readonly enum: readonly ["derived", "imported", "internal"];
|
|
514
|
+
readonly description: "Where the private key came from. `derived` means the maintainer generated it from a seed it holds and can reproduce it from `derivationPath`; `imported` means it arrived from outside and exists only as stored material; `internal` means the maintainer generated it from a CSPRNG and it is reproducible from nothing at all. The distinction is operationally load-bearing: a `derived` key survives a seed restore, an `imported` one is lost unless it was backed up separately, and an `internal` one cannot be recovered by any means once the maintainer's storage is gone. This member is also the only way a consumer can confirm that a `keys/create` request for an `internal` key was honoured rather than silently downgraded to a derived one — see that specification's `internal` member.";
|
|
501
515
|
readonly default: "derived";
|
|
502
516
|
};
|
|
503
517
|
readonly KeyStatus: {
|
|
@@ -616,8 +630,8 @@ export declare const RESPONSE_SPEC: {
|
|
|
616
630
|
readonly KeyOrigin: {
|
|
617
631
|
readonly title: "KeyOrigin";
|
|
618
632
|
readonly type: "string";
|
|
619
|
-
readonly enum: readonly ["derived", "imported"];
|
|
620
|
-
readonly description: "Where the private key came from. `derived` means the maintainer generated it from a seed it holds and can reproduce it from `derivationPath`; `imported` means it arrived from outside and exists only as stored material. The distinction is operationally load-bearing: a `derived` key survives a seed restore, an `imported` one is lost unless it was backed up separately.";
|
|
633
|
+
readonly enum: readonly ["derived", "imported", "internal"];
|
|
634
|
+
readonly description: "Where the private key came from. `derived` means the maintainer generated it from a seed it holds and can reproduce it from `derivationPath`; `imported` means it arrived from outside and exists only as stored material; `internal` means the maintainer generated it from a CSPRNG and it is reproducible from nothing at all. The distinction is operationally load-bearing: a `derived` key survives a seed restore, an `imported` one is lost unless it was backed up separately, and an `internal` one cannot be recovered by any means once the maintainer's storage is gone. This member is also the only way a consumer can confirm that a `keys/create` request for an `internal` key was honoured rather than silently downgraded to a derived one — see that specification's `internal` member.";
|
|
621
635
|
readonly default: "derived";
|
|
622
636
|
};
|
|
623
637
|
readonly KeyStatus: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"payload.d.ts","sourceRoot":"","sources":["../../../../src/keys/create/0.1/payload.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;GAEG;AACH,MAAM,MAAM,OAAO,GAAG,SAAS,GAAG,QAAQ,GAAG,M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;;;;;;;CA+H1B,CAAC;AAEX;;;;;GAKG;AACH,eAAO,MAAM,IAAI;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAMP,CAAC;AAEX;;;;GAIG;AACH,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAMhB,CAAC"}
|
|
@@ -31,7 +31,11 @@ export const PAYLOAD_SCHEMA = {
|
|
|
31
31
|
},
|
|
32
32
|
"derivationPath": {
|
|
33
33
|
"type": "string",
|
|
34
|
-
"description": "Hierarchical-deterministic path to derive at. Where the custodian derives from a seed, supplying the path makes the key reproducible from that seed; omitting it leaves the choice to the custodian."
|
|
34
|
+
"description": "Hierarchical-deterministic path to derive at. Where the custodian derives from a seed, supplying the path makes the key reproducible from that seed; omitting it leaves the choice to the custodian. MUST NOT be combined with `internal: true`, which derives from no seed and records no path — a request carrying both is contradictory and the maintainer SHOULD reject it."
|
|
35
|
+
},
|
|
36
|
+
"internal": {
|
|
37
|
+
"type": "boolean",
|
|
38
|
+
"description": "Absent is the same as `false`, and this member deliberately declares no JSON Schema `default`: a declared default is materialised by generated bindings, so an absent `internal` would reappear as an explicit `false` on re-serialisation and break round-trip idempotence for every existing request document. Request a key generated from the maintainer's CSPRNG rather than derived from a seed. Such a key is reproducible from nothing: it is not recoverable from a recovery phrase, and a maintainer offering it SHOULD exclude it from backup and export. A consumer asks for this when the key's value lies in being unexportable — the maintainer can sign with it and nothing can take it away — and accepts that losing the maintainer's storage destroys it permanently.\n\nA maintainer that cannot mint such a key MUST reject the request rather than silently return a derived one, because the consumer's whole reason for asking is a property the derived key does not have. Consumers MUST confirm the outcome by reading `origin` on the returned record, which is `internal` iff the request was honoured; a maintainer that ignored an unrecognised member returns `derived`, and that difference is the consumer's only reliable signal."
|
|
35
39
|
},
|
|
36
40
|
"mnemonic": {
|
|
37
41
|
"type": "string",
|
|
@@ -148,9 +152,10 @@ export const PAYLOAD_SCHEMA = {
|
|
|
148
152
|
"type": "string",
|
|
149
153
|
"enum": [
|
|
150
154
|
"derived",
|
|
151
|
-
"imported"
|
|
155
|
+
"imported",
|
|
156
|
+
"internal"
|
|
152
157
|
],
|
|
153
|
-
"description": "Where the private key came from. `derived` means the maintainer generated it from a seed it holds and can reproduce it from `derivationPath`; `imported` means it arrived from outside and exists only as stored material. The distinction is operationally load-bearing: a `derived` key survives a seed restore, an `imported` one is lost unless it was backed up separately.",
|
|
158
|
+
"description": "Where the private key came from. `derived` means the maintainer generated it from a seed it holds and can reproduce it from `derivationPath`; `imported` means it arrived from outside and exists only as stored material; `internal` means the maintainer generated it from a CSPRNG and it is reproducible from nothing at all. The distinction is operationally load-bearing: a `derived` key survives a seed restore, an `imported` one is lost unless it was backed up separately, and an `internal` one cannot be recovered by any means once the maintainer's storage is gone. This member is also the only way a consumer can confirm that a `keys/create` request for an `internal` key was honoured rather than silently downgraded to a derived one — see that specification's `internal` member.",
|
|
154
159
|
"default": "derived"
|
|
155
160
|
},
|
|
156
161
|
"KeyStatus": {
|
|
@@ -276,9 +281,10 @@ export const RESPONSE_PAYLOAD_SCHEMA = {
|
|
|
276
281
|
"type": "string",
|
|
277
282
|
"enum": [
|
|
278
283
|
"derived",
|
|
279
|
-
"imported"
|
|
284
|
+
"imported",
|
|
285
|
+
"internal"
|
|
280
286
|
],
|
|
281
|
-
"description": "Where the private key came from. `derived` means the maintainer generated it from a seed it holds and can reproduce it from `derivationPath`; `imported` means it arrived from outside and exists only as stored material. The distinction is operationally load-bearing: a `derived` key survives a seed restore, an `imported` one is lost unless it was backed up separately.",
|
|
287
|
+
"description": "Where the private key came from. `derived` means the maintainer generated it from a seed it holds and can reproduce it from `derivationPath`; `imported` means it arrived from outside and exists only as stored material; `internal` means the maintainer generated it from a CSPRNG and it is reproducible from nothing at all. The distinction is operationally load-bearing: a `derived` key survives a seed restore, an `imported` one is lost unless it was backed up separately, and an `internal` one cannot be recovered by any means once the maintainer's storage is gone. This member is also the only way a consumer can confirm that a `keys/create` request for an `internal` key was honoured rather than silently downgraded to a derived one — see that specification's `internal` member.",
|
|
282
288
|
"default": "derived"
|
|
283
289
|
},
|
|
284
290
|
"KeyStatus": {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"payload.js","sourceRoot":"","sources":["../../../../src/keys/create/0.1/payload.ts"],"names":[],"mappings":"AAAA;;;GAGG;
|
|
1
|
+
{"version":3,"file":"payload.js","sourceRoot":"","sources":["../../../../src/keys/create/0.1/payload.ts"],"names":[],"mappings":"AAAA;;;GAGG;AA0GH,2BAA2B;AAC3B,MAAM,CAAC,MAAM,QAAQ,GAAG,6CAAsD,CAAC;AAK/E,qEAAqE;AACrE,MAAM,CAAC,MAAM,iBAAiB,GAAG,sDAA+D,CAAC;AAKjG;;;;;;;;GAQG;AACH,MAAM,CAAC,MAAM,cAAc,GAAG;IAC5B,SAAS,EAAE,8CAA8C;IACzD,KAAK,EAAE,6CAA6C;IACpD,OAAO,EAAE,uBAAuB;IAChC,MAAM,EAAE,QAAQ;IAChB,sBAAsB,EAAE,KAAK;IAC7B,UAAU,EAAE;QACV,SAAS;KACV;IACD,YAAY,EAAE;QACZ,SAAS,EAAE;YACT,MAAM,EAAE,iBAAiB;YACzB,aAAa,EAAE,wBAAwB;SACxC;QACD,gBAAgB,EAAE;YAChB,MAAM,EAAE,QAAQ;YAChB,aAAa,EAAE,iXAAiX;SACjY;QACD,UAAU,EAAE;YACV,MAAM,EAAE,SAAS;YACjB,aAAa,EAAE,ssCAAssC;SACttC;QACD,UAAU,EAAE;YACV,MAAM,EAAE,QAAQ;YAChB,aAAa,EAAE,scAAsc;SACtd;QACD,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