@openvtc/trust-tasks 0.28.23 → 0.28.24
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 +62 -0
- package/dist/_shared/components.d.ts +520 -0
- package/dist/_shared/components.d.ts.map +1 -1
- package/dist/index.d.ts +45 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +45 -0
- package/dist/index.js.map +1 -1
- package/dist/messaging/mux/_shared/0.1/mux.d.ts +16 -0
- package/dist/messaging/mux/_shared/0.1/mux.d.ts.map +1 -0
- package/dist/messaging/mux/_shared/0.1/mux.js +6 -0
- package/dist/messaging/mux/_shared/0.1/mux.js.map +1 -0
- package/dist/messaging/mux/attach/0.1/payload.d.ts +996 -0
- package/dist/messaging/mux/attach/0.1/payload.d.ts.map +1 -0
- package/dist/messaging/mux/attach/0.1/payload.js +594 -0
- package/dist/messaging/mux/attach/0.1/payload.js.map +1 -0
- package/dist/messaging/mux/detach/0.1/payload.d.ts +398 -0
- package/dist/messaging/mux/detach/0.1/payload.d.ts.map +1 -0
- package/dist/messaging/mux/detach/0.1/payload.js +215 -0
- package/dist/messaging/mux/detach/0.1/payload.js.map +1 -0
- package/dist/messaging/mux/event/0.1/payload.d.ts +513 -0
- package/dist/messaging/mux/event/0.1/payload.d.ts.map +1 -0
- package/dist/messaging/mux/event/0.1/payload.js +260 -0
- package/dist/messaging/mux/event/0.1/payload.js.map +1 -0
- package/dist/messaging/mux/grant/0.1/payload.d.ts +1008 -0
- package/dist/messaging/mux/grant/0.1/payload.d.ts.map +1 -0
- package/dist/messaging/mux/grant/0.1/payload.js +606 -0
- package/dist/messaging/mux/grant/0.1/payload.js.map +1 -0
- package/dist/messaging/mux/list/0.1/payload.d.ts +1241 -0
- package/dist/messaging/mux/list/0.1/payload.d.ts.map +1 -0
- package/dist/messaging/mux/list/0.1/payload.js +715 -0
- package/dist/messaging/mux/list/0.1/payload.js.map +1 -0
- package/dist/messaging/mux/notice/0.1/payload.d.ts +489 -0
- package/dist/messaging/mux/notice/0.1/payload.d.ts.map +1 -0
- package/dist/messaging/mux/notice/0.1/payload.js +249 -0
- package/dist/messaging/mux/notice/0.1/payload.js.map +1 -0
- package/dist/messaging/mux/revoke/0.1/payload.d.ts +585 -0
- package/dist/messaging/mux/revoke/0.1/payload.d.ts.map +1 -0
- package/dist/messaging/mux/revoke/0.1/payload.js +311 -0
- package/dist/messaging/mux/revoke/0.1/payload.js.map +1 -0
- package/dist/messaging/mux/revoke-all/0.1/payload.d.ts +682 -0
- package/dist/messaging/mux/revoke-all/0.1/payload.d.ts.map +1 -0
- package/dist/messaging/mux/revoke-all/0.1/payload.js +397 -0
- package/dist/messaging/mux/revoke-all/0.1/payload.js.map +1 -0
- package/dist/messaging/mux/update/0.1/payload.d.ts +995 -0
- package/dist/messaging/mux/update/0.1/payload.d.ts.map +1 -0
- package/dist/messaging/mux/update/0.1/payload.js +586 -0
- package/dist/messaging/mux/update/0.1/payload.js.map +1 -0
- package/dist/vta/_shared/0.1/memory-record.d.ts +22 -0
- package/dist/vta/_shared/0.1/memory-record.d.ts.map +1 -0
- package/dist/vta/_shared/0.1/memory-record.js +6 -0
- package/dist/vta/_shared/0.1/memory-record.js.map +1 -0
- package/dist/vta/memory/delete/0.1/payload.d.ts +13 -2
- package/dist/vta/memory/delete/0.1/payload.d.ts.map +1 -1
- package/dist/vta/memory/delete/0.1/payload.js +1 -1
- package/dist/vta/memory/delete/0.1/payload.js.map +1 -1
- package/dist/vta/memory/delete/0.2/payload.d.ts +415 -0
- package/dist/vta/memory/delete/0.2/payload.d.ts.map +1 -0
- package/dist/vta/memory/delete/0.2/payload.js +224 -0
- package/dist/vta/memory/delete/0.2/payload.js.map +1 -0
- package/dist/vta/memory/get/0.1/payload.d.ts +646 -0
- package/dist/vta/memory/get/0.1/payload.d.ts.map +1 -0
- package/dist/vta/memory/get/0.1/payload.js +349 -0
- package/dist/vta/memory/get/0.1/payload.js.map +1 -0
- package/dist/vta/memory/list/0.1/payload.d.ts +13 -2
- package/dist/vta/memory/list/0.1/payload.d.ts.map +1 -1
- package/dist/vta/memory/list/0.1/payload.js +1 -1
- package/dist/vta/memory/list/0.1/payload.js.map +1 -1
- package/dist/vta/memory/list/0.2/payload.d.ts +693 -0
- package/dist/vta/memory/list/0.2/payload.d.ts.map +1 -0
- package/dist/vta/memory/list/0.2/payload.js +363 -0
- package/dist/vta/memory/list/0.2/payload.js.map +1 -0
- package/dist/vta/memory/put/0.1/payload.d.ts +13 -2
- package/dist/vta/memory/put/0.1/payload.d.ts.map +1 -1
- package/dist/vta/memory/put/0.1/payload.js +1 -1
- package/dist/vta/memory/put/0.1/payload.js.map +1 -1
- package/dist/vta/memory/put/0.2/payload.d.ts +490 -0
- package/dist/vta/memory/put/0.2/payload.d.ts.map +1 -0
- package/dist/vta/memory/put/0.2/payload.js +264 -0
- package/dist/vta/memory/put/0.2/payload.js.map +1 -0
- package/package.json +1 -1
- package/src/_shared/components.ts +581 -0
- package/src/index.ts +45 -0
- package/src/messaging/mux/_shared/0.1/mux.ts +17 -0
- package/src/messaging/mux/attach/0.1/payload.ts +682 -0
- package/src/messaging/mux/detach/0.1/payload.ts +278 -0
- package/src/messaging/mux/event/0.1/payload.ts +371 -0
- package/src/messaging/mux/grant/0.1/payload.ts +710 -0
- package/src/messaging/mux/list/0.1/payload.ts +793 -0
- package/src/messaging/mux/notice/0.1/payload.ts +362 -0
- package/src/messaging/mux/revoke/0.1/payload.ts +389 -0
- package/src/messaging/mux/revoke-all/0.1/payload.ts +452 -0
- package/src/messaging/mux/update/0.1/payload.ts +644 -0
- package/src/vta/_shared/0.1/memory-record.ts +23 -0
- package/src/vta/memory/delete/0.1/payload.ts +14 -3
- package/src/vta/memory/delete/0.2/payload.ts +288 -0
- package/src/vta/memory/get/0.1/payload.ts +414 -0
- package/src/vta/memory/list/0.1/payload.ts +14 -3
- package/src/vta/memory/list/0.2/payload.ts +445 -0
- package/src/vta/memory/put/0.1/payload.ts +14 -3
- package/src/vta/memory/put/0.2/payload.ts +333 -0
|
@@ -0,0 +1,682 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Generated by scripts/build-ts-bindings.mjs — DO NOT EDIT BY HAND.
|
|
3
|
+
* Source: specs/messaging/mux/attach/0.1/payload.schema.json
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
import type { AttachStatement, DataIntegrityProof, Ext, MuxDataIntegrityProof, MuxDid, MuxNonce, MuxScope, MuxScopeValue, SessionId_MessagingMuxV0_1 as SessionId, StatementScope } from "../../../../_shared/components.js";
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* A principal attaches member DIDs to the connection that carries the request, each by an attach statement the member DID signed with an embedded Data Integrity proof, bound to this connection. The outer document members are owned by the framework — SPEC §6.3.
|
|
11
|
+
*/
|
|
12
|
+
export interface MessagingMuxAttachPayload {
|
|
13
|
+
/**
|
|
14
|
+
* The members to attach, one attach statement each; the member DID is the statement's `issuer`. Each is checked and answered on its own; the batch is never all-or-nothing. A member DID appears at most once.
|
|
15
|
+
*
|
|
16
|
+
* @minItems 1
|
|
17
|
+
* @maxItems 256
|
|
18
|
+
*/
|
|
19
|
+
attachments: [AttachStatement, ...AttachStatement[]];
|
|
20
|
+
/**
|
|
21
|
+
* Ecosystem-defined extension members per SPEC.md §4.5.1.
|
|
22
|
+
*/
|
|
23
|
+
ext?: Ext;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* The success response to a messaging/mux/attach request: one outcome per attach statement, in request order. Carried in a Trust Task document whose type is https://trusttasks.org/spec/messaging/mux/attach/0.1#response.
|
|
27
|
+
*/
|
|
28
|
+
export interface MessagingMuxAttachResponsePayload {
|
|
29
|
+
/**
|
|
30
|
+
* @maxItems 256
|
|
31
|
+
*/
|
|
32
|
+
results: AttachOutcome[];
|
|
33
|
+
/**
|
|
34
|
+
* Ecosystem-defined extension members per SPEC.md §4.5.1.
|
|
35
|
+
*/
|
|
36
|
+
ext?: Ext;
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* The outcome for one requested member. An `attached` outcome carries `scope`, `expiresAt` and `deliveryActive`; a `refused` outcome carries `code` and nothing else.
|
|
40
|
+
*/
|
|
41
|
+
export interface AttachOutcome {
|
|
42
|
+
/**
|
|
43
|
+
* The member DID: the statement's `issuer`.
|
|
44
|
+
*/
|
|
45
|
+
did: MuxDid;
|
|
46
|
+
status: "attached" | "refused";
|
|
47
|
+
/**
|
|
48
|
+
* Present exactly when `status` is `refused`: the first check the member failed, in the order the specification lists them.
|
|
49
|
+
*/
|
|
50
|
+
code?:
|
|
51
|
+
| "messaging/mux:statementProofInvalid"
|
|
52
|
+
| "messaging/mux:didUnresolvable"
|
|
53
|
+
| "messaging/mux:proofPurposeInvalid"
|
|
54
|
+
| "messaging/mux:audienceMismatch"
|
|
55
|
+
| "messaging/mux:principalMismatch"
|
|
56
|
+
| "messaging/mux/attach:sessionMismatch"
|
|
57
|
+
| "messaging/mux:notYetValid"
|
|
58
|
+
| "messaging/mux:statementExpired"
|
|
59
|
+
| "messaging/mux:lifetimeTooLong"
|
|
60
|
+
| "messaging/mux:emptyScope"
|
|
61
|
+
| "messaging/mux:accountUnavailable"
|
|
62
|
+
| "messaging/mux:scopeNotPermitted"
|
|
63
|
+
| "messaging/mux/attach:memberQuota";
|
|
64
|
+
/**
|
|
65
|
+
* Present exactly when `status` is `attached`: the scope in force.
|
|
66
|
+
*/
|
|
67
|
+
scope?: MuxScope;
|
|
68
|
+
/**
|
|
69
|
+
* Present exactly when `status` is `attached`: when the attach lapses (the statement's `exp`).
|
|
70
|
+
*/
|
|
71
|
+
expiresAt?: string;
|
|
72
|
+
/**
|
|
73
|
+
* Present exactly when `status` is `attached`. False when the member DID has its own direct connection, which takes precedence: the attach is held, and becomes active when that connection ends.
|
|
74
|
+
*/
|
|
75
|
+
deliveryActive?: boolean;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
/** Shared definitions this specification references, re-exported under the names it used to declare them with. */
|
|
79
|
+
export type { AttachStatement, DataIntegrityProof, Ext, MuxDataIntegrityProof, MuxDid, MuxNonce, MuxScope, MuxScopeValue, SessionId, StatementScope };
|
|
80
|
+
|
|
81
|
+
/** Trust Task type URI. */
|
|
82
|
+
export const TYPE_URI = "https://trusttasks.org/spec/messaging/mux/attach/0.1" as const;
|
|
83
|
+
|
|
84
|
+
/**
|
|
85
|
+
* The earlier version of this specification that this one declares it
|
|
86
|
+
* extends (front matter `extends`, SPEC §5.2 "Declared extension"), or
|
|
87
|
+
* `null`. Only the direct declaration — follow the chain with
|
|
88
|
+
* `extendsChain` / `readForSpec`.
|
|
89
|
+
*/
|
|
90
|
+
export const EXTENDS: string | null = null;
|
|
91
|
+
|
|
92
|
+
/**
|
|
93
|
+
* Why this version is deprecated, or `null` while it is current. A
|
|
94
|
+
* superseded or retired version is still supported, and is withdrawn from
|
|
95
|
+
* this package in a later scheduled batch (SPEC "Superseded and Withdrawn
|
|
96
|
+
* Versions").
|
|
97
|
+
*/
|
|
98
|
+
export const DEPRECATION: string | null = null;
|
|
99
|
+
|
|
100
|
+
/** Stable alias for this specification's request payload shape. */
|
|
101
|
+
export type Payload = MessagingMuxAttachPayload;
|
|
102
|
+
|
|
103
|
+
/** Trust Task response type URI (request type URI + "#response"). */
|
|
104
|
+
export const RESPONSE_TYPE_URI = "https://trusttasks.org/spec/messaging/mux/attach/0.1#response" as const;
|
|
105
|
+
|
|
106
|
+
/** Stable alias for this specification's success-response payload shape. */
|
|
107
|
+
export type Response = MessagingMuxAttachResponsePayload;
|
|
108
|
+
|
|
109
|
+
/**
|
|
110
|
+
* This specification's payload schema, as a value.
|
|
111
|
+
*
|
|
112
|
+
* SPEC.md §7.2 item 2 is performed against this. It is shipped as data
|
|
113
|
+
* rather than only as a `.json` file because TypeScript types are erased
|
|
114
|
+
* at runtime: without a schema a consumer has nothing to validate, and
|
|
115
|
+
* every REQUIRED payload member is optional in practice. Cross-file
|
|
116
|
+
* `$ref`s are already inlined, so it needs no resolver.
|
|
117
|
+
*/
|
|
118
|
+
export const PAYLOAD_SCHEMA = {
|
|
119
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
120
|
+
"$id": "https://trusttasks.org/spec/messaging/mux/attach/0.1",
|
|
121
|
+
"title": "Messaging — Mux Attach — payload",
|
|
122
|
+
"description": "A principal attaches member DIDs to the connection that carries the request, each by an attach statement the member DID signed with an embedded Data Integrity proof, bound to this connection. The outer document members are owned by the framework — SPEC §6.3.",
|
|
123
|
+
"type": "object",
|
|
124
|
+
"additionalProperties": false,
|
|
125
|
+
"required": [
|
|
126
|
+
"attachments"
|
|
127
|
+
],
|
|
128
|
+
"properties": {
|
|
129
|
+
"attachments": {
|
|
130
|
+
"type": "array",
|
|
131
|
+
"minItems": 1,
|
|
132
|
+
"maxItems": 256,
|
|
133
|
+
"description": "The members to attach, one attach statement each; the member DID is the statement's `issuer`. Each is checked and answered on its own; the batch is never all-or-nothing. A member DID appears at most once.",
|
|
134
|
+
"items": {
|
|
135
|
+
"$ref": "#/$defs/AttachStatement"
|
|
136
|
+
}
|
|
137
|
+
},
|
|
138
|
+
"ext": {
|
|
139
|
+
"$ref": "#/$defs/Ext",
|
|
140
|
+
"description": "Ecosystem-defined extension members per SPEC.md §4.5.1."
|
|
141
|
+
}
|
|
142
|
+
},
|
|
143
|
+
"$defs": {
|
|
144
|
+
"Response": {
|
|
145
|
+
"$anchor": "response",
|
|
146
|
+
"title": "Messaging — Mux Attach — response payload",
|
|
147
|
+
"description": "The success response to a messaging/mux/attach request: one outcome per attach statement, in request order. Carried in a Trust Task document whose type is https://trusttasks.org/spec/messaging/mux/attach/0.1#response.",
|
|
148
|
+
"type": "object",
|
|
149
|
+
"additionalProperties": false,
|
|
150
|
+
"required": [
|
|
151
|
+
"results"
|
|
152
|
+
],
|
|
153
|
+
"properties": {
|
|
154
|
+
"results": {
|
|
155
|
+
"type": "array",
|
|
156
|
+
"maxItems": 256,
|
|
157
|
+
"items": {
|
|
158
|
+
"$ref": "#/$defs/AttachOutcome"
|
|
159
|
+
}
|
|
160
|
+
},
|
|
161
|
+
"ext": {
|
|
162
|
+
"$ref": "#/$defs/Ext",
|
|
163
|
+
"description": "Ecosystem-defined extension members per SPEC.md §4.5.1."
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
},
|
|
167
|
+
"AttachOutcome": {
|
|
168
|
+
"title": "AttachOutcome",
|
|
169
|
+
"type": "object",
|
|
170
|
+
"additionalProperties": false,
|
|
171
|
+
"required": [
|
|
172
|
+
"did",
|
|
173
|
+
"status"
|
|
174
|
+
],
|
|
175
|
+
"description": "The outcome for one requested member. An `attached` outcome carries `scope`, `expiresAt` and `deliveryActive`; a `refused` outcome carries `code` and nothing else.",
|
|
176
|
+
"properties": {
|
|
177
|
+
"did": {
|
|
178
|
+
"$ref": "#/$defs/MuxDid",
|
|
179
|
+
"description": "The member DID: the statement's `issuer`."
|
|
180
|
+
},
|
|
181
|
+
"status": {
|
|
182
|
+
"type": "string",
|
|
183
|
+
"enum": [
|
|
184
|
+
"attached",
|
|
185
|
+
"refused"
|
|
186
|
+
]
|
|
187
|
+
},
|
|
188
|
+
"code": {
|
|
189
|
+
"type": "string",
|
|
190
|
+
"enum": [
|
|
191
|
+
"messaging/mux:statementProofInvalid",
|
|
192
|
+
"messaging/mux:didUnresolvable",
|
|
193
|
+
"messaging/mux:proofPurposeInvalid",
|
|
194
|
+
"messaging/mux:audienceMismatch",
|
|
195
|
+
"messaging/mux:principalMismatch",
|
|
196
|
+
"messaging/mux/attach:sessionMismatch",
|
|
197
|
+
"messaging/mux:notYetValid",
|
|
198
|
+
"messaging/mux:statementExpired",
|
|
199
|
+
"messaging/mux:lifetimeTooLong",
|
|
200
|
+
"messaging/mux:emptyScope",
|
|
201
|
+
"messaging/mux:accountUnavailable",
|
|
202
|
+
"messaging/mux:scopeNotPermitted",
|
|
203
|
+
"messaging/mux/attach:memberQuota"
|
|
204
|
+
],
|
|
205
|
+
"description": "Present exactly when `status` is `refused`: the first check the member failed, in the order the specification lists them."
|
|
206
|
+
},
|
|
207
|
+
"scope": {
|
|
208
|
+
"$ref": "#/$defs/MuxScope",
|
|
209
|
+
"description": "Present exactly when `status` is `attached`: the scope in force."
|
|
210
|
+
},
|
|
211
|
+
"expiresAt": {
|
|
212
|
+
"type": "string",
|
|
213
|
+
"format": "date-time",
|
|
214
|
+
"description": "Present exactly when `status` is `attached`: when the attach lapses (the statement's `exp`)."
|
|
215
|
+
},
|
|
216
|
+
"deliveryActive": {
|
|
217
|
+
"type": "boolean",
|
|
218
|
+
"description": "Present exactly when `status` is `attached`. False when the member DID has its own direct connection, which takes precedence: the attach is held, and becomes active when that connection ends."
|
|
219
|
+
}
|
|
220
|
+
}
|
|
221
|
+
},
|
|
222
|
+
"MuxScope": {
|
|
223
|
+
"title": "MuxScope",
|
|
224
|
+
"type": "array",
|
|
225
|
+
"minItems": 1,
|
|
226
|
+
"maxItems": 16,
|
|
227
|
+
"items": {
|
|
228
|
+
"$ref": "#/$defs/MuxScopeValue"
|
|
229
|
+
},
|
|
230
|
+
"description": "A set of capabilities: a non-empty JSON array of MuxScopeValue, compared as a set — order is not significant and a repeated value collapses into one. Never empty: an empty scope is refused, never read as \"all\". There is no default scope anywhere — every attach and every grant names its scope explicitly. A scope is always bounded by the member DID's own access-control capabilities at the mediator."
|
|
231
|
+
},
|
|
232
|
+
"MuxScopeValue": {
|
|
233
|
+
"title": "MuxScopeValue",
|
|
234
|
+
"type": "string",
|
|
235
|
+
"enum": [
|
|
236
|
+
"receive",
|
|
237
|
+
"pickup",
|
|
238
|
+
"delete",
|
|
239
|
+
"send"
|
|
240
|
+
],
|
|
241
|
+
"description": "One capability a member DID extends to a principal's connection. `receive`: live delivery of the member's inbound messages on the connection. `pickup`: message-pickup status and delivery requests naming the member as `recipient_did`, and inclusion in a raw-TSP inbox drain. `delete`: deleting the member's stored messages, including delete-on-ack and delete-on-send; a member without `delete` keeps its messages in its inbox until something holding `delete` collects them. `send`: the mediator accepts on this connection frames whose sender is the member DID — the frame is still signed or authcrypted with the member's own keys; the scope only lets the mediator accept it on this socket."
|
|
242
|
+
},
|
|
243
|
+
"MuxDid": {
|
|
244
|
+
"title": "MuxDid",
|
|
245
|
+
"type": "string",
|
|
246
|
+
"minLength": 7,
|
|
247
|
+
"maxLength": 2048,
|
|
248
|
+
"pattern": "^did:[a-z0-9]+:\\S+$",
|
|
249
|
+
"description": "A DID, carried verbatim and compared by exact string equality. Unlike the messaging family's `Vid`, never a hash: the mediator resolves it to verify a statement signed by it. For a member DID reached over TSP, the TSP VID is the DID itself."
|
|
250
|
+
},
|
|
251
|
+
"Ext": {
|
|
252
|
+
"title": "Ext",
|
|
253
|
+
"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.",
|
|
254
|
+
"type": "object",
|
|
255
|
+
"minProperties": 1,
|
|
256
|
+
"additionalProperties": true,
|
|
257
|
+
"propertyNames": {
|
|
258
|
+
"pattern": "^[a-z][a-z0-9-]*(\\.[a-z0-9-]+)+$"
|
|
259
|
+
}
|
|
260
|
+
},
|
|
261
|
+
"AttachStatement": {
|
|
262
|
+
"title": "AttachStatement",
|
|
263
|
+
"type": "object",
|
|
264
|
+
"additionalProperties": false,
|
|
265
|
+
"required": [
|
|
266
|
+
"type",
|
|
267
|
+
"issuer",
|
|
268
|
+
"audience",
|
|
269
|
+
"principal",
|
|
270
|
+
"sessionId",
|
|
271
|
+
"muxNonce",
|
|
272
|
+
"scope",
|
|
273
|
+
"iat",
|
|
274
|
+
"exp",
|
|
275
|
+
"proof"
|
|
276
|
+
],
|
|
277
|
+
"description": "A member DID's statement that the named principal may carry its traffic on one connection — the one whose `sessionId` and `muxNonce` it names — until `exp`, within `scope`. Signed by the member with an embedded Data Integrity proof whose purpose is `authentication`.",
|
|
278
|
+
"properties": {
|
|
279
|
+
"type": {
|
|
280
|
+
"type": "string",
|
|
281
|
+
"const": "muxAttach",
|
|
282
|
+
"description": "Always `muxAttach`; names the statement kind, so a statement of one kind is never accepted as another."
|
|
283
|
+
},
|
|
284
|
+
"issuer": {
|
|
285
|
+
"$ref": "#/$defs/MuxDid",
|
|
286
|
+
"description": "The member DID: the signer, and the DID the statement concerns."
|
|
287
|
+
},
|
|
288
|
+
"audience": {
|
|
289
|
+
"$ref": "#/$defs/MuxDid",
|
|
290
|
+
"description": "The mediator's DID. A statement names exactly one mediator and is refused by every other."
|
|
291
|
+
},
|
|
292
|
+
"principal": {
|
|
293
|
+
"$ref": "#/$defs/MuxDid",
|
|
294
|
+
"description": "The principal DID the connection is authenticated as. MUST differ from `issuer`."
|
|
295
|
+
},
|
|
296
|
+
"sessionId": {
|
|
297
|
+
"$ref": "#/$defs/SessionId"
|
|
298
|
+
},
|
|
299
|
+
"muxNonce": {
|
|
300
|
+
"$ref": "#/$defs/MuxNonce"
|
|
301
|
+
},
|
|
302
|
+
"scope": {
|
|
303
|
+
"$ref": "#/$defs/StatementScope"
|
|
304
|
+
},
|
|
305
|
+
"iat": {
|
|
306
|
+
"type": "integer",
|
|
307
|
+
"minimum": 0,
|
|
308
|
+
"description": "JWT NumericDate (RFC 7519 §2), whole seconds since 1970-01-01T00:00:00Z UTC: when the statement was signed. MUST NOT be more than 60 seconds in the mediator's future."
|
|
309
|
+
},
|
|
310
|
+
"exp": {
|
|
311
|
+
"type": "integer",
|
|
312
|
+
"minimum": 0,
|
|
313
|
+
"description": "JWT NumericDate (RFC 7519 §2): when the statement stops being accepted. REQUIRED; MUST be after `iat` and in the future."
|
|
314
|
+
},
|
|
315
|
+
"proof": {
|
|
316
|
+
"$ref": "#/$defs/MuxDataIntegrityProof"
|
|
317
|
+
}
|
|
318
|
+
}
|
|
319
|
+
},
|
|
320
|
+
"MuxDataIntegrityProof": {
|
|
321
|
+
"title": "MuxDataIntegrityProof",
|
|
322
|
+
"type": "object",
|
|
323
|
+
"additionalProperties": false,
|
|
324
|
+
"required": [
|
|
325
|
+
"type",
|
|
326
|
+
"cryptosuite",
|
|
327
|
+
"verificationMethod",
|
|
328
|
+
"proofPurpose",
|
|
329
|
+
"proofValue"
|
|
330
|
+
],
|
|
331
|
+
"description": "The W3C Data Integrity proof embedded in a mux statement, made by the member DID: the format and verifier Trust Tasks already use for document proofs (SPEC §4.7). The proof covers the whole statement except `proof` itself, as the cryptosuite defines. Closed: a member Data Integrity defines but this list omits is refused.",
|
|
332
|
+
"properties": {
|
|
333
|
+
"type": {
|
|
334
|
+
"type": "string",
|
|
335
|
+
"const": "DataIntegrityProof"
|
|
336
|
+
},
|
|
337
|
+
"cryptosuite": {
|
|
338
|
+
"type": "string",
|
|
339
|
+
"enum": [
|
|
340
|
+
"eddsa-jcs-2022",
|
|
341
|
+
"eddsa-rdfc-2022"
|
|
342
|
+
],
|
|
343
|
+
"description": "The W3C Data Integrity EdDSA cryptosuite used."
|
|
344
|
+
},
|
|
345
|
+
"verificationMethod": {
|
|
346
|
+
"type": "string",
|
|
347
|
+
"minLength": 5,
|
|
348
|
+
"maxLength": 2048,
|
|
349
|
+
"pattern": "^did:\\S+#\\S+$",
|
|
350
|
+
"description": "The DID URL of the verification method that signed. MUST be controlled by the statement's `issuer` and listed in that DID's current `authentication` relationship."
|
|
351
|
+
},
|
|
352
|
+
"proofPurpose": {
|
|
353
|
+
"type": "string",
|
|
354
|
+
"minLength": 1,
|
|
355
|
+
"maxLength": 64,
|
|
356
|
+
"description": "MUST be `authentication`. Any other value is refused with `messaging/mux:proofPurposeInvalid` — a proof made for another relationship (an `assertionMethod` credential signature, say) is never accepted as control of the DID."
|
|
357
|
+
},
|
|
358
|
+
"created": {
|
|
359
|
+
"type": "string",
|
|
360
|
+
"format": "date-time",
|
|
361
|
+
"description": "OPTIONAL: when the proof was made, as Data Integrity defines it. Covered by the proof; the statement's own `iat` is what the mediator checks."
|
|
362
|
+
},
|
|
363
|
+
"proofValue": {
|
|
364
|
+
"type": "string",
|
|
365
|
+
"minLength": 2,
|
|
366
|
+
"maxLength": 4096,
|
|
367
|
+
"pattern": "^z[1-9A-HJ-NP-Za-km-z]+$",
|
|
368
|
+
"description": "The multibase (base58btc) signature."
|
|
369
|
+
}
|
|
370
|
+
}
|
|
371
|
+
},
|
|
372
|
+
"StatementScope": {
|
|
373
|
+
"title": "StatementScope",
|
|
374
|
+
"type": "array",
|
|
375
|
+
"maxItems": 16,
|
|
376
|
+
"items": {
|
|
377
|
+
"$ref": "#/$defs/MuxScopeValue"
|
|
378
|
+
},
|
|
379
|
+
"description": "The scope a member DID signs into a statement: a JSON array of MuxScopeValue, compared as a set — order is not significant and a repeated value collapses. It MUST NOT be empty; an empty signed scope is refused with the task's `emptyScope` code, never read as \"all\". Unlike MuxScope, emptiness is not a schema failure here, so that the refusal is reported per statement rather than failing the whole batch."
|
|
380
|
+
},
|
|
381
|
+
"MuxNonce": {
|
|
382
|
+
"title": "MuxNonce",
|
|
383
|
+
"type": "string",
|
|
384
|
+
"pattern": "^[A-Za-z0-9_-]{43}$",
|
|
385
|
+
"description": "32 random bytes, base64url without padding, that belong to exactly one connection and are never reused. Attach statements sign over it, which is what makes an attach statement unusable on any other connection."
|
|
386
|
+
},
|
|
387
|
+
"SessionId": {
|
|
388
|
+
"title": "SessionId",
|
|
389
|
+
"type": "string",
|
|
390
|
+
"minLength": 1,
|
|
391
|
+
"maxLength": 256,
|
|
392
|
+
"description": "The mediator's identifier for one authenticated connection, as announced in that connection's `ready` event."
|
|
393
|
+
}
|
|
394
|
+
}
|
|
395
|
+
} as const;
|
|
396
|
+
|
|
397
|
+
/** As {@link PAYLOAD_SCHEMA}, for the success-response variant. */
|
|
398
|
+
export const RESPONSE_PAYLOAD_SCHEMA = {
|
|
399
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
400
|
+
"$ref": "#/$defs/Response",
|
|
401
|
+
"$defs": {
|
|
402
|
+
"Response": {
|
|
403
|
+
"$anchor": "response",
|
|
404
|
+
"title": "Messaging — Mux Attach — response payload",
|
|
405
|
+
"description": "The success response to a messaging/mux/attach request: one outcome per attach statement, in request order. Carried in a Trust Task document whose type is https://trusttasks.org/spec/messaging/mux/attach/0.1#response.",
|
|
406
|
+
"type": "object",
|
|
407
|
+
"additionalProperties": false,
|
|
408
|
+
"required": [
|
|
409
|
+
"results"
|
|
410
|
+
],
|
|
411
|
+
"properties": {
|
|
412
|
+
"results": {
|
|
413
|
+
"type": "array",
|
|
414
|
+
"maxItems": 256,
|
|
415
|
+
"items": {
|
|
416
|
+
"$ref": "#/$defs/AttachOutcome"
|
|
417
|
+
}
|
|
418
|
+
},
|
|
419
|
+
"ext": {
|
|
420
|
+
"$ref": "#/$defs/Ext",
|
|
421
|
+
"description": "Ecosystem-defined extension members per SPEC.md §4.5.1."
|
|
422
|
+
}
|
|
423
|
+
}
|
|
424
|
+
},
|
|
425
|
+
"AttachOutcome": {
|
|
426
|
+
"title": "AttachOutcome",
|
|
427
|
+
"type": "object",
|
|
428
|
+
"additionalProperties": false,
|
|
429
|
+
"required": [
|
|
430
|
+
"did",
|
|
431
|
+
"status"
|
|
432
|
+
],
|
|
433
|
+
"description": "The outcome for one requested member. An `attached` outcome carries `scope`, `expiresAt` and `deliveryActive`; a `refused` outcome carries `code` and nothing else.",
|
|
434
|
+
"properties": {
|
|
435
|
+
"did": {
|
|
436
|
+
"$ref": "#/$defs/MuxDid",
|
|
437
|
+
"description": "The member DID: the statement's `issuer`."
|
|
438
|
+
},
|
|
439
|
+
"status": {
|
|
440
|
+
"type": "string",
|
|
441
|
+
"enum": [
|
|
442
|
+
"attached",
|
|
443
|
+
"refused"
|
|
444
|
+
]
|
|
445
|
+
},
|
|
446
|
+
"code": {
|
|
447
|
+
"type": "string",
|
|
448
|
+
"enum": [
|
|
449
|
+
"messaging/mux:statementProofInvalid",
|
|
450
|
+
"messaging/mux:didUnresolvable",
|
|
451
|
+
"messaging/mux:proofPurposeInvalid",
|
|
452
|
+
"messaging/mux:audienceMismatch",
|
|
453
|
+
"messaging/mux:principalMismatch",
|
|
454
|
+
"messaging/mux/attach:sessionMismatch",
|
|
455
|
+
"messaging/mux:notYetValid",
|
|
456
|
+
"messaging/mux:statementExpired",
|
|
457
|
+
"messaging/mux:lifetimeTooLong",
|
|
458
|
+
"messaging/mux:emptyScope",
|
|
459
|
+
"messaging/mux:accountUnavailable",
|
|
460
|
+
"messaging/mux:scopeNotPermitted",
|
|
461
|
+
"messaging/mux/attach:memberQuota"
|
|
462
|
+
],
|
|
463
|
+
"description": "Present exactly when `status` is `refused`: the first check the member failed, in the order the specification lists them."
|
|
464
|
+
},
|
|
465
|
+
"scope": {
|
|
466
|
+
"$ref": "#/$defs/MuxScope",
|
|
467
|
+
"description": "Present exactly when `status` is `attached`: the scope in force."
|
|
468
|
+
},
|
|
469
|
+
"expiresAt": {
|
|
470
|
+
"type": "string",
|
|
471
|
+
"format": "date-time",
|
|
472
|
+
"description": "Present exactly when `status` is `attached`: when the attach lapses (the statement's `exp`)."
|
|
473
|
+
},
|
|
474
|
+
"deliveryActive": {
|
|
475
|
+
"type": "boolean",
|
|
476
|
+
"description": "Present exactly when `status` is `attached`. False when the member DID has its own direct connection, which takes precedence: the attach is held, and becomes active when that connection ends."
|
|
477
|
+
}
|
|
478
|
+
}
|
|
479
|
+
},
|
|
480
|
+
"MuxScope": {
|
|
481
|
+
"title": "MuxScope",
|
|
482
|
+
"type": "array",
|
|
483
|
+
"minItems": 1,
|
|
484
|
+
"maxItems": 16,
|
|
485
|
+
"items": {
|
|
486
|
+
"$ref": "#/$defs/MuxScopeValue"
|
|
487
|
+
},
|
|
488
|
+
"description": "A set of capabilities: a non-empty JSON array of MuxScopeValue, compared as a set — order is not significant and a repeated value collapses into one. Never empty: an empty scope is refused, never read as \"all\". There is no default scope anywhere — every attach and every grant names its scope explicitly. A scope is always bounded by the member DID's own access-control capabilities at the mediator."
|
|
489
|
+
},
|
|
490
|
+
"MuxScopeValue": {
|
|
491
|
+
"title": "MuxScopeValue",
|
|
492
|
+
"type": "string",
|
|
493
|
+
"enum": [
|
|
494
|
+
"receive",
|
|
495
|
+
"pickup",
|
|
496
|
+
"delete",
|
|
497
|
+
"send"
|
|
498
|
+
],
|
|
499
|
+
"description": "One capability a member DID extends to a principal's connection. `receive`: live delivery of the member's inbound messages on the connection. `pickup`: message-pickup status and delivery requests naming the member as `recipient_did`, and inclusion in a raw-TSP inbox drain. `delete`: deleting the member's stored messages, including delete-on-ack and delete-on-send; a member without `delete` keeps its messages in its inbox until something holding `delete` collects them. `send`: the mediator accepts on this connection frames whose sender is the member DID — the frame is still signed or authcrypted with the member's own keys; the scope only lets the mediator accept it on this socket."
|
|
500
|
+
},
|
|
501
|
+
"MuxDid": {
|
|
502
|
+
"title": "MuxDid",
|
|
503
|
+
"type": "string",
|
|
504
|
+
"minLength": 7,
|
|
505
|
+
"maxLength": 2048,
|
|
506
|
+
"pattern": "^did:[a-z0-9]+:\\S+$",
|
|
507
|
+
"description": "A DID, carried verbatim and compared by exact string equality. Unlike the messaging family's `Vid`, never a hash: the mediator resolves it to verify a statement signed by it. For a member DID reached over TSP, the TSP VID is the DID itself."
|
|
508
|
+
},
|
|
509
|
+
"Ext": {
|
|
510
|
+
"title": "Ext",
|
|
511
|
+
"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.",
|
|
512
|
+
"type": "object",
|
|
513
|
+
"minProperties": 1,
|
|
514
|
+
"additionalProperties": true,
|
|
515
|
+
"propertyNames": {
|
|
516
|
+
"pattern": "^[a-z][a-z0-9-]*(\\.[a-z0-9-]+)+$"
|
|
517
|
+
}
|
|
518
|
+
},
|
|
519
|
+
"AttachStatement": {
|
|
520
|
+
"title": "AttachStatement",
|
|
521
|
+
"type": "object",
|
|
522
|
+
"additionalProperties": false,
|
|
523
|
+
"required": [
|
|
524
|
+
"type",
|
|
525
|
+
"issuer",
|
|
526
|
+
"audience",
|
|
527
|
+
"principal",
|
|
528
|
+
"sessionId",
|
|
529
|
+
"muxNonce",
|
|
530
|
+
"scope",
|
|
531
|
+
"iat",
|
|
532
|
+
"exp",
|
|
533
|
+
"proof"
|
|
534
|
+
],
|
|
535
|
+
"description": "A member DID's statement that the named principal may carry its traffic on one connection — the one whose `sessionId` and `muxNonce` it names — until `exp`, within `scope`. Signed by the member with an embedded Data Integrity proof whose purpose is `authentication`.",
|
|
536
|
+
"properties": {
|
|
537
|
+
"type": {
|
|
538
|
+
"type": "string",
|
|
539
|
+
"const": "muxAttach",
|
|
540
|
+
"description": "Always `muxAttach`; names the statement kind, so a statement of one kind is never accepted as another."
|
|
541
|
+
},
|
|
542
|
+
"issuer": {
|
|
543
|
+
"$ref": "#/$defs/MuxDid",
|
|
544
|
+
"description": "The member DID: the signer, and the DID the statement concerns."
|
|
545
|
+
},
|
|
546
|
+
"audience": {
|
|
547
|
+
"$ref": "#/$defs/MuxDid",
|
|
548
|
+
"description": "The mediator's DID. A statement names exactly one mediator and is refused by every other."
|
|
549
|
+
},
|
|
550
|
+
"principal": {
|
|
551
|
+
"$ref": "#/$defs/MuxDid",
|
|
552
|
+
"description": "The principal DID the connection is authenticated as. MUST differ from `issuer`."
|
|
553
|
+
},
|
|
554
|
+
"sessionId": {
|
|
555
|
+
"$ref": "#/$defs/SessionId"
|
|
556
|
+
},
|
|
557
|
+
"muxNonce": {
|
|
558
|
+
"$ref": "#/$defs/MuxNonce"
|
|
559
|
+
},
|
|
560
|
+
"scope": {
|
|
561
|
+
"$ref": "#/$defs/StatementScope"
|
|
562
|
+
},
|
|
563
|
+
"iat": {
|
|
564
|
+
"type": "integer",
|
|
565
|
+
"minimum": 0,
|
|
566
|
+
"description": "JWT NumericDate (RFC 7519 §2), whole seconds since 1970-01-01T00:00:00Z UTC: when the statement was signed. MUST NOT be more than 60 seconds in the mediator's future."
|
|
567
|
+
},
|
|
568
|
+
"exp": {
|
|
569
|
+
"type": "integer",
|
|
570
|
+
"minimum": 0,
|
|
571
|
+
"description": "JWT NumericDate (RFC 7519 §2): when the statement stops being accepted. REQUIRED; MUST be after `iat` and in the future."
|
|
572
|
+
},
|
|
573
|
+
"proof": {
|
|
574
|
+
"$ref": "#/$defs/MuxDataIntegrityProof"
|
|
575
|
+
}
|
|
576
|
+
}
|
|
577
|
+
},
|
|
578
|
+
"MuxDataIntegrityProof": {
|
|
579
|
+
"title": "MuxDataIntegrityProof",
|
|
580
|
+
"type": "object",
|
|
581
|
+
"additionalProperties": false,
|
|
582
|
+
"required": [
|
|
583
|
+
"type",
|
|
584
|
+
"cryptosuite",
|
|
585
|
+
"verificationMethod",
|
|
586
|
+
"proofPurpose",
|
|
587
|
+
"proofValue"
|
|
588
|
+
],
|
|
589
|
+
"description": "The W3C Data Integrity proof embedded in a mux statement, made by the member DID: the format and verifier Trust Tasks already use for document proofs (SPEC §4.7). The proof covers the whole statement except `proof` itself, as the cryptosuite defines. Closed: a member Data Integrity defines but this list omits is refused.",
|
|
590
|
+
"properties": {
|
|
591
|
+
"type": {
|
|
592
|
+
"type": "string",
|
|
593
|
+
"const": "DataIntegrityProof"
|
|
594
|
+
},
|
|
595
|
+
"cryptosuite": {
|
|
596
|
+
"type": "string",
|
|
597
|
+
"enum": [
|
|
598
|
+
"eddsa-jcs-2022",
|
|
599
|
+
"eddsa-rdfc-2022"
|
|
600
|
+
],
|
|
601
|
+
"description": "The W3C Data Integrity EdDSA cryptosuite used."
|
|
602
|
+
},
|
|
603
|
+
"verificationMethod": {
|
|
604
|
+
"type": "string",
|
|
605
|
+
"minLength": 5,
|
|
606
|
+
"maxLength": 2048,
|
|
607
|
+
"pattern": "^did:\\S+#\\S+$",
|
|
608
|
+
"description": "The DID URL of the verification method that signed. MUST be controlled by the statement's `issuer` and listed in that DID's current `authentication` relationship."
|
|
609
|
+
},
|
|
610
|
+
"proofPurpose": {
|
|
611
|
+
"type": "string",
|
|
612
|
+
"minLength": 1,
|
|
613
|
+
"maxLength": 64,
|
|
614
|
+
"description": "MUST be `authentication`. Any other value is refused with `messaging/mux:proofPurposeInvalid` — a proof made for another relationship (an `assertionMethod` credential signature, say) is never accepted as control of the DID."
|
|
615
|
+
},
|
|
616
|
+
"created": {
|
|
617
|
+
"type": "string",
|
|
618
|
+
"format": "date-time",
|
|
619
|
+
"description": "OPTIONAL: when the proof was made, as Data Integrity defines it. Covered by the proof; the statement's own `iat` is what the mediator checks."
|
|
620
|
+
},
|
|
621
|
+
"proofValue": {
|
|
622
|
+
"type": "string",
|
|
623
|
+
"minLength": 2,
|
|
624
|
+
"maxLength": 4096,
|
|
625
|
+
"pattern": "^z[1-9A-HJ-NP-Za-km-z]+$",
|
|
626
|
+
"description": "The multibase (base58btc) signature."
|
|
627
|
+
}
|
|
628
|
+
}
|
|
629
|
+
},
|
|
630
|
+
"StatementScope": {
|
|
631
|
+
"title": "StatementScope",
|
|
632
|
+
"type": "array",
|
|
633
|
+
"maxItems": 16,
|
|
634
|
+
"items": {
|
|
635
|
+
"$ref": "#/$defs/MuxScopeValue"
|
|
636
|
+
},
|
|
637
|
+
"description": "The scope a member DID signs into a statement: a JSON array of MuxScopeValue, compared as a set — order is not significant and a repeated value collapses. It MUST NOT be empty; an empty signed scope is refused with the task's `emptyScope` code, never read as \"all\". Unlike MuxScope, emptiness is not a schema failure here, so that the refusal is reported per statement rather than failing the whole batch."
|
|
638
|
+
},
|
|
639
|
+
"MuxNonce": {
|
|
640
|
+
"title": "MuxNonce",
|
|
641
|
+
"type": "string",
|
|
642
|
+
"pattern": "^[A-Za-z0-9_-]{43}$",
|
|
643
|
+
"description": "32 random bytes, base64url without padding, that belong to exactly one connection and are never reused. Attach statements sign over it, which is what makes an attach statement unusable on any other connection."
|
|
644
|
+
},
|
|
645
|
+
"SessionId": {
|
|
646
|
+
"title": "SessionId",
|
|
647
|
+
"type": "string",
|
|
648
|
+
"minLength": 1,
|
|
649
|
+
"maxLength": 256,
|
|
650
|
+
"description": "The mediator's identifier for one authenticated connection, as announced in that connection's `ready` event."
|
|
651
|
+
}
|
|
652
|
+
}
|
|
653
|
+
} as const;
|
|
654
|
+
|
|
655
|
+
/**
|
|
656
|
+
* SPEC.md §7.2 policy for the request variant, from this specification's
|
|
657
|
+
* front matter. Pass to `consumeInbound` — items 5b, 7 and 8 are
|
|
658
|
+
* per-specification and cannot be derived from the document alone, and
|
|
659
|
+
* item 2 needs the schema this carries.
|
|
660
|
+
*/
|
|
661
|
+
export const SPEC = {
|
|
662
|
+
typeUri: TYPE_URI,
|
|
663
|
+
isBearer: false,
|
|
664
|
+
isProofRequired: true,
|
|
665
|
+
isRecipientRequired: true,
|
|
666
|
+
isIssuedAtRequired: true,
|
|
667
|
+
payloadSchema: PAYLOAD_SCHEMA,
|
|
668
|
+
} as const;
|
|
669
|
+
|
|
670
|
+
/**
|
|
671
|
+
* SPEC.md §7.2 policy for the success-response variant. `isRecipientRequired`
|
|
672
|
+
* tracks the *issuer* party's requirement because a response swaps the
|
|
673
|
+
* parties (§7.3 item 5).
|
|
674
|
+
*/
|
|
675
|
+
export const RESPONSE_SPEC = {
|
|
676
|
+
typeUri: RESPONSE_TYPE_URI,
|
|
677
|
+
isBearer: false,
|
|
678
|
+
isProofRequired: false,
|
|
679
|
+
isRecipientRequired: true,
|
|
680
|
+
isIssuedAtRequired: true,
|
|
681
|
+
payloadSchema: RESPONSE_PAYLOAD_SCHEMA,
|
|
682
|
+
} as const;
|