@openvtc/trust-tasks 0.26.6 → 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 +81 -0
- package/dist/_shared/components.d.ts +11 -2
- package/dist/_shared/components.d.ts.map +1 -1
- package/dist/device/list/0.1/payload.d.ts +4 -4
- package/dist/device/list/0.1/payload.d.ts.map +1 -1
- package/dist/device/list/0.1/payload.js +4 -2
- package/dist/device/list/0.1/payload.js.map +1 -1
- package/dist/device/list/0.2/payload.d.ts +4 -4
- package/dist/device/list/0.2/payload.d.ts.map +1 -1
- package/dist/device/list/0.2/payload.js +4 -2
- package/dist/device/list/0.2/payload.js.map +1 -1
- package/dist/device/register/0.1/payload.d.ts +4 -4
- package/dist/device/register/0.1/payload.d.ts.map +1 -1
- package/dist/device/register/0.1/payload.js +4 -2
- package/dist/device/register/0.1/payload.js.map +1 -1
- package/dist/device/register/0.2/payload.d.ts +4 -4
- package/dist/device/register/0.2/payload.d.ts.map +1 -1
- package/dist/device/register/0.2/payload.js +4 -2
- package/dist/device/register/0.2/payload.js.map +1 -1
- package/dist/index.d.ts +5 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +5 -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/dist/vta/witness/request/0.1/payload.d.ts +597 -0
- package/dist/vta/witness/request/0.1/payload.d.ts.map +1 -0
- package/dist/vta/witness/request/0.1/payload.js +311 -0
- package/dist/vta/witness/request/0.1/payload.js.map +1 -0
- package/package.json +1 -1
- package/src/_shared/components.ts +12 -2
- package/src/device/list/0.1/payload.ts +4 -2
- package/src/device/list/0.2/payload.ts +4 -2
- package/src/device/register/0.1/payload.ts +4 -2
- package/src/device/register/0.2/payload.ts +4 -2
- package/src/index.ts +5 -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
- package/src/vta/witness/request/0.1/payload.ts +405 -0
|
@@ -0,0 +1,210 @@
|
|
|
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
|
+
|
|
6
|
+
import type { CarriedDocument, Ext, SessionId } from "../../../../_shared/components.js";
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* 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.
|
|
11
|
+
*/
|
|
12
|
+
export interface VTAWitnessPresentPayload {
|
|
13
|
+
sessionId: SessionId;
|
|
14
|
+
/**
|
|
15
|
+
* The witness/session/0.1 #response the witness returned, exactly as received, under the witness's proof.
|
|
16
|
+
*/
|
|
17
|
+
response: CarriedDocument;
|
|
18
|
+
ext?: Ext;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* The witness/session/submit document to send.
|
|
22
|
+
*/
|
|
23
|
+
export interface VTAWitnessPresentResponsePayload {
|
|
24
|
+
sessionId: SessionId;
|
|
25
|
+
/**
|
|
26
|
+
* 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.
|
|
27
|
+
*/
|
|
28
|
+
document: CarriedDocument;
|
|
29
|
+
ext?: Ext;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
/** Shared definitions this specification references, re-exported under the names it used to declare them with. */
|
|
33
|
+
export type { CarriedDocument, Ext, SessionId };
|
|
34
|
+
|
|
35
|
+
/** Trust Task type URI. */
|
|
36
|
+
export const TYPE_URI = "https://trusttasks.org/spec/vta/witness/present/0.1" as const;
|
|
37
|
+
|
|
38
|
+
/** Stable alias for this specification's request payload shape. */
|
|
39
|
+
export type Payload = VTAWitnessPresentPayload;
|
|
40
|
+
|
|
41
|
+
/** Trust Task response type URI (request type URI + "#response"). */
|
|
42
|
+
export const RESPONSE_TYPE_URI = "https://trusttasks.org/spec/vta/witness/present/0.1#response" as const;
|
|
43
|
+
|
|
44
|
+
/** Stable alias for this specification's success-response payload shape. */
|
|
45
|
+
export type Response = VTAWitnessPresentResponsePayload;
|
|
46
|
+
|
|
47
|
+
/**
|
|
48
|
+
* This specification's payload schema, as a value.
|
|
49
|
+
*
|
|
50
|
+
* SPEC.md §7.2 item 2 is performed against this. It is shipped as data
|
|
51
|
+
* rather than only as a `.json` file because TypeScript types are erased
|
|
52
|
+
* at runtime: without a schema a consumer has nothing to validate, and
|
|
53
|
+
* every REQUIRED payload member is optional in practice. Cross-file
|
|
54
|
+
* `$ref`s are already inlined, so it needs no resolver.
|
|
55
|
+
*/
|
|
56
|
+
export const PAYLOAD_SCHEMA = {
|
|
57
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
58
|
+
"$id": "https://trusttasks.org/spec/vta/witness/present/0.1",
|
|
59
|
+
"title": "VTA Witness — Present — payload",
|
|
60
|
+
"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.",
|
|
61
|
+
"type": "object",
|
|
62
|
+
"additionalProperties": false,
|
|
63
|
+
"required": [
|
|
64
|
+
"sessionId",
|
|
65
|
+
"response"
|
|
66
|
+
],
|
|
67
|
+
"properties": {
|
|
68
|
+
"sessionId": {
|
|
69
|
+
"$ref": "#/$defs/SessionId"
|
|
70
|
+
},
|
|
71
|
+
"response": {
|
|
72
|
+
"$ref": "#/$defs/CarriedDocument",
|
|
73
|
+
"description": "The witness/session/0.1 #response the witness returned, exactly as received, under the witness's proof."
|
|
74
|
+
},
|
|
75
|
+
"ext": {
|
|
76
|
+
"$ref": "#/$defs/Ext"
|
|
77
|
+
}
|
|
78
|
+
},
|
|
79
|
+
"$defs": {
|
|
80
|
+
"Response": {
|
|
81
|
+
"$anchor": "response",
|
|
82
|
+
"title": "VTA Witness — Present — response payload",
|
|
83
|
+
"description": "The witness/session/submit document to send.",
|
|
84
|
+
"type": "object",
|
|
85
|
+
"additionalProperties": false,
|
|
86
|
+
"required": [
|
|
87
|
+
"sessionId",
|
|
88
|
+
"document"
|
|
89
|
+
],
|
|
90
|
+
"properties": {
|
|
91
|
+
"sessionId": {
|
|
92
|
+
"$ref": "#/$defs/SessionId"
|
|
93
|
+
},
|
|
94
|
+
"document": {
|
|
95
|
+
"$ref": "#/$defs/CarriedDocument",
|
|
96
|
+
"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."
|
|
97
|
+
},
|
|
98
|
+
"ext": {
|
|
99
|
+
"$ref": "#/$defs/Ext"
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
},
|
|
103
|
+
"Ext": {
|
|
104
|
+
"title": "Ext",
|
|
105
|
+
"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.",
|
|
106
|
+
"type": "object",
|
|
107
|
+
"minProperties": 1,
|
|
108
|
+
"additionalProperties": true,
|
|
109
|
+
"propertyNames": {
|
|
110
|
+
"pattern": "^[a-z][a-z0-9-]*(\\.[a-z0-9-]+)+$"
|
|
111
|
+
}
|
|
112
|
+
},
|
|
113
|
+
"CarriedDocument": {
|
|
114
|
+
"title": "CarriedDocument",
|
|
115
|
+
"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.",
|
|
116
|
+
"type": "object",
|
|
117
|
+
"minProperties": 1
|
|
118
|
+
},
|
|
119
|
+
"SessionId": {
|
|
120
|
+
"title": "SessionId",
|
|
121
|
+
"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.",
|
|
122
|
+
"type": "string",
|
|
123
|
+
"minLength": 1,
|
|
124
|
+
"maxLength": 256
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
} as const;
|
|
128
|
+
|
|
129
|
+
/** As {@link PAYLOAD_SCHEMA}, for the success-response variant. */
|
|
130
|
+
export const RESPONSE_PAYLOAD_SCHEMA = {
|
|
131
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
132
|
+
"$ref": "#/$defs/Response",
|
|
133
|
+
"$defs": {
|
|
134
|
+
"Response": {
|
|
135
|
+
"$anchor": "response",
|
|
136
|
+
"title": "VTA Witness — Present — response payload",
|
|
137
|
+
"description": "The witness/session/submit document to send.",
|
|
138
|
+
"type": "object",
|
|
139
|
+
"additionalProperties": false,
|
|
140
|
+
"required": [
|
|
141
|
+
"sessionId",
|
|
142
|
+
"document"
|
|
143
|
+
],
|
|
144
|
+
"properties": {
|
|
145
|
+
"sessionId": {
|
|
146
|
+
"$ref": "#/$defs/SessionId"
|
|
147
|
+
},
|
|
148
|
+
"document": {
|
|
149
|
+
"$ref": "#/$defs/CarriedDocument",
|
|
150
|
+
"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."
|
|
151
|
+
},
|
|
152
|
+
"ext": {
|
|
153
|
+
"$ref": "#/$defs/Ext"
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
},
|
|
157
|
+
"Ext": {
|
|
158
|
+
"title": "Ext",
|
|
159
|
+
"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.",
|
|
160
|
+
"type": "object",
|
|
161
|
+
"minProperties": 1,
|
|
162
|
+
"additionalProperties": true,
|
|
163
|
+
"propertyNames": {
|
|
164
|
+
"pattern": "^[a-z][a-z0-9-]*(\\.[a-z0-9-]+)+$"
|
|
165
|
+
}
|
|
166
|
+
},
|
|
167
|
+
"CarriedDocument": {
|
|
168
|
+
"title": "CarriedDocument",
|
|
169
|
+
"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.",
|
|
170
|
+
"type": "object",
|
|
171
|
+
"minProperties": 1
|
|
172
|
+
},
|
|
173
|
+
"SessionId": {
|
|
174
|
+
"title": "SessionId",
|
|
175
|
+
"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.",
|
|
176
|
+
"type": "string",
|
|
177
|
+
"minLength": 1,
|
|
178
|
+
"maxLength": 256
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
} as const;
|
|
182
|
+
|
|
183
|
+
/**
|
|
184
|
+
* SPEC.md §7.2 policy for the request variant, from this specification's
|
|
185
|
+
* front matter. Pass to `consumeInbound` — items 5b, 7 and 8 are
|
|
186
|
+
* per-specification and cannot be derived from the document alone, and
|
|
187
|
+
* item 2 needs the schema this carries.
|
|
188
|
+
*/
|
|
189
|
+
export const SPEC = {
|
|
190
|
+
typeUri: TYPE_URI,
|
|
191
|
+
isBearer: false,
|
|
192
|
+
isProofRequired: true,
|
|
193
|
+
isRecipientRequired: true,
|
|
194
|
+
isIssuedAtRequired: true,
|
|
195
|
+
payloadSchema: PAYLOAD_SCHEMA,
|
|
196
|
+
} as const;
|
|
197
|
+
|
|
198
|
+
/**
|
|
199
|
+
* SPEC.md §7.2 policy for the success-response variant. `isRecipientRequired`
|
|
200
|
+
* tracks the *issuer* party's requirement because a response swaps the
|
|
201
|
+
* parties (§7.3 item 5).
|
|
202
|
+
*/
|
|
203
|
+
export const RESPONSE_SPEC = {
|
|
204
|
+
typeUri: RESPONSE_TYPE_URI,
|
|
205
|
+
isBearer: false,
|
|
206
|
+
isProofRequired: false,
|
|
207
|
+
isRecipientRequired: true,
|
|
208
|
+
isIssuedAtRequired: true,
|
|
209
|
+
payloadSchema: RESPONSE_PAYLOAD_SCHEMA,
|
|
210
|
+
} as const;
|
|
@@ -0,0 +1,405 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Generated by scripts/build-ts-bindings.mjs — DO NOT EDIT BY HAND.
|
|
3
|
+
* Source: specs/vta/witness/request/0.1/payload.schema.json
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
import type { DigestMultibase, Ext } from "../../../../_shared/components.js";
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* A client asks its VTA to run a witnessed session for one of its principal's relationships: open a witness/session with the named witness as the relationship DID the VTA holds, present the relationship credential (and, optionally, the membership evidence) from its credential vault, verify the Verifiable Witness Credential the witness returns, and store it in the vault with its evidence.
|
|
11
|
+
*/
|
|
12
|
+
export interface VTAWitnessRequestPayload {
|
|
13
|
+
/**
|
|
14
|
+
* The witness to run the session with, as its public DID: the recipient of the witness/session and witness/session/submit documents the VTA sends, and the issuer of the VWC it must return. Chosen by the caller, because which witness observes an exchange is the parties' privacy decision (witness/session, Security & Privacy).
|
|
15
|
+
*/
|
|
16
|
+
witness: string;
|
|
17
|
+
/**
|
|
18
|
+
* The principal's relationship DID for this relationship: the participating party, and the issuer of both documents the VTA sends to the witness. The VTA signs them, and the relationship presentation, with a key of this DID it holds in a context the caller may act in; never as itself.
|
|
19
|
+
*/
|
|
20
|
+
relationshipDid: string;
|
|
21
|
+
/**
|
|
22
|
+
* The other party's relationship DID. With relationshipDid it forms the session's `parties` pair, and it is the subject of the relationship credential presented.
|
|
23
|
+
*/
|
|
24
|
+
counterpartyDid: string;
|
|
25
|
+
/**
|
|
26
|
+
* The threadId of the relationship exchange the session is nested in. The VTA sets it as `parentThreadId` on every document of the session, as witness/session requires of a producer.
|
|
27
|
+
*/
|
|
28
|
+
relationshipThreadId: string;
|
|
29
|
+
/**
|
|
30
|
+
* The credential-vault handle of the relationship credential (VRC) to present: one issued by relationshipDid whose subject is counterpartyDid. A handle, as vault/credentials/query returns one; the credential itself never travels in this request.
|
|
31
|
+
*/
|
|
32
|
+
relationshipCredentialId: string;
|
|
33
|
+
membership?: Membership;
|
|
34
|
+
/**
|
|
35
|
+
* The credential-vault handle to store the VWC under. Absent, the VTA derives one. Supplying it lets a caller recognise its own result after an ambiguous failure.
|
|
36
|
+
*/
|
|
37
|
+
storeAs?: string;
|
|
38
|
+
ext?: Ext;
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* The membership evidence to present beside the relationship credential, for a witness whose policy asks for it. Absent, none is presented.
|
|
42
|
+
*/
|
|
43
|
+
export interface Membership {
|
|
44
|
+
/**
|
|
45
|
+
* The credential-vault handle of the membership credential.
|
|
46
|
+
*/
|
|
47
|
+
credentialId: string;
|
|
48
|
+
/**
|
|
49
|
+
* The member DID the membership credential names, when it is not relationshipDid. The VTA must hold a key of it in a context the caller may act in. Naming it is the caller's explicit choice to disclose it to the witness.
|
|
50
|
+
*/
|
|
51
|
+
memberDid?: string;
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* The stored VWC's vault handle, its digest, and the evidence documents that carry it. Sent only once the VWC is verified and stored.
|
|
55
|
+
*/
|
|
56
|
+
export interface VTAWitnessRequestResponsePayload {
|
|
57
|
+
/**
|
|
58
|
+
* The credential-vault handle the VWC is now stored under, with its evidence.
|
|
59
|
+
*/
|
|
60
|
+
credentialId: string;
|
|
61
|
+
/**
|
|
62
|
+
* The witness that issued the VWC. Equal to the request's witness: a VWC issued by any other party is refused, not stored.
|
|
63
|
+
*/
|
|
64
|
+
witness: string;
|
|
65
|
+
/**
|
|
66
|
+
* 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.
|
|
67
|
+
*/
|
|
68
|
+
vwcDigestMultibase: DigestMultibase;
|
|
69
|
+
evidence: Evidence;
|
|
70
|
+
ext?: Ext;
|
|
71
|
+
}
|
|
72
|
+
/**
|
|
73
|
+
* 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.
|
|
74
|
+
*/
|
|
75
|
+
export interface Evidence {
|
|
76
|
+
/**
|
|
77
|
+
* The witness/session document that opened the session, as the VTA sent it. The VWC's taskContext is its id and its taskDigestMultibase is computed over it.
|
|
78
|
+
*/
|
|
79
|
+
session: {};
|
|
80
|
+
/**
|
|
81
|
+
* The witness/session/submit #response, as the VTA received it, under the witness's proof. It carries the VWC and its vwcDigestMultibase.
|
|
82
|
+
*/
|
|
83
|
+
outcome: {};
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
/** Shared definitions this specification references, re-exported under the names it used to declare them with. */
|
|
87
|
+
export type { DigestMultibase, Ext };
|
|
88
|
+
|
|
89
|
+
/** Trust Task type URI. */
|
|
90
|
+
export const TYPE_URI = "https://trusttasks.org/spec/vta/witness/request/0.1" as const;
|
|
91
|
+
|
|
92
|
+
/** Stable alias for this specification's request payload shape. */
|
|
93
|
+
export type Payload = VTAWitnessRequestPayload;
|
|
94
|
+
|
|
95
|
+
/** Trust Task response type URI (request type URI + "#response"). */
|
|
96
|
+
export const RESPONSE_TYPE_URI = "https://trusttasks.org/spec/vta/witness/request/0.1#response" as const;
|
|
97
|
+
|
|
98
|
+
/** Stable alias for this specification's success-response payload shape. */
|
|
99
|
+
export type Response = VTAWitnessRequestResponsePayload;
|
|
100
|
+
|
|
101
|
+
/**
|
|
102
|
+
* This specification's payload schema, as a value.
|
|
103
|
+
*
|
|
104
|
+
* SPEC.md §7.2 item 2 is performed against this. It is shipped as data
|
|
105
|
+
* rather than only as a `.json` file because TypeScript types are erased
|
|
106
|
+
* at runtime: without a schema a consumer has nothing to validate, and
|
|
107
|
+
* every REQUIRED payload member is optional in practice. Cross-file
|
|
108
|
+
* `$ref`s are already inlined, so it needs no resolver.
|
|
109
|
+
*/
|
|
110
|
+
export const PAYLOAD_SCHEMA = {
|
|
111
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
112
|
+
"$id": "https://trusttasks.org/spec/vta/witness/request/0.1",
|
|
113
|
+
"title": "VTA Witness — Request — payload",
|
|
114
|
+
"description": "A client asks its VTA to run a witnessed session for one of its principal's relationships: open a witness/session with the named witness as the relationship DID the VTA holds, present the relationship credential (and, optionally, the membership evidence) from its credential vault, verify the Verifiable Witness Credential the witness returns, and store it in the vault with its evidence.",
|
|
115
|
+
"type": "object",
|
|
116
|
+
"additionalProperties": false,
|
|
117
|
+
"required": [
|
|
118
|
+
"witness",
|
|
119
|
+
"relationshipDid",
|
|
120
|
+
"counterpartyDid",
|
|
121
|
+
"relationshipThreadId",
|
|
122
|
+
"relationshipCredentialId"
|
|
123
|
+
],
|
|
124
|
+
"properties": {
|
|
125
|
+
"witness": {
|
|
126
|
+
"type": "string",
|
|
127
|
+
"pattern": "^did:",
|
|
128
|
+
"description": "The witness to run the session with, as its public DID: the recipient of the witness/session and witness/session/submit documents the VTA sends, and the issuer of the VWC it must return. Chosen by the caller, because which witness observes an exchange is the parties' privacy decision (witness/session, Security & Privacy)."
|
|
129
|
+
},
|
|
130
|
+
"relationshipDid": {
|
|
131
|
+
"type": "string",
|
|
132
|
+
"pattern": "^did:",
|
|
133
|
+
"description": "The principal's relationship DID for this relationship: the participating party, and the issuer of both documents the VTA sends to the witness. The VTA signs them, and the relationship presentation, with a key of this DID it holds in a context the caller may act in; never as itself."
|
|
134
|
+
},
|
|
135
|
+
"counterpartyDid": {
|
|
136
|
+
"type": "string",
|
|
137
|
+
"pattern": "^did:",
|
|
138
|
+
"description": "The other party's relationship DID. With relationshipDid it forms the session's `parties` pair, and it is the subject of the relationship credential presented."
|
|
139
|
+
},
|
|
140
|
+
"relationshipThreadId": {
|
|
141
|
+
"type": "string",
|
|
142
|
+
"minLength": 1,
|
|
143
|
+
"maxLength": 256,
|
|
144
|
+
"description": "The threadId of the relationship exchange the session is nested in. The VTA sets it as `parentThreadId` on every document of the session, as witness/session requires of a producer."
|
|
145
|
+
},
|
|
146
|
+
"relationshipCredentialId": {
|
|
147
|
+
"type": "string",
|
|
148
|
+
"minLength": 1,
|
|
149
|
+
"maxLength": 256,
|
|
150
|
+
"description": "The credential-vault handle of the relationship credential (VRC) to present: one issued by relationshipDid whose subject is counterpartyDid. A handle, as vault/credentials/query returns one; the credential itself never travels in this request."
|
|
151
|
+
},
|
|
152
|
+
"membership": {
|
|
153
|
+
"$ref": "#/$defs/Membership",
|
|
154
|
+
"description": "The membership evidence to present beside the relationship credential, for a witness whose policy asks for it. Absent, none is presented."
|
|
155
|
+
},
|
|
156
|
+
"storeAs": {
|
|
157
|
+
"type": "string",
|
|
158
|
+
"minLength": 1,
|
|
159
|
+
"maxLength": 256,
|
|
160
|
+
"description": "The credential-vault handle to store the VWC under. Absent, the VTA derives one. Supplying it lets a caller recognise its own result after an ambiguous failure."
|
|
161
|
+
},
|
|
162
|
+
"ext": {
|
|
163
|
+
"$ref": "#/$defs/Ext"
|
|
164
|
+
}
|
|
165
|
+
},
|
|
166
|
+
"$defs": {
|
|
167
|
+
"Membership": {
|
|
168
|
+
"title": "Membership",
|
|
169
|
+
"description": "A membership credential (VMC) held in the credential vault, and the DID it names. When memberDid is absent the VMC names relationshipDid and is presented in the relationship presentation. When memberDid is present the VMC names that DID, and the VTA builds a second presentation — the member presentation — signed by memberDid and bound to the same session, which discloses memberDid to the witness.",
|
|
170
|
+
"type": "object",
|
|
171
|
+
"additionalProperties": false,
|
|
172
|
+
"required": [
|
|
173
|
+
"credentialId"
|
|
174
|
+
],
|
|
175
|
+
"properties": {
|
|
176
|
+
"credentialId": {
|
|
177
|
+
"type": "string",
|
|
178
|
+
"minLength": 1,
|
|
179
|
+
"maxLength": 256,
|
|
180
|
+
"description": "The credential-vault handle of the membership credential."
|
|
181
|
+
},
|
|
182
|
+
"memberDid": {
|
|
183
|
+
"type": "string",
|
|
184
|
+
"pattern": "^did:",
|
|
185
|
+
"description": "The member DID the membership credential names, when it is not relationshipDid. The VTA must hold a key of it in a context the caller may act in. Naming it is the caller's explicit choice to disclose it to the witness."
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
},
|
|
189
|
+
"Evidence": {
|
|
190
|
+
"title": "Evidence",
|
|
191
|
+
"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.",
|
|
192
|
+
"type": "object",
|
|
193
|
+
"additionalProperties": false,
|
|
194
|
+
"required": [
|
|
195
|
+
"session",
|
|
196
|
+
"outcome"
|
|
197
|
+
],
|
|
198
|
+
"properties": {
|
|
199
|
+
"session": {
|
|
200
|
+
"type": "object",
|
|
201
|
+
"minProperties": 1,
|
|
202
|
+
"description": "The witness/session document that opened the session, as the VTA sent it. The VWC's taskContext is its id and its taskDigestMultibase is computed over it."
|
|
203
|
+
},
|
|
204
|
+
"outcome": {
|
|
205
|
+
"type": "object",
|
|
206
|
+
"minProperties": 1,
|
|
207
|
+
"description": "The witness/session/submit #response, as the VTA received it, under the witness's proof. It carries the VWC and its vwcDigestMultibase."
|
|
208
|
+
}
|
|
209
|
+
}
|
|
210
|
+
},
|
|
211
|
+
"Response": {
|
|
212
|
+
"$anchor": "response",
|
|
213
|
+
"title": "VTA Witness — Request — response payload",
|
|
214
|
+
"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.",
|
|
215
|
+
"type": "object",
|
|
216
|
+
"additionalProperties": false,
|
|
217
|
+
"required": [
|
|
218
|
+
"credentialId",
|
|
219
|
+
"witness",
|
|
220
|
+
"vwcDigestMultibase",
|
|
221
|
+
"evidence"
|
|
222
|
+
],
|
|
223
|
+
"properties": {
|
|
224
|
+
"credentialId": {
|
|
225
|
+
"type": "string",
|
|
226
|
+
"minLength": 1,
|
|
227
|
+
"maxLength": 256,
|
|
228
|
+
"description": "The credential-vault handle the VWC is now stored under, with its evidence."
|
|
229
|
+
},
|
|
230
|
+
"witness": {
|
|
231
|
+
"type": "string",
|
|
232
|
+
"pattern": "^did:",
|
|
233
|
+
"description": "The witness that issued the VWC. Equal to the request's witness: a VWC issued by any other party is refused, not stored."
|
|
234
|
+
},
|
|
235
|
+
"vwcDigestMultibase": {
|
|
236
|
+
"$ref": "#/$defs/DigestMultibase",
|
|
237
|
+
"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."
|
|
238
|
+
},
|
|
239
|
+
"evidence": {
|
|
240
|
+
"$ref": "#/$defs/Evidence"
|
|
241
|
+
},
|
|
242
|
+
"ext": {
|
|
243
|
+
"$ref": "#/$defs/Ext"
|
|
244
|
+
}
|
|
245
|
+
}
|
|
246
|
+
},
|
|
247
|
+
"Ext": {
|
|
248
|
+
"title": "Ext",
|
|
249
|
+
"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.",
|
|
250
|
+
"type": "object",
|
|
251
|
+
"minProperties": 1,
|
|
252
|
+
"additionalProperties": true,
|
|
253
|
+
"propertyNames": {
|
|
254
|
+
"pattern": "^[a-z][a-z0-9-]*(\\.[a-z0-9-]+)+$"
|
|
255
|
+
}
|
|
256
|
+
},
|
|
257
|
+
"DigestMultibase": {
|
|
258
|
+
"title": "DigestMultibase",
|
|
259
|
+
"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`.",
|
|
260
|
+
"type": "string",
|
|
261
|
+
"minLength": 16,
|
|
262
|
+
"pattern": "^(z[1-9A-HJ-NP-Za-km-z]+|u[A-Za-z0-9_-]+)$",
|
|
263
|
+
"examples": [
|
|
264
|
+
"zQmbWqxBEKC3P8tqsKc98xmWNzrzDtRLMiMPL8wBuTGsMnR"
|
|
265
|
+
]
|
|
266
|
+
}
|
|
267
|
+
}
|
|
268
|
+
} as const;
|
|
269
|
+
|
|
270
|
+
/** As {@link PAYLOAD_SCHEMA}, for the success-response variant. */
|
|
271
|
+
export const RESPONSE_PAYLOAD_SCHEMA = {
|
|
272
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
273
|
+
"$ref": "#/$defs/Response",
|
|
274
|
+
"$defs": {
|
|
275
|
+
"Membership": {
|
|
276
|
+
"title": "Membership",
|
|
277
|
+
"description": "A membership credential (VMC) held in the credential vault, and the DID it names. When memberDid is absent the VMC names relationshipDid and is presented in the relationship presentation. When memberDid is present the VMC names that DID, and the VTA builds a second presentation — the member presentation — signed by memberDid and bound to the same session, which discloses memberDid to the witness.",
|
|
278
|
+
"type": "object",
|
|
279
|
+
"additionalProperties": false,
|
|
280
|
+
"required": [
|
|
281
|
+
"credentialId"
|
|
282
|
+
],
|
|
283
|
+
"properties": {
|
|
284
|
+
"credentialId": {
|
|
285
|
+
"type": "string",
|
|
286
|
+
"minLength": 1,
|
|
287
|
+
"maxLength": 256,
|
|
288
|
+
"description": "The credential-vault handle of the membership credential."
|
|
289
|
+
},
|
|
290
|
+
"memberDid": {
|
|
291
|
+
"type": "string",
|
|
292
|
+
"pattern": "^did:",
|
|
293
|
+
"description": "The member DID the membership credential names, when it is not relationshipDid. The VTA must hold a key of it in a context the caller may act in. Naming it is the caller's explicit choice to disclose it to the witness."
|
|
294
|
+
}
|
|
295
|
+
}
|
|
296
|
+
},
|
|
297
|
+
"Evidence": {
|
|
298
|
+
"title": "Evidence",
|
|
299
|
+
"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.",
|
|
300
|
+
"type": "object",
|
|
301
|
+
"additionalProperties": false,
|
|
302
|
+
"required": [
|
|
303
|
+
"session",
|
|
304
|
+
"outcome"
|
|
305
|
+
],
|
|
306
|
+
"properties": {
|
|
307
|
+
"session": {
|
|
308
|
+
"type": "object",
|
|
309
|
+
"minProperties": 1,
|
|
310
|
+
"description": "The witness/session document that opened the session, as the VTA sent it. The VWC's taskContext is its id and its taskDigestMultibase is computed over it."
|
|
311
|
+
},
|
|
312
|
+
"outcome": {
|
|
313
|
+
"type": "object",
|
|
314
|
+
"minProperties": 1,
|
|
315
|
+
"description": "The witness/session/submit #response, as the VTA received it, under the witness's proof. It carries the VWC and its vwcDigestMultibase."
|
|
316
|
+
}
|
|
317
|
+
}
|
|
318
|
+
},
|
|
319
|
+
"Response": {
|
|
320
|
+
"$anchor": "response",
|
|
321
|
+
"title": "VTA Witness — Request — response payload",
|
|
322
|
+
"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.",
|
|
323
|
+
"type": "object",
|
|
324
|
+
"additionalProperties": false,
|
|
325
|
+
"required": [
|
|
326
|
+
"credentialId",
|
|
327
|
+
"witness",
|
|
328
|
+
"vwcDigestMultibase",
|
|
329
|
+
"evidence"
|
|
330
|
+
],
|
|
331
|
+
"properties": {
|
|
332
|
+
"credentialId": {
|
|
333
|
+
"type": "string",
|
|
334
|
+
"minLength": 1,
|
|
335
|
+
"maxLength": 256,
|
|
336
|
+
"description": "The credential-vault handle the VWC is now stored under, with its evidence."
|
|
337
|
+
},
|
|
338
|
+
"witness": {
|
|
339
|
+
"type": "string",
|
|
340
|
+
"pattern": "^did:",
|
|
341
|
+
"description": "The witness that issued the VWC. Equal to the request's witness: a VWC issued by any other party is refused, not stored."
|
|
342
|
+
},
|
|
343
|
+
"vwcDigestMultibase": {
|
|
344
|
+
"$ref": "#/$defs/DigestMultibase",
|
|
345
|
+
"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."
|
|
346
|
+
},
|
|
347
|
+
"evidence": {
|
|
348
|
+
"$ref": "#/$defs/Evidence"
|
|
349
|
+
},
|
|
350
|
+
"ext": {
|
|
351
|
+
"$ref": "#/$defs/Ext"
|
|
352
|
+
}
|
|
353
|
+
}
|
|
354
|
+
},
|
|
355
|
+
"Ext": {
|
|
356
|
+
"title": "Ext",
|
|
357
|
+
"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.",
|
|
358
|
+
"type": "object",
|
|
359
|
+
"minProperties": 1,
|
|
360
|
+
"additionalProperties": true,
|
|
361
|
+
"propertyNames": {
|
|
362
|
+
"pattern": "^[a-z][a-z0-9-]*(\\.[a-z0-9-]+)+$"
|
|
363
|
+
}
|
|
364
|
+
},
|
|
365
|
+
"DigestMultibase": {
|
|
366
|
+
"title": "DigestMultibase",
|
|
367
|
+
"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`.",
|
|
368
|
+
"type": "string",
|
|
369
|
+
"minLength": 16,
|
|
370
|
+
"pattern": "^(z[1-9A-HJ-NP-Za-km-z]+|u[A-Za-z0-9_-]+)$",
|
|
371
|
+
"examples": [
|
|
372
|
+
"zQmbWqxBEKC3P8tqsKc98xmWNzrzDtRLMiMPL8wBuTGsMnR"
|
|
373
|
+
]
|
|
374
|
+
}
|
|
375
|
+
}
|
|
376
|
+
} as const;
|
|
377
|
+
|
|
378
|
+
/**
|
|
379
|
+
* SPEC.md §7.2 policy for the request variant, from this specification's
|
|
380
|
+
* front matter. Pass to `consumeInbound` — items 5b, 7 and 8 are
|
|
381
|
+
* per-specification and cannot be derived from the document alone, and
|
|
382
|
+
* item 2 needs the schema this carries.
|
|
383
|
+
*/
|
|
384
|
+
export const SPEC = {
|
|
385
|
+
typeUri: TYPE_URI,
|
|
386
|
+
isBearer: false,
|
|
387
|
+
isProofRequired: true,
|
|
388
|
+
isRecipientRequired: true,
|
|
389
|
+
isIssuedAtRequired: true,
|
|
390
|
+
payloadSchema: PAYLOAD_SCHEMA,
|
|
391
|
+
} as const;
|
|
392
|
+
|
|
393
|
+
/**
|
|
394
|
+
* SPEC.md §7.2 policy for the success-response variant. `isRecipientRequired`
|
|
395
|
+
* tracks the *issuer* party's requirement because a response swaps the
|
|
396
|
+
* parties (§7.3 item 5).
|
|
397
|
+
*/
|
|
398
|
+
export const RESPONSE_SPEC = {
|
|
399
|
+
typeUri: RESPONSE_TYPE_URI,
|
|
400
|
+
isBearer: false,
|
|
401
|
+
isProofRequired: false,
|
|
402
|
+
isRecipientRequired: true,
|
|
403
|
+
isIssuedAtRequired: true,
|
|
404
|
+
payloadSchema: RESPONSE_PAYLOAD_SCHEMA,
|
|
405
|
+
} as const;
|