@openvtc/trust-tasks 0.26.7 → 0.26.8
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/CHANGELOG.md +43 -0
- package/dist/_shared/components.d.ts +9 -0
- package/dist/_shared/components.d.ts.map +1 -1
- package/dist/index.d.ts +4 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4 -0
- package/dist/index.js.map +1 -1
- package/dist/vta/_shared/0.5/witness-party.d.ts +16 -0
- package/dist/vta/_shared/0.5/witness-party.d.ts.map +1 -0
- package/dist/vta/_shared/0.5/witness-party.js +6 -0
- package/dist/vta/_shared/0.5/witness-party.js.map +1 -0
- package/dist/vta/witness/accept/0.1/payload.d.ts +481 -0
- package/dist/vta/witness/accept/0.1/payload.d.ts.map +1 -0
- package/dist/vta/witness/accept/0.1/payload.js +264 -0
- package/dist/vta/witness/accept/0.1/payload.js.map +1 -0
- package/dist/vta/witness/open/0.1/payload.d.ts +500 -0
- package/dist/vta/witness/open/0.1/payload.d.ts.map +1 -0
- package/dist/vta/witness/open/0.1/payload.js +259 -0
- package/dist/vta/witness/open/0.1/payload.js.map +1 -0
- package/dist/vta/witness/present/0.1/payload.d.ts +303 -0
- package/dist/vta/witness/present/0.1/payload.d.ts.map +1 -0
- package/dist/vta/witness/present/0.1/payload.js +170 -0
- package/dist/vta/witness/present/0.1/payload.js.map +1 -0
- package/package.json +1 -1
- package/src/_shared/components.ts +8 -0
- package/src/index.ts +4 -0
- package/src/vta/_shared/0.5/witness-party.ts +17 -0
- package/src/vta/witness/accept/0.1/payload.ts +326 -0
- package/src/vta/witness/open/0.1/payload.ts +336 -0
- package/src/vta/witness/present/0.1/payload.ts +210 -0
|
@@ -0,0 +1,170 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Generated by scripts/build-ts-bindings.mjs — DO NOT EDIT BY HAND.
|
|
3
|
+
* Source: specs/vta/witness/present/0.1/payload.schema.json
|
|
4
|
+
*/
|
|
5
|
+
/** Trust Task type URI. */
|
|
6
|
+
export const TYPE_URI = "https://trusttasks.org/spec/vta/witness/present/0.1";
|
|
7
|
+
/** Trust Task response type URI (request type URI + "#response"). */
|
|
8
|
+
export const RESPONSE_TYPE_URI = "https://trusttasks.org/spec/vta/witness/present/0.1#response";
|
|
9
|
+
/**
|
|
10
|
+
* This specification's payload schema, as a value.
|
|
11
|
+
*
|
|
12
|
+
* SPEC.md §7.2 item 2 is performed against this. It is shipped as data
|
|
13
|
+
* rather than only as a `.json` file because TypeScript types are erased
|
|
14
|
+
* at runtime: without a schema a consumer has nothing to validate, and
|
|
15
|
+
* every REQUIRED payload member is optional in practice. Cross-file
|
|
16
|
+
* `$ref`s are already inlined, so it needs no resolver.
|
|
17
|
+
*/
|
|
18
|
+
export const PAYLOAD_SCHEMA = {
|
|
19
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
20
|
+
"$id": "https://trusttasks.org/spec/vta/witness/present/0.1",
|
|
21
|
+
"title": "VTA Witness — Present — payload",
|
|
22
|
+
"description": "A client hands its VTA the witness's answer to the session it opened; the VTA verifies that the answer is the witness's own, builds the presentations bound to its challenge and domain, and returns the witness/session/submit document, signed as the relationship DID, for the client to send.",
|
|
23
|
+
"type": "object",
|
|
24
|
+
"additionalProperties": false,
|
|
25
|
+
"required": [
|
|
26
|
+
"sessionId",
|
|
27
|
+
"response"
|
|
28
|
+
],
|
|
29
|
+
"properties": {
|
|
30
|
+
"sessionId": {
|
|
31
|
+
"$ref": "#/$defs/SessionId"
|
|
32
|
+
},
|
|
33
|
+
"response": {
|
|
34
|
+
"$ref": "#/$defs/CarriedDocument",
|
|
35
|
+
"description": "The witness/session/0.1 #response the witness returned, exactly as received, under the witness's proof."
|
|
36
|
+
},
|
|
37
|
+
"ext": {
|
|
38
|
+
"$ref": "#/$defs/Ext"
|
|
39
|
+
}
|
|
40
|
+
},
|
|
41
|
+
"$defs": {
|
|
42
|
+
"Response": {
|
|
43
|
+
"$anchor": "response",
|
|
44
|
+
"title": "VTA Witness — Present — response payload",
|
|
45
|
+
"description": "The witness/session/submit document to send.",
|
|
46
|
+
"type": "object",
|
|
47
|
+
"additionalProperties": false,
|
|
48
|
+
"required": [
|
|
49
|
+
"sessionId",
|
|
50
|
+
"document"
|
|
51
|
+
],
|
|
52
|
+
"properties": {
|
|
53
|
+
"sessionId": {
|
|
54
|
+
"$ref": "#/$defs/SessionId"
|
|
55
|
+
},
|
|
56
|
+
"document": {
|
|
57
|
+
"$ref": "#/$defs/CarriedDocument",
|
|
58
|
+
"description": "The witness/session/submit/0.1 document, on the session's thread, issued and signed by relationshipDid and addressed to the witness, carrying the relationship presentation in `vp` and, under the member link, the member presentation in the carriage the witness accepts. For the client to send from relationshipDid unaltered."
|
|
59
|
+
},
|
|
60
|
+
"ext": {
|
|
61
|
+
"$ref": "#/$defs/Ext"
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
},
|
|
65
|
+
"Ext": {
|
|
66
|
+
"title": "Ext",
|
|
67
|
+
"description": "Vendor-namespaced extension object per SPEC.md §4.5.1. Each immediate key MUST be a reverse-DNS namespace; structure under each namespace is opaque to the framework.",
|
|
68
|
+
"type": "object",
|
|
69
|
+
"minProperties": 1,
|
|
70
|
+
"additionalProperties": true,
|
|
71
|
+
"propertyNames": {
|
|
72
|
+
"pattern": "^[a-z][a-z0-9-]*(\\.[a-z0-9-]+)+$"
|
|
73
|
+
}
|
|
74
|
+
},
|
|
75
|
+
"CarriedDocument": {
|
|
76
|
+
"title": "CarriedDocument",
|
|
77
|
+
"description": "A whole Trust Task document — `id`, `type`, `payload` and every other member, `proof` included — carried between the VTA and the witness by the client: one the VTA built and signed for the client to send, or one the witness returned for the client to hand back. Typed as an open object so every member survives a round trip: carried exactly as built or received, never re-serialised, because its proof is over itself. Its envelope is checked by the VTA against the session record (CONVENTIONS.md §3), not by this schema.",
|
|
78
|
+
"type": "object",
|
|
79
|
+
"minProperties": 1
|
|
80
|
+
},
|
|
81
|
+
"SessionId": {
|
|
82
|
+
"title": "SessionId",
|
|
83
|
+
"description": "The id of the witness/session document the VTA built in vta/witness/open: the session's name, the thread every document of the session is on, and the value the VWC carries as taskContext. The VTA keys its state for the session by it.",
|
|
84
|
+
"type": "string",
|
|
85
|
+
"minLength": 1,
|
|
86
|
+
"maxLength": 256
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
};
|
|
90
|
+
/** As {@link PAYLOAD_SCHEMA}, for the success-response variant. */
|
|
91
|
+
export const RESPONSE_PAYLOAD_SCHEMA = {
|
|
92
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
93
|
+
"$ref": "#/$defs/Response",
|
|
94
|
+
"$defs": {
|
|
95
|
+
"Response": {
|
|
96
|
+
"$anchor": "response",
|
|
97
|
+
"title": "VTA Witness — Present — response payload",
|
|
98
|
+
"description": "The witness/session/submit document to send.",
|
|
99
|
+
"type": "object",
|
|
100
|
+
"additionalProperties": false,
|
|
101
|
+
"required": [
|
|
102
|
+
"sessionId",
|
|
103
|
+
"document"
|
|
104
|
+
],
|
|
105
|
+
"properties": {
|
|
106
|
+
"sessionId": {
|
|
107
|
+
"$ref": "#/$defs/SessionId"
|
|
108
|
+
},
|
|
109
|
+
"document": {
|
|
110
|
+
"$ref": "#/$defs/CarriedDocument",
|
|
111
|
+
"description": "The witness/session/submit/0.1 document, on the session's thread, issued and signed by relationshipDid and addressed to the witness, carrying the relationship presentation in `vp` and, under the member link, the member presentation in the carriage the witness accepts. For the client to send from relationshipDid unaltered."
|
|
112
|
+
},
|
|
113
|
+
"ext": {
|
|
114
|
+
"$ref": "#/$defs/Ext"
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
},
|
|
118
|
+
"Ext": {
|
|
119
|
+
"title": "Ext",
|
|
120
|
+
"description": "Vendor-namespaced extension object per SPEC.md §4.5.1. Each immediate key MUST be a reverse-DNS namespace; structure under each namespace is opaque to the framework.",
|
|
121
|
+
"type": "object",
|
|
122
|
+
"minProperties": 1,
|
|
123
|
+
"additionalProperties": true,
|
|
124
|
+
"propertyNames": {
|
|
125
|
+
"pattern": "^[a-z][a-z0-9-]*(\\.[a-z0-9-]+)+$"
|
|
126
|
+
}
|
|
127
|
+
},
|
|
128
|
+
"CarriedDocument": {
|
|
129
|
+
"title": "CarriedDocument",
|
|
130
|
+
"description": "A whole Trust Task document — `id`, `type`, `payload` and every other member, `proof` included — carried between the VTA and the witness by the client: one the VTA built and signed for the client to send, or one the witness returned for the client to hand back. Typed as an open object so every member survives a round trip: carried exactly as built or received, never re-serialised, because its proof is over itself. Its envelope is checked by the VTA against the session record (CONVENTIONS.md §3), not by this schema.",
|
|
131
|
+
"type": "object",
|
|
132
|
+
"minProperties": 1
|
|
133
|
+
},
|
|
134
|
+
"SessionId": {
|
|
135
|
+
"title": "SessionId",
|
|
136
|
+
"description": "The id of the witness/session document the VTA built in vta/witness/open: the session's name, the thread every document of the session is on, and the value the VWC carries as taskContext. The VTA keys its state for the session by it.",
|
|
137
|
+
"type": "string",
|
|
138
|
+
"minLength": 1,
|
|
139
|
+
"maxLength": 256
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
};
|
|
143
|
+
/**
|
|
144
|
+
* SPEC.md §7.2 policy for the request variant, from this specification's
|
|
145
|
+
* front matter. Pass to `consumeInbound` — items 5b, 7 and 8 are
|
|
146
|
+
* per-specification and cannot be derived from the document alone, and
|
|
147
|
+
* item 2 needs the schema this carries.
|
|
148
|
+
*/
|
|
149
|
+
export const SPEC = {
|
|
150
|
+
typeUri: TYPE_URI,
|
|
151
|
+
isBearer: false,
|
|
152
|
+
isProofRequired: true,
|
|
153
|
+
isRecipientRequired: true,
|
|
154
|
+
isIssuedAtRequired: true,
|
|
155
|
+
payloadSchema: PAYLOAD_SCHEMA,
|
|
156
|
+
};
|
|
157
|
+
/**
|
|
158
|
+
* SPEC.md §7.2 policy for the success-response variant. `isRecipientRequired`
|
|
159
|
+
* tracks the *issuer* party's requirement because a response swaps the
|
|
160
|
+
* parties (§7.3 item 5).
|
|
161
|
+
*/
|
|
162
|
+
export const RESPONSE_SPEC = {
|
|
163
|
+
typeUri: RESPONSE_TYPE_URI,
|
|
164
|
+
isBearer: false,
|
|
165
|
+
isProofRequired: false,
|
|
166
|
+
isRecipientRequired: true,
|
|
167
|
+
isIssuedAtRequired: true,
|
|
168
|
+
payloadSchema: RESPONSE_PAYLOAD_SCHEMA,
|
|
169
|
+
};
|
|
170
|
+
//# sourceMappingURL=payload.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"payload.js","sourceRoot":"","sources":["../../../../../src/vta/witness/present/0.1/payload.ts"],"names":[],"mappings":"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"}
|
package/package.json
CHANGED
|
@@ -1216,6 +1216,10 @@ export type Sensitivity = "normal" | "high";
|
|
|
1216
1216
|
* Which transport a task is acting on. This is the discriminator: it selects which member of `config` is meaningful, and a payload naming one kind with another's config is malformed rather than merely ignored.
|
|
1217
1217
|
*/
|
|
1218
1218
|
export type ServiceKind = "didcomm" | "rest" | "tsp" | "webauthn";
|
|
1219
|
+
/**
|
|
1220
|
+
* The id of the witness/session document the VTA built in vta/witness/open: the session's name, the thread every document of the session is on, and the value the VWC carries as taskContext. The VTA keys its state for the session by it.
|
|
1221
|
+
*/
|
|
1222
|
+
export type SessionId = string;
|
|
1219
1223
|
/**
|
|
1220
1224
|
* `EdDSA` pairs with an `ed25519` key; `ES256` pairs with a `p256` key; `ML-DSA-44` and `ML-DSA-65` pair with `mldsa44` and `mldsa65` keys respectively. An `x25519` key performs key agreement and can sign nothing, so no algorithm here is valid for one. These are JOSE algorithm identifiers, externally owned, so they are carried verbatim and never re-cased (SPEC.md §4.10 rule 5); the ML-DSA names are those RFC 9964 registers in the JOSE Web Signature and Encryption Algorithms registry, which is why their hyphenated casing differs from the `keyType` values beside them — those are specification-defined. The set is expected to grow as algorithms are registered. The enumeration remains closed: an unrecognised algorithm is refused rather than silently substituted with a supported one.
|
|
1221
1225
|
*/
|
|
@@ -4484,6 +4488,10 @@ export interface CapabilityScopeListed {
|
|
|
4484
4488
|
export interface CapabilityScopeNone {
|
|
4485
4489
|
scope: "none";
|
|
4486
4490
|
}
|
|
4491
|
+
/**
|
|
4492
|
+
* A whole Trust Task document — `id`, `type`, `payload` and every other member, `proof` included — carried between the VTA and the witness by the client: one the VTA built and signed for the client to send, or one the witness returned for the client to hand back. Typed as an open object so every member survives a round trip: carried exactly as built or received, never re-serialised, because its proof is over itself. Its envelope is checked by the VTA against the session record (CONVENTIONS.md §3), not by this schema.
|
|
4493
|
+
*/
|
|
4494
|
+
export interface CarriedDocument {}
|
|
4487
4495
|
/**
|
|
4488
4496
|
* The terms of a `chunkedTrustTask` transfer, committed before any chunk moves. On export the recipient states them in the descriptor; on import the producer pre-commits them in the request and the recipient echoes them. Either way the manifest arrives in a document whose proof is REQUIRED, so the per-chunk digests are authenticated by the party that computed them and each chunk can be verified — and a single bad chunk re-fetched or refused — on arrival rather than only after reassembly.
|
|
4489
4497
|
*
|
package/src/index.ts
CHANGED
|
@@ -562,6 +562,7 @@ export * as WebvhRecordsShared_v0_1 from "./vta/_shared/0.1/webvh-records.js";
|
|
|
562
562
|
export * as DidTemplateShared_v0_2 from "./vta/_shared/0.2/did-template.js";
|
|
563
563
|
export * as DidKeyRolesShared_v0_3 from "./vta/_shared/0.3/did-key-roles.js";
|
|
564
564
|
export * as PcsEngineShared_v0_4 from "./vta/_shared/0.4/pcs-engine.js";
|
|
565
|
+
export * as WitnessPartyShared_v0_5 from "./vta/_shared/0.5/witness-party.js";
|
|
565
566
|
export * as VtaAppStateDelete_v1_0 from "./vta/app-state/delete/1.0/payload.js";
|
|
566
567
|
export * as VtaAppStateGetMany_v1_0 from "./vta/app-state/get-many/1.0/payload.js";
|
|
567
568
|
export * as VtaAppStateGet_v1_0 from "./vta/app-state/get/1.0/payload.js";
|
|
@@ -679,6 +680,9 @@ export * as VtaWebvhServersReconcile_v0_1 from "./vta/webvh/servers/reconcile/0.
|
|
|
679
680
|
export * as VtaWebvhServersRegister_v1_0 from "./vta/webvh/servers/register/1.0/payload.js";
|
|
680
681
|
export * as VtaWebvhServersRemove_v1_0 from "./vta/webvh/servers/remove/1.0/payload.js";
|
|
681
682
|
export * as VtaWebvhServersRetireOrphan_v0_1 from "./vta/webvh/servers/retire-orphan/0.1/payload.js";
|
|
683
|
+
export * as VtaWitnessAccept_v0_1 from "./vta/witness/accept/0.1/payload.js";
|
|
684
|
+
export * as VtaWitnessOpen_v0_1 from "./vta/witness/open/0.1/payload.js";
|
|
685
|
+
export * as VtaWitnessPresent_v0_1 from "./vta/witness/present/0.1/payload.js";
|
|
682
686
|
export * as VtaWitnessRequest_v0_1 from "./vta/witness/request/0.1/payload.js";
|
|
683
687
|
export * as BackupShared_v0_1 from "./vtc/_shared/0.1/backup.js";
|
|
684
688
|
export * as CeremonyShared_v0_1 from "./vtc/_shared/0.1/ceremony.js";
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Generated by scripts/build-ts-bindings.mjs — DO NOT EDIT BY HAND.
|
|
3
|
+
* Source: specs/vta/_shared/0.5/witness-party.schema.json
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* A VTA can act as the participating party of a witnessed session (witness/session/0.1, witness/session/submit/0.1) for its principal: it builds and signs, as the principal's relationship DID, every document the party sends, and verifies and stores what the witness returns. The client carries the documents between the VTA and the witness. The normative rules (the session binding, custody, authorization, retries) are in CONVENTIONS.md beside this file. Not itself a Trust Task specification: the `_shared` folder is skipped by the registry build and the codegen.
|
|
8
|
+
*/
|
|
9
|
+
export interface WitnessedPartySharedDefinitionsForTheVtaWitnessTasks {
|
|
10
|
+
[k: string]: unknown | undefined;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* The definitions this shared schema publishes, hoisted to one declaration each.
|
|
15
|
+
* See "../../../_shared/components.js".
|
|
16
|
+
*/
|
|
17
|
+
export type { CarriedDocument, SessionId } from "../../../_shared/components.js";
|
|
@@ -0,0 +1,326 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Generated by scripts/build-ts-bindings.mjs — DO NOT EDIT BY HAND.
|
|
3
|
+
* Source: specs/vta/witness/accept/0.1/payload.schema.json
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
import type { CarriedDocument, DigestMultibase, Ext, SessionId } from "../../../../_shared/components.js";
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* A client hands its VTA the witness's answer to the submission; the VTA verifies the Verifiable Witness Credential it carries against the session, and stores it in the credential vault with its evidence.
|
|
11
|
+
*/
|
|
12
|
+
export interface VTAWitnessAcceptPayload {
|
|
13
|
+
sessionId: SessionId;
|
|
14
|
+
/**
|
|
15
|
+
* The witness/session/submit/0.1 #response the witness returned, exactly as received, under the witness's proof. It carries the VWC and its vwcDigestMultibase.
|
|
16
|
+
*/
|
|
17
|
+
response: CarriedDocument;
|
|
18
|
+
ext?: Ext;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* The stored VWC's vault handle, its digest, and the evidence documents that carry it. Sent only once the VWC is verified and stored.
|
|
22
|
+
*/
|
|
23
|
+
export interface VTAWitnessAcceptResponsePayload {
|
|
24
|
+
sessionId: SessionId;
|
|
25
|
+
/**
|
|
26
|
+
* The credential-vault handle the VWC is now stored under, with its evidence.
|
|
27
|
+
*/
|
|
28
|
+
credentialId: string;
|
|
29
|
+
/**
|
|
30
|
+
* The witness that issued the VWC: the session's witness, since a VWC issued by any other party is refused, not stored.
|
|
31
|
+
*/
|
|
32
|
+
witness: string;
|
|
33
|
+
/**
|
|
34
|
+
* The digest the witness returned for the VWC, which the VTA has checked against the VWC it stored: over the RFC 8785 canonicalization of the VWC, proof included.
|
|
35
|
+
*/
|
|
36
|
+
vwcDigestMultibase: DigestMultibase;
|
|
37
|
+
evidence: Evidence;
|
|
38
|
+
ext?: Ext;
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* The two documents a holder ships with the VWC so a verifier can pair it with the session that produced it (witness/session/submit, This response is the outcome evidence). Each is carried exactly as sent or received, never re-serialised.
|
|
42
|
+
*/
|
|
43
|
+
export interface Evidence {
|
|
44
|
+
/**
|
|
45
|
+
* The witness/session document that opened the session, as the VTA built it. The VWC's taskContext is its id and its taskDigestMultibase is computed over it.
|
|
46
|
+
*/
|
|
47
|
+
session: CarriedDocument;
|
|
48
|
+
/**
|
|
49
|
+
* The witness/session/submit #response, as handed back, under the witness's proof. It carries the VWC and its vwcDigestMultibase.
|
|
50
|
+
*/
|
|
51
|
+
outcome: CarriedDocument;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
/** Shared definitions this specification references, re-exported under the names it used to declare them with. */
|
|
55
|
+
export type { CarriedDocument, DigestMultibase, Ext, SessionId };
|
|
56
|
+
|
|
57
|
+
/** Trust Task type URI. */
|
|
58
|
+
export const TYPE_URI = "https://trusttasks.org/spec/vta/witness/accept/0.1" as const;
|
|
59
|
+
|
|
60
|
+
/** Stable alias for this specification's request payload shape. */
|
|
61
|
+
export type Payload = VTAWitnessAcceptPayload;
|
|
62
|
+
|
|
63
|
+
/** Trust Task response type URI (request type URI + "#response"). */
|
|
64
|
+
export const RESPONSE_TYPE_URI = "https://trusttasks.org/spec/vta/witness/accept/0.1#response" as const;
|
|
65
|
+
|
|
66
|
+
/** Stable alias for this specification's success-response payload shape. */
|
|
67
|
+
export type Response = VTAWitnessAcceptResponsePayload;
|
|
68
|
+
|
|
69
|
+
/**
|
|
70
|
+
* This specification's payload schema, as a value.
|
|
71
|
+
*
|
|
72
|
+
* SPEC.md §7.2 item 2 is performed against this. It is shipped as data
|
|
73
|
+
* rather than only as a `.json` file because TypeScript types are erased
|
|
74
|
+
* at runtime: without a schema a consumer has nothing to validate, and
|
|
75
|
+
* every REQUIRED payload member is optional in practice. Cross-file
|
|
76
|
+
* `$ref`s are already inlined, so it needs no resolver.
|
|
77
|
+
*/
|
|
78
|
+
export const PAYLOAD_SCHEMA = {
|
|
79
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
80
|
+
"$id": "https://trusttasks.org/spec/vta/witness/accept/0.1",
|
|
81
|
+
"title": "VTA Witness — Accept — payload",
|
|
82
|
+
"description": "A client hands its VTA the witness's answer to the submission; the VTA verifies the Verifiable Witness Credential it carries against the session, and stores it in the credential vault with its evidence.",
|
|
83
|
+
"type": "object",
|
|
84
|
+
"additionalProperties": false,
|
|
85
|
+
"required": [
|
|
86
|
+
"sessionId",
|
|
87
|
+
"response"
|
|
88
|
+
],
|
|
89
|
+
"properties": {
|
|
90
|
+
"sessionId": {
|
|
91
|
+
"$ref": "#/$defs/SessionId"
|
|
92
|
+
},
|
|
93
|
+
"response": {
|
|
94
|
+
"$ref": "#/$defs/CarriedDocument",
|
|
95
|
+
"description": "The witness/session/submit/0.1 #response the witness returned, exactly as received, under the witness's proof. It carries the VWC and its vwcDigestMultibase."
|
|
96
|
+
},
|
|
97
|
+
"ext": {
|
|
98
|
+
"$ref": "#/$defs/Ext"
|
|
99
|
+
}
|
|
100
|
+
},
|
|
101
|
+
"$defs": {
|
|
102
|
+
"Evidence": {
|
|
103
|
+
"title": "Evidence",
|
|
104
|
+
"description": "The two documents a holder ships with the VWC so a verifier can pair it with the session that produced it (witness/session/submit, This response is the outcome evidence). Each is carried exactly as sent or received, never re-serialised.",
|
|
105
|
+
"type": "object",
|
|
106
|
+
"additionalProperties": false,
|
|
107
|
+
"required": [
|
|
108
|
+
"session",
|
|
109
|
+
"outcome"
|
|
110
|
+
],
|
|
111
|
+
"properties": {
|
|
112
|
+
"session": {
|
|
113
|
+
"$ref": "#/$defs/CarriedDocument",
|
|
114
|
+
"description": "The witness/session document that opened the session, as the VTA built it. The VWC's taskContext is its id and its taskDigestMultibase is computed over it."
|
|
115
|
+
},
|
|
116
|
+
"outcome": {
|
|
117
|
+
"$ref": "#/$defs/CarriedDocument",
|
|
118
|
+
"description": "The witness/session/submit #response, as handed back, under the witness's proof. It carries the VWC and its vwcDigestMultibase."
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
},
|
|
122
|
+
"Response": {
|
|
123
|
+
"$anchor": "response",
|
|
124
|
+
"title": "VTA Witness — Accept — response payload",
|
|
125
|
+
"description": "The stored VWC's vault handle, its digest, and the evidence documents that carry it. Sent only once the VWC is verified and stored.",
|
|
126
|
+
"type": "object",
|
|
127
|
+
"additionalProperties": false,
|
|
128
|
+
"required": [
|
|
129
|
+
"sessionId",
|
|
130
|
+
"credentialId",
|
|
131
|
+
"witness",
|
|
132
|
+
"vwcDigestMultibase",
|
|
133
|
+
"evidence"
|
|
134
|
+
],
|
|
135
|
+
"properties": {
|
|
136
|
+
"sessionId": {
|
|
137
|
+
"$ref": "#/$defs/SessionId"
|
|
138
|
+
},
|
|
139
|
+
"credentialId": {
|
|
140
|
+
"type": "string",
|
|
141
|
+
"minLength": 1,
|
|
142
|
+
"maxLength": 256,
|
|
143
|
+
"description": "The credential-vault handle the VWC is now stored under, with its evidence."
|
|
144
|
+
},
|
|
145
|
+
"witness": {
|
|
146
|
+
"type": "string",
|
|
147
|
+
"pattern": "^did:",
|
|
148
|
+
"description": "The witness that issued the VWC: the session's witness, since a VWC issued by any other party is refused, not stored."
|
|
149
|
+
},
|
|
150
|
+
"vwcDigestMultibase": {
|
|
151
|
+
"$ref": "#/$defs/DigestMultibase",
|
|
152
|
+
"description": "The digest the witness returned for the VWC, which the VTA has checked against the VWC it stored: over the RFC 8785 canonicalization of the VWC, proof included."
|
|
153
|
+
},
|
|
154
|
+
"evidence": {
|
|
155
|
+
"$ref": "#/$defs/Evidence"
|
|
156
|
+
},
|
|
157
|
+
"ext": {
|
|
158
|
+
"$ref": "#/$defs/Ext"
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
},
|
|
162
|
+
"Ext": {
|
|
163
|
+
"title": "Ext",
|
|
164
|
+
"description": "Vendor-namespaced extension object per SPEC.md §4.5.1. Each immediate key MUST be a reverse-DNS namespace; structure under each namespace is opaque to the framework.",
|
|
165
|
+
"type": "object",
|
|
166
|
+
"minProperties": 1,
|
|
167
|
+
"additionalProperties": true,
|
|
168
|
+
"propertyNames": {
|
|
169
|
+
"pattern": "^[a-z][a-z0-9-]*(\\.[a-z0-9-]+)+$"
|
|
170
|
+
}
|
|
171
|
+
},
|
|
172
|
+
"DigestMultibase": {
|
|
173
|
+
"title": "DigestMultibase",
|
|
174
|
+
"description": "A cryptographic digest as a multibase-encoded multihash — the encoding the W3C Verifiable Credentials Data Model 2.0 defines for `digestMultibase`, and the one `did:webvh` uses for its SCID and entry hashes.\n\nMultihash carries the hash algorithm in-band, so the value is self-describing and the wire format survives an algorithm change without a schema revision; multibase does the same for the base encoding, so a verifier never infers base58 from base64url by context. A bare hex string or a `sha-256:`-style prefix hard-codes one algorithm into the wire contract and is non-conforming here.\n\nThis definition constrains the *encoding only*. What the digest is computed over is stated by each referencing field, because it differs legitimately: a digest over a JSON document is taken over its RFC 8785 (JCS) canonicalization, while a digest over an opaque artifact is taken over its bytes. A field whose input is a JSON document and which does not name a canonicalization is not reproducible.\n\nRestricted to the two multibase headers W3C Controlled Identifiers 1.0 §2.4 normatively requires — `z` (base58btc) and `u` (base64url-no-pad). CID permits others but states that \"interoperability is not guaranteed between implementations using such values\", and a registry whose purpose is interoperability should not mint digests a conforming verifier may be unable to read. The alphabets are enforced rather than assumed: base58btc excludes 0, O, I and l, and an earlier permissive pattern let three published examples carry digests that were not valid base58 at all. base58btc is RECOMMENDED, for consistency with `did:key` and `did:webvh`.",
|
|
175
|
+
"type": "string",
|
|
176
|
+
"minLength": 16,
|
|
177
|
+
"pattern": "^(z[1-9A-HJ-NP-Za-km-z]+|u[A-Za-z0-9_-]+)$",
|
|
178
|
+
"examples": [
|
|
179
|
+
"zQmbWqxBEKC3P8tqsKc98xmWNzrzDtRLMiMPL8wBuTGsMnR"
|
|
180
|
+
]
|
|
181
|
+
},
|
|
182
|
+
"SessionId": {
|
|
183
|
+
"title": "SessionId",
|
|
184
|
+
"description": "The id of the witness/session document the VTA built in vta/witness/open: the session's name, the thread every document of the session is on, and the value the VWC carries as taskContext. The VTA keys its state for the session by it.",
|
|
185
|
+
"type": "string",
|
|
186
|
+
"minLength": 1,
|
|
187
|
+
"maxLength": 256
|
|
188
|
+
},
|
|
189
|
+
"CarriedDocument": {
|
|
190
|
+
"title": "CarriedDocument",
|
|
191
|
+
"description": "A whole Trust Task document — `id`, `type`, `payload` and every other member, `proof` included — carried between the VTA and the witness by the client: one the VTA built and signed for the client to send, or one the witness returned for the client to hand back. Typed as an open object so every member survives a round trip: carried exactly as built or received, never re-serialised, because its proof is over itself. Its envelope is checked by the VTA against the session record (CONVENTIONS.md §3), not by this schema.",
|
|
192
|
+
"type": "object",
|
|
193
|
+
"minProperties": 1
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
} as const;
|
|
197
|
+
|
|
198
|
+
/** As {@link PAYLOAD_SCHEMA}, for the success-response variant. */
|
|
199
|
+
export const RESPONSE_PAYLOAD_SCHEMA = {
|
|
200
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
201
|
+
"$ref": "#/$defs/Response",
|
|
202
|
+
"$defs": {
|
|
203
|
+
"Evidence": {
|
|
204
|
+
"title": "Evidence",
|
|
205
|
+
"description": "The two documents a holder ships with the VWC so a verifier can pair it with the session that produced it (witness/session/submit, This response is the outcome evidence). Each is carried exactly as sent or received, never re-serialised.",
|
|
206
|
+
"type": "object",
|
|
207
|
+
"additionalProperties": false,
|
|
208
|
+
"required": [
|
|
209
|
+
"session",
|
|
210
|
+
"outcome"
|
|
211
|
+
],
|
|
212
|
+
"properties": {
|
|
213
|
+
"session": {
|
|
214
|
+
"$ref": "#/$defs/CarriedDocument",
|
|
215
|
+
"description": "The witness/session document that opened the session, as the VTA built it. The VWC's taskContext is its id and its taskDigestMultibase is computed over it."
|
|
216
|
+
},
|
|
217
|
+
"outcome": {
|
|
218
|
+
"$ref": "#/$defs/CarriedDocument",
|
|
219
|
+
"description": "The witness/session/submit #response, as handed back, under the witness's proof. It carries the VWC and its vwcDigestMultibase."
|
|
220
|
+
}
|
|
221
|
+
}
|
|
222
|
+
},
|
|
223
|
+
"Response": {
|
|
224
|
+
"$anchor": "response",
|
|
225
|
+
"title": "VTA Witness — Accept — response payload",
|
|
226
|
+
"description": "The stored VWC's vault handle, its digest, and the evidence documents that carry it. Sent only once the VWC is verified and stored.",
|
|
227
|
+
"type": "object",
|
|
228
|
+
"additionalProperties": false,
|
|
229
|
+
"required": [
|
|
230
|
+
"sessionId",
|
|
231
|
+
"credentialId",
|
|
232
|
+
"witness",
|
|
233
|
+
"vwcDigestMultibase",
|
|
234
|
+
"evidence"
|
|
235
|
+
],
|
|
236
|
+
"properties": {
|
|
237
|
+
"sessionId": {
|
|
238
|
+
"$ref": "#/$defs/SessionId"
|
|
239
|
+
},
|
|
240
|
+
"credentialId": {
|
|
241
|
+
"type": "string",
|
|
242
|
+
"minLength": 1,
|
|
243
|
+
"maxLength": 256,
|
|
244
|
+
"description": "The credential-vault handle the VWC is now stored under, with its evidence."
|
|
245
|
+
},
|
|
246
|
+
"witness": {
|
|
247
|
+
"type": "string",
|
|
248
|
+
"pattern": "^did:",
|
|
249
|
+
"description": "The witness that issued the VWC: the session's witness, since a VWC issued by any other party is refused, not stored."
|
|
250
|
+
},
|
|
251
|
+
"vwcDigestMultibase": {
|
|
252
|
+
"$ref": "#/$defs/DigestMultibase",
|
|
253
|
+
"description": "The digest the witness returned for the VWC, which the VTA has checked against the VWC it stored: over the RFC 8785 canonicalization of the VWC, proof included."
|
|
254
|
+
},
|
|
255
|
+
"evidence": {
|
|
256
|
+
"$ref": "#/$defs/Evidence"
|
|
257
|
+
},
|
|
258
|
+
"ext": {
|
|
259
|
+
"$ref": "#/$defs/Ext"
|
|
260
|
+
}
|
|
261
|
+
}
|
|
262
|
+
},
|
|
263
|
+
"Ext": {
|
|
264
|
+
"title": "Ext",
|
|
265
|
+
"description": "Vendor-namespaced extension object per SPEC.md §4.5.1. Each immediate key MUST be a reverse-DNS namespace; structure under each namespace is opaque to the framework.",
|
|
266
|
+
"type": "object",
|
|
267
|
+
"minProperties": 1,
|
|
268
|
+
"additionalProperties": true,
|
|
269
|
+
"propertyNames": {
|
|
270
|
+
"pattern": "^[a-z][a-z0-9-]*(\\.[a-z0-9-]+)+$"
|
|
271
|
+
}
|
|
272
|
+
},
|
|
273
|
+
"DigestMultibase": {
|
|
274
|
+
"title": "DigestMultibase",
|
|
275
|
+
"description": "A cryptographic digest as a multibase-encoded multihash — the encoding the W3C Verifiable Credentials Data Model 2.0 defines for `digestMultibase`, and the one `did:webvh` uses for its SCID and entry hashes.\n\nMultihash carries the hash algorithm in-band, so the value is self-describing and the wire format survives an algorithm change without a schema revision; multibase does the same for the base encoding, so a verifier never infers base58 from base64url by context. A bare hex string or a `sha-256:`-style prefix hard-codes one algorithm into the wire contract and is non-conforming here.\n\nThis definition constrains the *encoding only*. What the digest is computed over is stated by each referencing field, because it differs legitimately: a digest over a JSON document is taken over its RFC 8785 (JCS) canonicalization, while a digest over an opaque artifact is taken over its bytes. A field whose input is a JSON document and which does not name a canonicalization is not reproducible.\n\nRestricted to the two multibase headers W3C Controlled Identifiers 1.0 §2.4 normatively requires — `z` (base58btc) and `u` (base64url-no-pad). CID permits others but states that \"interoperability is not guaranteed between implementations using such values\", and a registry whose purpose is interoperability should not mint digests a conforming verifier may be unable to read. The alphabets are enforced rather than assumed: base58btc excludes 0, O, I and l, and an earlier permissive pattern let three published examples carry digests that were not valid base58 at all. base58btc is RECOMMENDED, for consistency with `did:key` and `did:webvh`.",
|
|
276
|
+
"type": "string",
|
|
277
|
+
"minLength": 16,
|
|
278
|
+
"pattern": "^(z[1-9A-HJ-NP-Za-km-z]+|u[A-Za-z0-9_-]+)$",
|
|
279
|
+
"examples": [
|
|
280
|
+
"zQmbWqxBEKC3P8tqsKc98xmWNzrzDtRLMiMPL8wBuTGsMnR"
|
|
281
|
+
]
|
|
282
|
+
},
|
|
283
|
+
"SessionId": {
|
|
284
|
+
"title": "SessionId",
|
|
285
|
+
"description": "The id of the witness/session document the VTA built in vta/witness/open: the session's name, the thread every document of the session is on, and the value the VWC carries as taskContext. The VTA keys its state for the session by it.",
|
|
286
|
+
"type": "string",
|
|
287
|
+
"minLength": 1,
|
|
288
|
+
"maxLength": 256
|
|
289
|
+
},
|
|
290
|
+
"CarriedDocument": {
|
|
291
|
+
"title": "CarriedDocument",
|
|
292
|
+
"description": "A whole Trust Task document — `id`, `type`, `payload` and every other member, `proof` included — carried between the VTA and the witness by the client: one the VTA built and signed for the client to send, or one the witness returned for the client to hand back. Typed as an open object so every member survives a round trip: carried exactly as built or received, never re-serialised, because its proof is over itself. Its envelope is checked by the VTA against the session record (CONVENTIONS.md §3), not by this schema.",
|
|
293
|
+
"type": "object",
|
|
294
|
+
"minProperties": 1
|
|
295
|
+
}
|
|
296
|
+
}
|
|
297
|
+
} as const;
|
|
298
|
+
|
|
299
|
+
/**
|
|
300
|
+
* SPEC.md §7.2 policy for the request variant, from this specification's
|
|
301
|
+
* front matter. Pass to `consumeInbound` — items 5b, 7 and 8 are
|
|
302
|
+
* per-specification and cannot be derived from the document alone, and
|
|
303
|
+
* item 2 needs the schema this carries.
|
|
304
|
+
*/
|
|
305
|
+
export const SPEC = {
|
|
306
|
+
typeUri: TYPE_URI,
|
|
307
|
+
isBearer: false,
|
|
308
|
+
isProofRequired: true,
|
|
309
|
+
isRecipientRequired: true,
|
|
310
|
+
isIssuedAtRequired: true,
|
|
311
|
+
payloadSchema: PAYLOAD_SCHEMA,
|
|
312
|
+
} as const;
|
|
313
|
+
|
|
314
|
+
/**
|
|
315
|
+
* SPEC.md §7.2 policy for the success-response variant. `isRecipientRequired`
|
|
316
|
+
* tracks the *issuer* party's requirement because a response swaps the
|
|
317
|
+
* parties (§7.3 item 5).
|
|
318
|
+
*/
|
|
319
|
+
export const RESPONSE_SPEC = {
|
|
320
|
+
typeUri: RESPONSE_TYPE_URI,
|
|
321
|
+
isBearer: false,
|
|
322
|
+
isProofRequired: false,
|
|
323
|
+
isRecipientRequired: true,
|
|
324
|
+
isIssuedAtRequired: true,
|
|
325
|
+
payloadSchema: RESPONSE_PAYLOAD_SCHEMA,
|
|
326
|
+
} as const;
|