@openvtc/trust-tasks 0.17.5 → 0.17.7
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 +141 -0
- package/dist/_shared/components.d.ts +4 -0
- package/dist/_shared/components.d.ts.map +1 -1
- package/dist/auth/step-up/approve-response/0.3/payload.d.ts +887 -0
- package/dist/auth/step-up/approve-response/0.3/payload.d.ts.map +1 -0
- package/dist/auth/step-up/approve-response/0.3/payload.js +505 -0
- package/dist/auth/step-up/approve-response/0.3/payload.js.map +1 -0
- package/dist/index.d.ts +8 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +8 -0
- package/dist/index.js.map +1 -1
- package/dist/persona/claim-types/list/1.0/payload.d.ts +772 -0
- package/dist/persona/claim-types/list/1.0/payload.d.ts.map +1 -0
- package/dist/persona/claim-types/list/1.0/payload.js +389 -0
- package/dist/persona/claim-types/list/1.0/payload.js.map +1 -0
- package/dist/rooms/_shared/0.1/room.d.ts +1 -1
- package/dist/rooms/_shared/0.1/room.d.ts.map +1 -1
- package/dist/rooms/create/0.1/payload.d.ts +42 -2
- package/dist/rooms/create/0.1/payload.d.ts.map +1 -1
- package/dist/rooms/create/0.1/payload.js +24 -0
- package/dist/rooms/create/0.1/payload.js.map +1 -1
- package/dist/rooms/keys/chain/0.1/payload.d.ts +382 -0
- package/dist/rooms/keys/chain/0.1/payload.d.ts.map +1 -0
- package/dist/rooms/keys/chain/0.1/payload.js +213 -0
- package/dist/rooms/keys/chain/0.1/payload.js.map +1 -0
- package/dist/rooms/keys/list/0.1/payload.d.ts +314 -0
- package/dist/rooms/keys/list/0.1/payload.d.ts.map +1 -0
- package/dist/rooms/keys/list/0.1/payload.js +175 -0
- package/dist/rooms/keys/list/0.1/payload.js.map +1 -0
- package/dist/rooms/keys/seal/0.1/payload.d.ts +352 -0
- package/dist/rooms/keys/seal/0.1/payload.d.ts.map +1 -0
- package/dist/rooms/keys/seal/0.1/payload.js +199 -0
- package/dist/rooms/keys/seal/0.1/payload.js.map +1 -0
- package/dist/rooms/owner/invite/0.1/payload.d.ts +291 -0
- package/dist/rooms/owner/invite/0.1/payload.d.ts.map +1 -0
- package/dist/rooms/owner/invite/0.1/payload.js +158 -0
- package/dist/rooms/owner/invite/0.1/payload.js.map +1 -0
- package/dist/rooms/owner/issue-authority/0.1/payload.d.ts +315 -0
- package/dist/rooms/owner/issue-authority/0.1/payload.d.ts.map +1 -0
- package/dist/rooms/owner/issue-authority/0.1/payload.js +173 -0
- package/dist/rooms/owner/issue-authority/0.1/payload.js.map +1 -0
- package/dist/rooms/owner/issue-membership/0.1/payload.d.ts +291 -0
- package/dist/rooms/owner/issue-membership/0.1/payload.d.ts.map +1 -0
- package/dist/rooms/owner/issue-membership/0.1/payload.js +158 -0
- package/dist/rooms/owner/issue-membership/0.1/payload.js.map +1 -0
- package/package.json +1 -1
- package/src/_shared/components.ts +4 -0
- package/src/auth/step-up/approve-response/0.3/payload.ts +594 -0
- package/src/index.ts +8 -0
- package/src/persona/claim-types/list/1.0/payload.ts +590 -0
- package/src/rooms/_shared/0.1/room.ts +1 -1
- package/src/rooms/create/0.1/payload.ts +30 -2
- package/src/rooms/keys/chain/0.1/payload.ts +262 -0
- package/src/rooms/keys/list/0.1/payload.ts +222 -0
- package/src/rooms/keys/seal/0.1/payload.ts +246 -0
- package/src/rooms/owner/invite/0.1/payload.ts +212 -0
- package/src/rooms/owner/issue-authority/0.1/payload.ts +233 -0
- package/src/rooms/owner/issue-membership/0.1/payload.ts +212 -0
|
@@ -0,0 +1,246 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Generated by scripts/build-ts-bindings.mjs — DO NOT EDIT BY HAND.
|
|
3
|
+
* Source: specs/rooms/keys/seal/0.1/payload.schema.json
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
import type { Ext, SealedRecord } from "../../../../_shared/components.js";
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
export interface RoomsKeysSealPayload {
|
|
10
|
+
/**
|
|
11
|
+
* The room to seal for. The recipient MUST hold group state for it.
|
|
12
|
+
*/
|
|
13
|
+
roomId: string;
|
|
14
|
+
/**
|
|
15
|
+
* The record key this will be stored under. Bound into the associated data, so a record sealed for one key does not open under another. On a sealed tier keys MUST be opaque — a descriptive key defeats the encryption beside it, and structured naming belongs inside the sealed body.
|
|
16
|
+
*/
|
|
17
|
+
key: string;
|
|
18
|
+
/**
|
|
19
|
+
* The version the writer INTENDS the record to take, bound into the associated data before the host assigns it. A caller that lets the host assign a different one will find the record does not open, which is the correct failure: accepting whatever came back would mean the binding commits to nothing. The shape that works is a create-only write (`expectedVersion: 0`) or a read of the current version before a rewrite.
|
|
20
|
+
*/
|
|
21
|
+
version: number;
|
|
22
|
+
/**
|
|
23
|
+
* The record body to seal, base64url. Sealed whole rather than field by field: splitting it would let a host learn the shape of the material from ciphertext lengths, for no benefit, since a reader decrypts the whole record either way.
|
|
24
|
+
*/
|
|
25
|
+
plaintext: string;
|
|
26
|
+
/**
|
|
27
|
+
* Ecosystem-defined extension members per SPEC.md §4.5.1.
|
|
28
|
+
*/
|
|
29
|
+
ext?: Ext;
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Success response to rooms/keys/seal. Type https://trusttasks.org/spec/rooms/keys/seal/0.1#response. The sealed record, ready to hand to a host with rooms/records/put.
|
|
33
|
+
*/
|
|
34
|
+
export interface RoomsKeysSealResponsePayload {
|
|
35
|
+
sealed: SealedRecord;
|
|
36
|
+
ext?: Ext;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
/** Shared definitions this specification references, re-exported under the names it used to declare them with. */
|
|
40
|
+
export type { Ext, SealedRecord };
|
|
41
|
+
|
|
42
|
+
/** Trust Task type URI. */
|
|
43
|
+
export const TYPE_URI = "https://trusttasks.org/spec/rooms/keys/seal/0.1" as const;
|
|
44
|
+
|
|
45
|
+
/** Stable alias for this specification's request payload shape. */
|
|
46
|
+
export type Payload = RoomsKeysSealPayload;
|
|
47
|
+
|
|
48
|
+
/** Trust Task response type URI (request type URI + "#response"). */
|
|
49
|
+
export const RESPONSE_TYPE_URI = "https://trusttasks.org/spec/rooms/keys/seal/0.1#response" as const;
|
|
50
|
+
|
|
51
|
+
/** Stable alias for this specification's success-response payload shape. */
|
|
52
|
+
export type Response = RoomsKeysSealResponsePayload;
|
|
53
|
+
|
|
54
|
+
/**
|
|
55
|
+
* This specification's payload schema, as a value.
|
|
56
|
+
*
|
|
57
|
+
* SPEC.md §7.2 item 2 is performed against this. It is shipped as data
|
|
58
|
+
* rather than only as a `.json` file because TypeScript types are erased
|
|
59
|
+
* at runtime: without a schema a consumer has nothing to validate, and
|
|
60
|
+
* every REQUIRED payload member is optional in practice. Cross-file
|
|
61
|
+
* `$ref`s are already inlined, so it needs no resolver.
|
|
62
|
+
*/
|
|
63
|
+
export const PAYLOAD_SCHEMA = {
|
|
64
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
65
|
+
"$id": "https://trusttasks.org/spec/rooms/keys/seal/0.1",
|
|
66
|
+
"title": "Rooms Keys Seal — payload",
|
|
67
|
+
"type": "object",
|
|
68
|
+
"additionalProperties": false,
|
|
69
|
+
"required": [
|
|
70
|
+
"roomId",
|
|
71
|
+
"key",
|
|
72
|
+
"version",
|
|
73
|
+
"plaintext"
|
|
74
|
+
],
|
|
75
|
+
"properties": {
|
|
76
|
+
"roomId": {
|
|
77
|
+
"type": "string",
|
|
78
|
+
"description": "The room to seal for. The recipient MUST hold group state for it."
|
|
79
|
+
},
|
|
80
|
+
"key": {
|
|
81
|
+
"type": "string",
|
|
82
|
+
"maxLength": 512,
|
|
83
|
+
"description": "The record key this will be stored under. Bound into the associated data, so a record sealed for one key does not open under another. On a sealed tier keys MUST be opaque — a descriptive key defeats the encryption beside it, and structured naming belongs inside the sealed body."
|
|
84
|
+
},
|
|
85
|
+
"version": {
|
|
86
|
+
"type": "integer",
|
|
87
|
+
"minimum": 0,
|
|
88
|
+
"description": "The version the writer INTENDS the record to take, bound into the associated data before the host assigns it. A caller that lets the host assign a different one will find the record does not open, which is the correct failure: accepting whatever came back would mean the binding commits to nothing. The shape that works is a create-only write (`expectedVersion: 0`) or a read of the current version before a rewrite."
|
|
89
|
+
},
|
|
90
|
+
"plaintext": {
|
|
91
|
+
"type": "string",
|
|
92
|
+
"description": "The record body to seal, base64url. Sealed whole rather than field by field: splitting it would let a host learn the shape of the material from ciphertext lengths, for no benefit, since a reader decrypts the whole record either way."
|
|
93
|
+
},
|
|
94
|
+
"ext": {
|
|
95
|
+
"$ref": "#/$defs/Ext",
|
|
96
|
+
"description": "Ecosystem-defined extension members per SPEC.md §4.5.1."
|
|
97
|
+
}
|
|
98
|
+
},
|
|
99
|
+
"$defs": {
|
|
100
|
+
"Response": {
|
|
101
|
+
"$anchor": "response",
|
|
102
|
+
"title": "Rooms Keys Seal — response payload",
|
|
103
|
+
"description": "Success response to rooms/keys/seal. Type https://trusttasks.org/spec/rooms/keys/seal/0.1#response. The sealed record, ready to hand to a host with rooms/records/put.",
|
|
104
|
+
"type": "object",
|
|
105
|
+
"additionalProperties": false,
|
|
106
|
+
"required": [
|
|
107
|
+
"sealed"
|
|
108
|
+
],
|
|
109
|
+
"properties": {
|
|
110
|
+
"sealed": {
|
|
111
|
+
"$ref": "#/$defs/SealedRecord"
|
|
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
|
+
"SealedRecord": {
|
|
129
|
+
"title": "SealedRecord",
|
|
130
|
+
"type": "object",
|
|
131
|
+
"additionalProperties": false,
|
|
132
|
+
"required": [
|
|
133
|
+
"ciphertext",
|
|
134
|
+
"nonce",
|
|
135
|
+
"epoch"
|
|
136
|
+
],
|
|
137
|
+
"description": "A record as a host stores it on an `attributed` or `private` room. Title, description, body, author and tags are sealed together in one blob rather than separately: splitting them would let a host learn the shape of the material from ciphertext lengths, for no benefit, since a reader decrypts the whole record either way.",
|
|
138
|
+
"properties": {
|
|
139
|
+
"ciphertext": {
|
|
140
|
+
"type": "string",
|
|
141
|
+
"description": "The sealed record, base64url. Bound by AEAD associated data to `roomId`, `key`, `version` and `epoch`, so a host that relocates it to another key, version, epoch or room produces a mismatch and the open fails. The record cannot be moved undetected even though the host holds every byte of it."
|
|
142
|
+
},
|
|
143
|
+
"nonce": {
|
|
144
|
+
"type": "string",
|
|
145
|
+
"description": "AEAD nonce, base64url."
|
|
146
|
+
},
|
|
147
|
+
"epoch": {
|
|
148
|
+
"type": "integer",
|
|
149
|
+
"minimum": 1,
|
|
150
|
+
"description": "The key epoch this record was sealed under. Cleartext because the host must serve the right ciphertext, and bound into the associated data so that relabelling it fails authentication rather than causing a reader to try the wrong key."
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
} as const;
|
|
156
|
+
|
|
157
|
+
/** As {@link PAYLOAD_SCHEMA}, for the success-response variant. */
|
|
158
|
+
export const RESPONSE_PAYLOAD_SCHEMA = {
|
|
159
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
160
|
+
"$ref": "#/$defs/Response",
|
|
161
|
+
"$defs": {
|
|
162
|
+
"Response": {
|
|
163
|
+
"$anchor": "response",
|
|
164
|
+
"title": "Rooms Keys Seal — response payload",
|
|
165
|
+
"description": "Success response to rooms/keys/seal. Type https://trusttasks.org/spec/rooms/keys/seal/0.1#response. The sealed record, ready to hand to a host with rooms/records/put.",
|
|
166
|
+
"type": "object",
|
|
167
|
+
"additionalProperties": false,
|
|
168
|
+
"required": [
|
|
169
|
+
"sealed"
|
|
170
|
+
],
|
|
171
|
+
"properties": {
|
|
172
|
+
"sealed": {
|
|
173
|
+
"$ref": "#/$defs/SealedRecord"
|
|
174
|
+
},
|
|
175
|
+
"ext": {
|
|
176
|
+
"$ref": "#/$defs/Ext"
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
},
|
|
180
|
+
"Ext": {
|
|
181
|
+
"title": "Ext",
|
|
182
|
+
"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.",
|
|
183
|
+
"type": "object",
|
|
184
|
+
"minProperties": 1,
|
|
185
|
+
"additionalProperties": true,
|
|
186
|
+
"propertyNames": {
|
|
187
|
+
"pattern": "^[a-z][a-z0-9-]*(\\.[a-z0-9-]+)+$"
|
|
188
|
+
}
|
|
189
|
+
},
|
|
190
|
+
"SealedRecord": {
|
|
191
|
+
"title": "SealedRecord",
|
|
192
|
+
"type": "object",
|
|
193
|
+
"additionalProperties": false,
|
|
194
|
+
"required": [
|
|
195
|
+
"ciphertext",
|
|
196
|
+
"nonce",
|
|
197
|
+
"epoch"
|
|
198
|
+
],
|
|
199
|
+
"description": "A record as a host stores it on an `attributed` or `private` room. Title, description, body, author and tags are sealed together in one blob rather than separately: splitting them would let a host learn the shape of the material from ciphertext lengths, for no benefit, since a reader decrypts the whole record either way.",
|
|
200
|
+
"properties": {
|
|
201
|
+
"ciphertext": {
|
|
202
|
+
"type": "string",
|
|
203
|
+
"description": "The sealed record, base64url. Bound by AEAD associated data to `roomId`, `key`, `version` and `epoch`, so a host that relocates it to another key, version, epoch or room produces a mismatch and the open fails. The record cannot be moved undetected even though the host holds every byte of it."
|
|
204
|
+
},
|
|
205
|
+
"nonce": {
|
|
206
|
+
"type": "string",
|
|
207
|
+
"description": "AEAD nonce, base64url."
|
|
208
|
+
},
|
|
209
|
+
"epoch": {
|
|
210
|
+
"type": "integer",
|
|
211
|
+
"minimum": 1,
|
|
212
|
+
"description": "The key epoch this record was sealed under. Cleartext because the host must serve the right ciphertext, and bound into the associated data so that relabelling it fails authentication rather than causing a reader to try the wrong key."
|
|
213
|
+
}
|
|
214
|
+
}
|
|
215
|
+
}
|
|
216
|
+
}
|
|
217
|
+
} as const;
|
|
218
|
+
|
|
219
|
+
/**
|
|
220
|
+
* SPEC.md §7.2 policy for the request variant, from this specification's
|
|
221
|
+
* front matter. Pass to `consumeInbound` — items 5b, 7 and 8 are
|
|
222
|
+
* per-specification and cannot be derived from the document alone, and
|
|
223
|
+
* item 2 needs the schema this carries.
|
|
224
|
+
*/
|
|
225
|
+
export const SPEC = {
|
|
226
|
+
typeUri: TYPE_URI,
|
|
227
|
+
isBearer: false,
|
|
228
|
+
isProofRequired: true,
|
|
229
|
+
isRecipientRequired: true,
|
|
230
|
+
isIssuedAtRequired: true,
|
|
231
|
+
payloadSchema: PAYLOAD_SCHEMA,
|
|
232
|
+
} as const;
|
|
233
|
+
|
|
234
|
+
/**
|
|
235
|
+
* SPEC.md §7.2 policy for the success-response variant. `isRecipientRequired`
|
|
236
|
+
* tracks the *issuer* party's requirement because a response swaps the
|
|
237
|
+
* parties (§7.3 item 5).
|
|
238
|
+
*/
|
|
239
|
+
export const RESPONSE_SPEC = {
|
|
240
|
+
typeUri: RESPONSE_TYPE_URI,
|
|
241
|
+
isBearer: false,
|
|
242
|
+
isProofRequired: true,
|
|
243
|
+
isRecipientRequired: true,
|
|
244
|
+
isIssuedAtRequired: true,
|
|
245
|
+
payloadSchema: RESPONSE_PAYLOAD_SCHEMA,
|
|
246
|
+
} as const;
|
|
@@ -0,0 +1,212 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Generated by scripts/build-ts-bindings.mjs — DO NOT EDIT BY HAND.
|
|
3
|
+
* Source: specs/rooms/owner/invite/0.1/payload.schema.json
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
import type { Ext } from "../../../../_shared/components.js";
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
export interface RoomsOwnerInvitePayload {
|
|
10
|
+
/**
|
|
11
|
+
* The room whose identity issues this credential. The recipient MUST hold a signing key for it — it is signing AS the room, not as itself.
|
|
12
|
+
*/
|
|
13
|
+
roomId: string;
|
|
14
|
+
/**
|
|
15
|
+
* Which held key signs. Named explicitly rather than looked up from `roomId`, because nothing maps a DID to a key it was minted with and inventing that mapping would add a lifecycle to get wrong. A key that is not the room's produces a credential that fails to verify against the room's DID document — loud, and at the first use rather than later.
|
|
16
|
+
*/
|
|
17
|
+
signingKeyId: string;
|
|
18
|
+
/**
|
|
19
|
+
* Ecosystem-defined extension members per SPEC.md §4.5.1.
|
|
20
|
+
*/
|
|
21
|
+
ext?: Ext;
|
|
22
|
+
/**
|
|
23
|
+
* The party being invited. Named in the credential, which is why a VIC is single-use and why it is not presented on every access: presenting one would disclose the member.
|
|
24
|
+
*/
|
|
25
|
+
subject: string;
|
|
26
|
+
/**
|
|
27
|
+
* When the invitation expires. An invitation that never expires is a standing right to enter, held by whoever ends up with the bytes.
|
|
28
|
+
*/
|
|
29
|
+
validUntil?: string;
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Success response to rooms/owner/invite. Type https://trusttasks.org/spec/rooms/owner/invite/0.1#response. The signed VIC, for delivery to the invitee.
|
|
33
|
+
*/
|
|
34
|
+
export interface RoomsOwnerInviteResponsePayload {
|
|
35
|
+
/**
|
|
36
|
+
* The signed Verifiable Invitation Credential, serialised.
|
|
37
|
+
*/
|
|
38
|
+
credential: string;
|
|
39
|
+
/**
|
|
40
|
+
* Its `id`. The owner tracks consumption by this on a `private` room, where a host-side invitation store would hand the host the membership at invite time.
|
|
41
|
+
*/
|
|
42
|
+
credentialId: string;
|
|
43
|
+
ext?: Ext;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
/** Shared definitions this specification references, re-exported under the names it used to declare them with. */
|
|
47
|
+
export type { Ext };
|
|
48
|
+
|
|
49
|
+
/** Trust Task type URI. */
|
|
50
|
+
export const TYPE_URI = "https://trusttasks.org/spec/rooms/owner/invite/0.1" as const;
|
|
51
|
+
|
|
52
|
+
/** Stable alias for this specification's request payload shape. */
|
|
53
|
+
export type Payload = RoomsOwnerInvitePayload;
|
|
54
|
+
|
|
55
|
+
/** Trust Task response type URI (request type URI + "#response"). */
|
|
56
|
+
export const RESPONSE_TYPE_URI = "https://trusttasks.org/spec/rooms/owner/invite/0.1#response" as const;
|
|
57
|
+
|
|
58
|
+
/** Stable alias for this specification's success-response payload shape. */
|
|
59
|
+
export type Response = RoomsOwnerInviteResponsePayload;
|
|
60
|
+
|
|
61
|
+
/**
|
|
62
|
+
* This specification's payload schema, as a value.
|
|
63
|
+
*
|
|
64
|
+
* SPEC.md §7.2 item 2 is performed against this. It is shipped as data
|
|
65
|
+
* rather than only as a `.json` file because TypeScript types are erased
|
|
66
|
+
* at runtime: without a schema a consumer has nothing to validate, and
|
|
67
|
+
* every REQUIRED payload member is optional in practice. Cross-file
|
|
68
|
+
* `$ref`s are already inlined, so it needs no resolver.
|
|
69
|
+
*/
|
|
70
|
+
export const PAYLOAD_SCHEMA = {
|
|
71
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
72
|
+
"$id": "https://trusttasks.org/spec/rooms/owner/invite/0.1",
|
|
73
|
+
"title": "Rooms Owner Invite — payload",
|
|
74
|
+
"type": "object",
|
|
75
|
+
"additionalProperties": false,
|
|
76
|
+
"required": [
|
|
77
|
+
"roomId",
|
|
78
|
+
"signingKeyId",
|
|
79
|
+
"subject"
|
|
80
|
+
],
|
|
81
|
+
"properties": {
|
|
82
|
+
"roomId": {
|
|
83
|
+
"type": "string",
|
|
84
|
+
"description": "The room whose identity issues this credential. The recipient MUST hold a signing key for it — it is signing AS the room, not as itself."
|
|
85
|
+
},
|
|
86
|
+
"signingKeyId": {
|
|
87
|
+
"type": "string",
|
|
88
|
+
"maxLength": 256,
|
|
89
|
+
"description": "Which held key signs. Named explicitly rather than looked up from `roomId`, because nothing maps a DID to a key it was minted with and inventing that mapping would add a lifecycle to get wrong. A key that is not the room's produces a credential that fails to verify against the room's DID document — loud, and at the first use rather than later."
|
|
90
|
+
},
|
|
91
|
+
"ext": {
|
|
92
|
+
"$ref": "#/$defs/Ext",
|
|
93
|
+
"description": "Ecosystem-defined extension members per SPEC.md §4.5.1."
|
|
94
|
+
},
|
|
95
|
+
"subject": {
|
|
96
|
+
"type": "string",
|
|
97
|
+
"description": "The party being invited. Named in the credential, which is why a VIC is single-use and why it is not presented on every access: presenting one would disclose the member."
|
|
98
|
+
},
|
|
99
|
+
"validUntil": {
|
|
100
|
+
"type": "string",
|
|
101
|
+
"format": "date-time",
|
|
102
|
+
"description": "When the invitation expires. An invitation that never expires is a standing right to enter, held by whoever ends up with the bytes."
|
|
103
|
+
}
|
|
104
|
+
},
|
|
105
|
+
"$defs": {
|
|
106
|
+
"Response": {
|
|
107
|
+
"$anchor": "response",
|
|
108
|
+
"title": "Rooms Owner Invite — response payload",
|
|
109
|
+
"description": "Success response to rooms/owner/invite. Type https://trusttasks.org/spec/rooms/owner/invite/0.1#response. The signed VIC, for delivery to the invitee.",
|
|
110
|
+
"type": "object",
|
|
111
|
+
"additionalProperties": false,
|
|
112
|
+
"required": [
|
|
113
|
+
"credential",
|
|
114
|
+
"credentialId"
|
|
115
|
+
],
|
|
116
|
+
"properties": {
|
|
117
|
+
"credential": {
|
|
118
|
+
"type": "string",
|
|
119
|
+
"description": "The signed Verifiable Invitation Credential, serialised."
|
|
120
|
+
},
|
|
121
|
+
"credentialId": {
|
|
122
|
+
"type": "string",
|
|
123
|
+
"description": "Its `id`. The owner tracks consumption by this on a `private` room, where a host-side invitation store would hand the host the membership at invite time."
|
|
124
|
+
},
|
|
125
|
+
"ext": {
|
|
126
|
+
"$ref": "#/$defs/Ext"
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
},
|
|
130
|
+
"Ext": {
|
|
131
|
+
"title": "Ext",
|
|
132
|
+
"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.",
|
|
133
|
+
"type": "object",
|
|
134
|
+
"minProperties": 1,
|
|
135
|
+
"additionalProperties": true,
|
|
136
|
+
"propertyNames": {
|
|
137
|
+
"pattern": "^[a-z][a-z0-9-]*(\\.[a-z0-9-]+)+$"
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
} as const;
|
|
142
|
+
|
|
143
|
+
/** As {@link PAYLOAD_SCHEMA}, for the success-response variant. */
|
|
144
|
+
export const RESPONSE_PAYLOAD_SCHEMA = {
|
|
145
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
146
|
+
"$ref": "#/$defs/Response",
|
|
147
|
+
"$defs": {
|
|
148
|
+
"Response": {
|
|
149
|
+
"$anchor": "response",
|
|
150
|
+
"title": "Rooms Owner Invite — response payload",
|
|
151
|
+
"description": "Success response to rooms/owner/invite. Type https://trusttasks.org/spec/rooms/owner/invite/0.1#response. The signed VIC, for delivery to the invitee.",
|
|
152
|
+
"type": "object",
|
|
153
|
+
"additionalProperties": false,
|
|
154
|
+
"required": [
|
|
155
|
+
"credential",
|
|
156
|
+
"credentialId"
|
|
157
|
+
],
|
|
158
|
+
"properties": {
|
|
159
|
+
"credential": {
|
|
160
|
+
"type": "string",
|
|
161
|
+
"description": "The signed Verifiable Invitation Credential, serialised."
|
|
162
|
+
},
|
|
163
|
+
"credentialId": {
|
|
164
|
+
"type": "string",
|
|
165
|
+
"description": "Its `id`. The owner tracks consumption by this on a `private` room, where a host-side invitation store would hand the host the membership at invite time."
|
|
166
|
+
},
|
|
167
|
+
"ext": {
|
|
168
|
+
"$ref": "#/$defs/Ext"
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
},
|
|
172
|
+
"Ext": {
|
|
173
|
+
"title": "Ext",
|
|
174
|
+
"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.",
|
|
175
|
+
"type": "object",
|
|
176
|
+
"minProperties": 1,
|
|
177
|
+
"additionalProperties": true,
|
|
178
|
+
"propertyNames": {
|
|
179
|
+
"pattern": "^[a-z][a-z0-9-]*(\\.[a-z0-9-]+)+$"
|
|
180
|
+
}
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
} as const;
|
|
184
|
+
|
|
185
|
+
/**
|
|
186
|
+
* SPEC.md §7.2 policy for the request variant, from this specification's
|
|
187
|
+
* front matter. Pass to `consumeInbound` — items 5b, 7 and 8 are
|
|
188
|
+
* per-specification and cannot be derived from the document alone, and
|
|
189
|
+
* item 2 needs the schema this carries.
|
|
190
|
+
*/
|
|
191
|
+
export const SPEC = {
|
|
192
|
+
typeUri: TYPE_URI,
|
|
193
|
+
isBearer: false,
|
|
194
|
+
isProofRequired: true,
|
|
195
|
+
isRecipientRequired: true,
|
|
196
|
+
isIssuedAtRequired: true,
|
|
197
|
+
payloadSchema: PAYLOAD_SCHEMA,
|
|
198
|
+
} as const;
|
|
199
|
+
|
|
200
|
+
/**
|
|
201
|
+
* SPEC.md §7.2 policy for the success-response variant. `isRecipientRequired`
|
|
202
|
+
* tracks the *issuer* party's requirement because a response swaps the
|
|
203
|
+
* parties (§7.3 item 5).
|
|
204
|
+
*/
|
|
205
|
+
export const RESPONSE_SPEC = {
|
|
206
|
+
typeUri: RESPONSE_TYPE_URI,
|
|
207
|
+
isBearer: false,
|
|
208
|
+
isProofRequired: true,
|
|
209
|
+
isRecipientRequired: true,
|
|
210
|
+
isIssuedAtRequired: true,
|
|
211
|
+
payloadSchema: RESPONSE_PAYLOAD_SCHEMA,
|
|
212
|
+
} as const;
|