@openvtc/trust-tasks 0.16.6 → 0.16.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 +12 -2
- package/dist/_shared/components.d.ts +75 -0
- package/dist/_shared/components.d.ts.map +1 -1
- package/dist/index.d.ts +6 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +6 -0
- package/dist/index.js.map +1 -1
- package/dist/rooms/_shared/0.1/room.d.ts +16 -0
- package/dist/rooms/_shared/0.1/room.d.ts.map +1 -0
- package/dist/rooms/_shared/0.1/room.js +6 -0
- package/dist/rooms/_shared/0.1/room.js.map +1 -0
- package/dist/rooms/create/0.1/payload.d.ts +305 -0
- package/dist/rooms/create/0.1/payload.d.ts.map +1 -0
- package/dist/rooms/create/0.1/payload.js +176 -0
- package/dist/rooms/create/0.1/payload.js.map +1 -0
- package/dist/rooms/epoch/mint/0.1/payload.d.ts +385 -0
- package/dist/rooms/epoch/mint/0.1/payload.d.ts.map +1 -0
- package/dist/rooms/epoch/mint/0.1/payload.js +214 -0
- package/dist/rooms/epoch/mint/0.1/payload.js.map +1 -0
- package/dist/rooms/records/get/0.1/payload.d.ts +505 -0
- package/dist/rooms/records/get/0.1/payload.d.ts.map +1 -0
- package/dist/rooms/records/get/0.1/payload.js +279 -0
- package/dist/rooms/records/get/0.1/payload.js.map +1 -0
- package/dist/rooms/records/list/0.1/payload.d.ts +618 -0
- package/dist/rooms/records/list/0.1/payload.d.ts.map +1 -0
- package/dist/rooms/records/list/0.1/payload.js +338 -0
- package/dist/rooms/records/list/0.1/payload.js.map +1 -0
- package/dist/rooms/records/put/0.1/payload.d.ts +591 -0
- package/dist/rooms/records/put/0.1/payload.d.ts.map +1 -0
- package/dist/rooms/records/put/0.1/payload.js +314 -0
- package/dist/rooms/records/put/0.1/payload.js.map +1 -0
- package/package.json +1 -1
- package/src/_shared/components.ts +83 -0
- package/src/index.ts +6 -0
- package/src/rooms/_shared/0.1/room.ts +17 -0
- package/src/rooms/create/0.1/payload.ts +224 -0
- package/src/rooms/epoch/mint/0.1/payload.ts +262 -0
- package/src/rooms/records/get/0.1/payload.ts +333 -0
- package/src/rooms/records/list/0.1/payload.ts +397 -0
- package/src/rooms/records/put/0.1/payload.ts +388 -0
|
@@ -0,0 +1,224 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Generated by scripts/build-ts-bindings.mjs — DO NOT EDIT BY HAND.
|
|
3
|
+
* Source: specs/rooms/create/0.1/payload.schema.json
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
import type { Ext, Visibility } from "../../../_shared/components.js";
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
export interface RoomsCreatePayload {
|
|
10
|
+
/**
|
|
11
|
+
* The room's identifier, minted by its owner before this call. A host is told the identifier; it does not assign one, because a room whose identity the host chose could not move to another host.
|
|
12
|
+
*/
|
|
13
|
+
roomId: string;
|
|
14
|
+
visibility: Visibility;
|
|
15
|
+
/**
|
|
16
|
+
* The room's accountable party: the controller of the room's identifier, the issuer of every credential in it, and the party a host addresses about quota, abuse, or lifecycle. Visible at every visibility, including `private` — a room has someone answerable for it.
|
|
17
|
+
*/
|
|
18
|
+
ownerDid: string;
|
|
19
|
+
/**
|
|
20
|
+
* How long the host will hold the room after its epoch lapses without renewal, before storage may be reclaimed. Stated at creation rather than discovered: reclamation that surprises a member is a failure of the design, not of the member.
|
|
21
|
+
*/
|
|
22
|
+
retentionDays?: number;
|
|
23
|
+
/**
|
|
24
|
+
* Ecosystem-defined extension members per SPEC.md §4.5.1.
|
|
25
|
+
*/
|
|
26
|
+
ext?: Ext;
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Success response to rooms/create. Type https://trusttasks.org/spec/rooms/create/0.1#response.
|
|
30
|
+
*/
|
|
31
|
+
export interface RoomsCreateResponsePayload {
|
|
32
|
+
roomId: string;
|
|
33
|
+
/**
|
|
34
|
+
* Always 1 for a new room.
|
|
35
|
+
*/
|
|
36
|
+
epoch: number;
|
|
37
|
+
ext?: Ext;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
/** Shared definitions this specification references, re-exported under the names it used to declare them with. */
|
|
41
|
+
export type { Ext, Visibility };
|
|
42
|
+
|
|
43
|
+
/** Trust Task type URI. */
|
|
44
|
+
export const TYPE_URI = "https://trusttasks.org/spec/rooms/create/0.1" as const;
|
|
45
|
+
|
|
46
|
+
/** Stable alias for this specification's request payload shape. */
|
|
47
|
+
export type Payload = RoomsCreatePayload;
|
|
48
|
+
|
|
49
|
+
/** Trust Task response type URI (request type URI + "#response"). */
|
|
50
|
+
export const RESPONSE_TYPE_URI = "https://trusttasks.org/spec/rooms/create/0.1#response" as const;
|
|
51
|
+
|
|
52
|
+
/** Stable alias for this specification's success-response payload shape. */
|
|
53
|
+
export type Response = RoomsCreateResponsePayload;
|
|
54
|
+
|
|
55
|
+
/**
|
|
56
|
+
* This specification's payload schema, as a value.
|
|
57
|
+
*
|
|
58
|
+
* SPEC.md §7.2 item 2 is performed against this. It is shipped as data
|
|
59
|
+
* rather than only as a `.json` file because TypeScript types are erased
|
|
60
|
+
* at runtime: without a schema a consumer has nothing to validate, and
|
|
61
|
+
* every REQUIRED payload member is optional in practice. Cross-file
|
|
62
|
+
* `$ref`s are already inlined, so it needs no resolver.
|
|
63
|
+
*/
|
|
64
|
+
export const PAYLOAD_SCHEMA = {
|
|
65
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
66
|
+
"$id": "https://trusttasks.org/spec/rooms/create/0.1",
|
|
67
|
+
"title": "Rooms Create — payload",
|
|
68
|
+
"type": "object",
|
|
69
|
+
"additionalProperties": false,
|
|
70
|
+
"required": [
|
|
71
|
+
"roomId",
|
|
72
|
+
"visibility",
|
|
73
|
+
"ownerDid"
|
|
74
|
+
],
|
|
75
|
+
"properties": {
|
|
76
|
+
"roomId": {
|
|
77
|
+
"type": "string",
|
|
78
|
+
"description": "The room's identifier, minted by its owner before this call. A host is told the identifier; it does not assign one, because a room whose identity the host chose could not move to another host."
|
|
79
|
+
},
|
|
80
|
+
"visibility": {
|
|
81
|
+
"$ref": "#/$defs/Visibility"
|
|
82
|
+
},
|
|
83
|
+
"ownerDid": {
|
|
84
|
+
"type": "string",
|
|
85
|
+
"description": "The room's accountable party: the controller of the room's identifier, the issuer of every credential in it, and the party a host addresses about quota, abuse, or lifecycle. Visible at every visibility, including `private` — a room has someone answerable for it."
|
|
86
|
+
},
|
|
87
|
+
"retentionDays": {
|
|
88
|
+
"type": "integer",
|
|
89
|
+
"minimum": 1,
|
|
90
|
+
"description": "How long the host will hold the room after its epoch lapses without renewal, before storage may be reclaimed. Stated at creation rather than discovered: reclamation that surprises a member is a failure of the design, not of the member."
|
|
91
|
+
},
|
|
92
|
+
"ext": {
|
|
93
|
+
"$ref": "#/$defs/Ext",
|
|
94
|
+
"description": "Ecosystem-defined extension members per SPEC.md §4.5.1."
|
|
95
|
+
}
|
|
96
|
+
},
|
|
97
|
+
"$defs": {
|
|
98
|
+
"Response": {
|
|
99
|
+
"$anchor": "response",
|
|
100
|
+
"title": "Rooms Create — response payload",
|
|
101
|
+
"description": "Success response to rooms/create. Type https://trusttasks.org/spec/rooms/create/0.1#response.",
|
|
102
|
+
"type": "object",
|
|
103
|
+
"additionalProperties": false,
|
|
104
|
+
"required": [
|
|
105
|
+
"roomId",
|
|
106
|
+
"epoch"
|
|
107
|
+
],
|
|
108
|
+
"properties": {
|
|
109
|
+
"roomId": {
|
|
110
|
+
"type": "string"
|
|
111
|
+
},
|
|
112
|
+
"epoch": {
|
|
113
|
+
"type": "integer",
|
|
114
|
+
"minimum": 1,
|
|
115
|
+
"description": "Always 1 for a new room."
|
|
116
|
+
},
|
|
117
|
+
"ext": {
|
|
118
|
+
"$ref": "#/$defs/Ext"
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
},
|
|
122
|
+
"Ext": {
|
|
123
|
+
"title": "Ext",
|
|
124
|
+
"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.",
|
|
125
|
+
"type": "object",
|
|
126
|
+
"minProperties": 1,
|
|
127
|
+
"additionalProperties": true,
|
|
128
|
+
"propertyNames": {
|
|
129
|
+
"pattern": "^[a-z][a-z0-9-]*(\\.[a-z0-9-]+)+$"
|
|
130
|
+
}
|
|
131
|
+
},
|
|
132
|
+
"Visibility": {
|
|
133
|
+
"title": "Visibility",
|
|
134
|
+
"type": "string",
|
|
135
|
+
"enum": [
|
|
136
|
+
"open",
|
|
137
|
+
"attributed",
|
|
138
|
+
"private"
|
|
139
|
+
],
|
|
140
|
+
"description": "How much of a room its host can see, fixed at creation and immutable thereafter. `open`: records are cleartext, searchable and fully audited. `attributed`: record content is sealed, and the host still learns which member acted. `private`: content is sealed and membership is presented in zero knowledge, so the host verifies that a member acted without learning which. Immutable because a downgrade cannot un-see cleartext and an upgrade would protect only what came after while presenting as though it protected everything."
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
} as const;
|
|
144
|
+
|
|
145
|
+
/** As {@link PAYLOAD_SCHEMA}, for the success-response variant. */
|
|
146
|
+
export const RESPONSE_PAYLOAD_SCHEMA = {
|
|
147
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
148
|
+
"$ref": "#/$defs/Response",
|
|
149
|
+
"$defs": {
|
|
150
|
+
"Response": {
|
|
151
|
+
"$anchor": "response",
|
|
152
|
+
"title": "Rooms Create — response payload",
|
|
153
|
+
"description": "Success response to rooms/create. Type https://trusttasks.org/spec/rooms/create/0.1#response.",
|
|
154
|
+
"type": "object",
|
|
155
|
+
"additionalProperties": false,
|
|
156
|
+
"required": [
|
|
157
|
+
"roomId",
|
|
158
|
+
"epoch"
|
|
159
|
+
],
|
|
160
|
+
"properties": {
|
|
161
|
+
"roomId": {
|
|
162
|
+
"type": "string"
|
|
163
|
+
},
|
|
164
|
+
"epoch": {
|
|
165
|
+
"type": "integer",
|
|
166
|
+
"minimum": 1,
|
|
167
|
+
"description": "Always 1 for a new room."
|
|
168
|
+
},
|
|
169
|
+
"ext": {
|
|
170
|
+
"$ref": "#/$defs/Ext"
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
},
|
|
174
|
+
"Ext": {
|
|
175
|
+
"title": "Ext",
|
|
176
|
+
"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.",
|
|
177
|
+
"type": "object",
|
|
178
|
+
"minProperties": 1,
|
|
179
|
+
"additionalProperties": true,
|
|
180
|
+
"propertyNames": {
|
|
181
|
+
"pattern": "^[a-z][a-z0-9-]*(\\.[a-z0-9-]+)+$"
|
|
182
|
+
}
|
|
183
|
+
},
|
|
184
|
+
"Visibility": {
|
|
185
|
+
"title": "Visibility",
|
|
186
|
+
"type": "string",
|
|
187
|
+
"enum": [
|
|
188
|
+
"open",
|
|
189
|
+
"attributed",
|
|
190
|
+
"private"
|
|
191
|
+
],
|
|
192
|
+
"description": "How much of a room its host can see, fixed at creation and immutable thereafter. `open`: records are cleartext, searchable and fully audited. `attributed`: record content is sealed, and the host still learns which member acted. `private`: content is sealed and membership is presented in zero knowledge, so the host verifies that a member acted without learning which. Immutable because a downgrade cannot un-see cleartext and an upgrade would protect only what came after while presenting as though it protected everything."
|
|
193
|
+
}
|
|
194
|
+
}
|
|
195
|
+
} as const;
|
|
196
|
+
|
|
197
|
+
/**
|
|
198
|
+
* SPEC.md §7.2 policy for the request variant, from this specification's
|
|
199
|
+
* front matter. Pass to `consumeInbound` — items 5b, 7 and 8 are
|
|
200
|
+
* per-specification and cannot be derived from the document alone, and
|
|
201
|
+
* item 2 needs the schema this carries.
|
|
202
|
+
*/
|
|
203
|
+
export const SPEC = {
|
|
204
|
+
typeUri: TYPE_URI,
|
|
205
|
+
isBearer: false,
|
|
206
|
+
isProofRequired: true,
|
|
207
|
+
isRecipientRequired: true,
|
|
208
|
+
isIssuedAtRequired: true,
|
|
209
|
+
payloadSchema: PAYLOAD_SCHEMA,
|
|
210
|
+
} as const;
|
|
211
|
+
|
|
212
|
+
/**
|
|
213
|
+
* SPEC.md §7.2 policy for the success-response variant. `isRecipientRequired`
|
|
214
|
+
* tracks the *issuer* party's requirement because a response swaps the
|
|
215
|
+
* parties (§7.3 item 5).
|
|
216
|
+
*/
|
|
217
|
+
export const RESPONSE_SPEC = {
|
|
218
|
+
typeUri: RESPONSE_TYPE_URI,
|
|
219
|
+
isBearer: false,
|
|
220
|
+
isProofRequired: true,
|
|
221
|
+
isRecipientRequired: true,
|
|
222
|
+
isIssuedAtRequired: true,
|
|
223
|
+
payloadSchema: RESPONSE_PAYLOAD_SCHEMA,
|
|
224
|
+
} as const;
|
|
@@ -0,0 +1,262 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Generated by scripts/build-ts-bindings.mjs — DO NOT EDIT BY HAND.
|
|
3
|
+
* Source: specs/rooms/epoch/mint/0.1/payload.schema.json
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
import type { AuthorityPresentation, Ext } from "../../../../_shared/components.js";
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
export interface RoomsEpochMintPayload {
|
|
10
|
+
/**
|
|
11
|
+
* The room whose epoch advances.
|
|
12
|
+
*/
|
|
13
|
+
roomId: string;
|
|
14
|
+
/**
|
|
15
|
+
* The new epoch number, which MUST be exactly one greater than the current one. A host records the number and never learns the key.
|
|
16
|
+
*/
|
|
17
|
+
epoch: number;
|
|
18
|
+
/**
|
|
19
|
+
* Must confer the `admin` action at this room's scope. Restricting epoch minting matters: if any key-holder could mint one, any member could evict any other by declining to seal the new key to them — silently, and with no server-side check possible on a room whose membership the host cannot see.
|
|
20
|
+
*/
|
|
21
|
+
presentation: AuthorityPresentation;
|
|
22
|
+
/**
|
|
23
|
+
* Optional operator-facing rationale, recorded in the room's audit.
|
|
24
|
+
*/
|
|
25
|
+
reason?: string;
|
|
26
|
+
/**
|
|
27
|
+
* Ecosystem-defined extension members per SPEC.md §4.5.1.
|
|
28
|
+
*/
|
|
29
|
+
ext?: Ext;
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Success response to rooms/epoch/mint. Type https://trusttasks.org/spec/rooms/epoch/mint/0.1#response.
|
|
33
|
+
*/
|
|
34
|
+
export interface RoomsEpochMintResponsePayload {
|
|
35
|
+
roomId: string;
|
|
36
|
+
epoch: number;
|
|
37
|
+
ext?: Ext;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
/** Shared definitions this specification references, re-exported under the names it used to declare them with. */
|
|
41
|
+
export type { AuthorityPresentation, Ext };
|
|
42
|
+
|
|
43
|
+
/** Trust Task type URI. */
|
|
44
|
+
export const TYPE_URI = "https://trusttasks.org/spec/rooms/epoch/mint/0.1" as const;
|
|
45
|
+
|
|
46
|
+
/** Stable alias for this specification's request payload shape. */
|
|
47
|
+
export type Payload = RoomsEpochMintPayload;
|
|
48
|
+
|
|
49
|
+
/** Trust Task response type URI (request type URI + "#response"). */
|
|
50
|
+
export const RESPONSE_TYPE_URI = "https://trusttasks.org/spec/rooms/epoch/mint/0.1#response" as const;
|
|
51
|
+
|
|
52
|
+
/** Stable alias for this specification's success-response payload shape. */
|
|
53
|
+
export type Response = RoomsEpochMintResponsePayload;
|
|
54
|
+
|
|
55
|
+
/**
|
|
56
|
+
* This specification's payload schema, as a value.
|
|
57
|
+
*
|
|
58
|
+
* SPEC.md §7.2 item 2 is performed against this. It is shipped as data
|
|
59
|
+
* rather than only as a `.json` file because TypeScript types are erased
|
|
60
|
+
* at runtime: without a schema a consumer has nothing to validate, and
|
|
61
|
+
* every REQUIRED payload member is optional in practice. Cross-file
|
|
62
|
+
* `$ref`s are already inlined, so it needs no resolver.
|
|
63
|
+
*/
|
|
64
|
+
export const PAYLOAD_SCHEMA = {
|
|
65
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
66
|
+
"$id": "https://trusttasks.org/spec/rooms/epoch/mint/0.1",
|
|
67
|
+
"title": "Rooms Epoch Mint — payload",
|
|
68
|
+
"type": "object",
|
|
69
|
+
"additionalProperties": false,
|
|
70
|
+
"required": [
|
|
71
|
+
"roomId",
|
|
72
|
+
"epoch",
|
|
73
|
+
"presentation"
|
|
74
|
+
],
|
|
75
|
+
"properties": {
|
|
76
|
+
"roomId": {
|
|
77
|
+
"type": "string",
|
|
78
|
+
"description": "The room whose epoch advances."
|
|
79
|
+
},
|
|
80
|
+
"epoch": {
|
|
81
|
+
"type": "integer",
|
|
82
|
+
"minimum": 2,
|
|
83
|
+
"description": "The new epoch number, which MUST be exactly one greater than the current one. A host records the number and never learns the key."
|
|
84
|
+
},
|
|
85
|
+
"presentation": {
|
|
86
|
+
"$ref": "#/$defs/AuthorityPresentation",
|
|
87
|
+
"description": "Must confer the `admin` action at this room's scope. Restricting epoch minting matters: if any key-holder could mint one, any member could evict any other by declining to seal the new key to them — silently, and with no server-side check possible on a room whose membership the host cannot see."
|
|
88
|
+
},
|
|
89
|
+
"reason": {
|
|
90
|
+
"type": "string",
|
|
91
|
+
"maxLength": 1024,
|
|
92
|
+
"description": "Optional operator-facing rationale, recorded in the room's audit."
|
|
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 Epoch Mint — response payload",
|
|
103
|
+
"description": "Success response to rooms/epoch/mint. Type https://trusttasks.org/spec/rooms/epoch/mint/0.1#response.",
|
|
104
|
+
"type": "object",
|
|
105
|
+
"additionalProperties": false,
|
|
106
|
+
"required": [
|
|
107
|
+
"roomId",
|
|
108
|
+
"epoch"
|
|
109
|
+
],
|
|
110
|
+
"properties": {
|
|
111
|
+
"roomId": {
|
|
112
|
+
"type": "string"
|
|
113
|
+
},
|
|
114
|
+
"epoch": {
|
|
115
|
+
"type": "integer",
|
|
116
|
+
"minimum": 2
|
|
117
|
+
},
|
|
118
|
+
"ext": {
|
|
119
|
+
"$ref": "#/$defs/Ext"
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
},
|
|
123
|
+
"Ext": {
|
|
124
|
+
"title": "Ext",
|
|
125
|
+
"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.",
|
|
126
|
+
"type": "object",
|
|
127
|
+
"minProperties": 1,
|
|
128
|
+
"additionalProperties": true,
|
|
129
|
+
"propertyNames": {
|
|
130
|
+
"pattern": "^[a-z][a-z0-9-]*(\\.[a-z0-9-]+)+$"
|
|
131
|
+
}
|
|
132
|
+
},
|
|
133
|
+
"AuthorityPresentation": {
|
|
134
|
+
"title": "AuthorityPresentation",
|
|
135
|
+
"type": "object",
|
|
136
|
+
"additionalProperties": false,
|
|
137
|
+
"required": [
|
|
138
|
+
"membership",
|
|
139
|
+
"authority"
|
|
140
|
+
],
|
|
141
|
+
"description": "What a party presents to act on a room. Carries the whole authority chain: a host MUST NOT dereference an authority credential's `parent` to fetch a link it was not given. Resolving over the network would make verification depend on availability, turn every identifier into a request the host can be induced to make against an address the holder chooses, and signal credential use to whoever hosts the identifier.",
|
|
142
|
+
"properties": {
|
|
143
|
+
"membership": {
|
|
144
|
+
"type": "string",
|
|
145
|
+
"description": "The presenter's membership credential for this room, or — on a `private` room — a zero-knowledge presentation of it. Serialized per the governing profile."
|
|
146
|
+
},
|
|
147
|
+
"authority": {
|
|
148
|
+
"type": "array",
|
|
149
|
+
"minItems": 1,
|
|
150
|
+
"maxItems": 8,
|
|
151
|
+
"items": {
|
|
152
|
+
"type": "string"
|
|
153
|
+
},
|
|
154
|
+
"description": "The authority chain, LEAF FIRST: the first element is the credential being relied on and the last MUST be one issued by the room itself. Every link the presenter relies on is present, because the host will not fetch one. Capped at 8: verification is linear in chain length and runs on every operation, so an unbounded chain is a denial-of-service surface against the host. The known uses need 2 to 3 — a person attenuating to an agent, and that agent to a sub-agent."
|
|
155
|
+
},
|
|
156
|
+
"subjectBinding": {
|
|
157
|
+
"type": "string",
|
|
158
|
+
"description": "REQUIRED on a `private` room, where the subject identifier is withheld: a proof that the membership credential and the authority chain's leaf describe the SAME subject. Without it two parties pool credentials — one contributes membership, the other authority — and the combination verifies as a single party holding both. A host MUST refuse a private-room presentation that omits this."
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
} as const;
|
|
164
|
+
|
|
165
|
+
/** As {@link PAYLOAD_SCHEMA}, for the success-response variant. */
|
|
166
|
+
export const RESPONSE_PAYLOAD_SCHEMA = {
|
|
167
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
168
|
+
"$ref": "#/$defs/Response",
|
|
169
|
+
"$defs": {
|
|
170
|
+
"Response": {
|
|
171
|
+
"$anchor": "response",
|
|
172
|
+
"title": "Rooms Epoch Mint — response payload",
|
|
173
|
+
"description": "Success response to rooms/epoch/mint. Type https://trusttasks.org/spec/rooms/epoch/mint/0.1#response.",
|
|
174
|
+
"type": "object",
|
|
175
|
+
"additionalProperties": false,
|
|
176
|
+
"required": [
|
|
177
|
+
"roomId",
|
|
178
|
+
"epoch"
|
|
179
|
+
],
|
|
180
|
+
"properties": {
|
|
181
|
+
"roomId": {
|
|
182
|
+
"type": "string"
|
|
183
|
+
},
|
|
184
|
+
"epoch": {
|
|
185
|
+
"type": "integer",
|
|
186
|
+
"minimum": 2
|
|
187
|
+
},
|
|
188
|
+
"ext": {
|
|
189
|
+
"$ref": "#/$defs/Ext"
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
},
|
|
193
|
+
"Ext": {
|
|
194
|
+
"title": "Ext",
|
|
195
|
+
"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.",
|
|
196
|
+
"type": "object",
|
|
197
|
+
"minProperties": 1,
|
|
198
|
+
"additionalProperties": true,
|
|
199
|
+
"propertyNames": {
|
|
200
|
+
"pattern": "^[a-z][a-z0-9-]*(\\.[a-z0-9-]+)+$"
|
|
201
|
+
}
|
|
202
|
+
},
|
|
203
|
+
"AuthorityPresentation": {
|
|
204
|
+
"title": "AuthorityPresentation",
|
|
205
|
+
"type": "object",
|
|
206
|
+
"additionalProperties": false,
|
|
207
|
+
"required": [
|
|
208
|
+
"membership",
|
|
209
|
+
"authority"
|
|
210
|
+
],
|
|
211
|
+
"description": "What a party presents to act on a room. Carries the whole authority chain: a host MUST NOT dereference an authority credential's `parent` to fetch a link it was not given. Resolving over the network would make verification depend on availability, turn every identifier into a request the host can be induced to make against an address the holder chooses, and signal credential use to whoever hosts the identifier.",
|
|
212
|
+
"properties": {
|
|
213
|
+
"membership": {
|
|
214
|
+
"type": "string",
|
|
215
|
+
"description": "The presenter's membership credential for this room, or — on a `private` room — a zero-knowledge presentation of it. Serialized per the governing profile."
|
|
216
|
+
},
|
|
217
|
+
"authority": {
|
|
218
|
+
"type": "array",
|
|
219
|
+
"minItems": 1,
|
|
220
|
+
"maxItems": 8,
|
|
221
|
+
"items": {
|
|
222
|
+
"type": "string"
|
|
223
|
+
},
|
|
224
|
+
"description": "The authority chain, LEAF FIRST: the first element is the credential being relied on and the last MUST be one issued by the room itself. Every link the presenter relies on is present, because the host will not fetch one. Capped at 8: verification is linear in chain length and runs on every operation, so an unbounded chain is a denial-of-service surface against the host. The known uses need 2 to 3 — a person attenuating to an agent, and that agent to a sub-agent."
|
|
225
|
+
},
|
|
226
|
+
"subjectBinding": {
|
|
227
|
+
"type": "string",
|
|
228
|
+
"description": "REQUIRED on a `private` room, where the subject identifier is withheld: a proof that the membership credential and the authority chain's leaf describe the SAME subject. Without it two parties pool credentials — one contributes membership, the other authority — and the combination verifies as a single party holding both. A host MUST refuse a private-room presentation that omits this."
|
|
229
|
+
}
|
|
230
|
+
}
|
|
231
|
+
}
|
|
232
|
+
}
|
|
233
|
+
} as const;
|
|
234
|
+
|
|
235
|
+
/**
|
|
236
|
+
* SPEC.md §7.2 policy for the request variant, from this specification's
|
|
237
|
+
* front matter. Pass to `consumeInbound` — items 5b, 7 and 8 are
|
|
238
|
+
* per-specification and cannot be derived from the document alone, and
|
|
239
|
+
* item 2 needs the schema this carries.
|
|
240
|
+
*/
|
|
241
|
+
export const SPEC = {
|
|
242
|
+
typeUri: TYPE_URI,
|
|
243
|
+
isBearer: false,
|
|
244
|
+
isProofRequired: true,
|
|
245
|
+
isRecipientRequired: true,
|
|
246
|
+
isIssuedAtRequired: true,
|
|
247
|
+
payloadSchema: PAYLOAD_SCHEMA,
|
|
248
|
+
} as const;
|
|
249
|
+
|
|
250
|
+
/**
|
|
251
|
+
* SPEC.md §7.2 policy for the success-response variant. `isRecipientRequired`
|
|
252
|
+
* tracks the *issuer* party's requirement because a response swaps the
|
|
253
|
+
* parties (§7.3 item 5).
|
|
254
|
+
*/
|
|
255
|
+
export const RESPONSE_SPEC = {
|
|
256
|
+
typeUri: RESPONSE_TYPE_URI,
|
|
257
|
+
isBearer: false,
|
|
258
|
+
isProofRequired: true,
|
|
259
|
+
isRecipientRequired: true,
|
|
260
|
+
isIssuedAtRequired: true,
|
|
261
|
+
payloadSchema: RESPONSE_PAYLOAD_SCHEMA,
|
|
262
|
+
} as const;
|