@openvtc/trust-tasks 0.16.7 → 0.16.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 +8 -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/rooms/keys/open/0.1/payload.d.ts +323 -0
- package/dist/rooms/keys/open/0.1/payload.d.ts.map +1 -0
- package/dist/rooms/keys/open/0.1/payload.js +171 -0
- package/dist/rooms/keys/open/0.1/payload.js.map +1 -0
- package/dist/rooms/keys/present/0.1/payload.d.ts +306 -0
- package/dist/rooms/keys/present/0.1/payload.d.ts.map +1 -0
- package/dist/rooms/keys/present/0.1/payload.js +165 -0
- package/dist/rooms/keys/present/0.1/payload.js.map +1 -0
- package/dist/vta/backup/abort/1.0/payload.d.ts +262 -0
- package/dist/vta/backup/abort/1.0/payload.d.ts.map +1 -0
- package/dist/vta/backup/abort/1.0/payload.js +146 -0
- package/dist/vta/backup/abort/1.0/payload.js.map +1 -0
- package/dist/vta/backup/complete-export/1.0/payload.d.ts +262 -0
- package/dist/vta/backup/complete-export/1.0/payload.d.ts.map +1 -0
- package/dist/vta/backup/complete-export/1.0/payload.js +146 -0
- package/dist/vta/backup/complete-export/1.0/payload.js.map +1 -0
- package/dist/vta/backup/finalize-import/1.0/payload.d.ts +477 -0
- package/dist/vta/backup/finalize-import/1.0/payload.d.ts.map +1 -0
- package/dist/vta/backup/finalize-import/1.0/payload.js +249 -0
- package/dist/vta/backup/finalize-import/1.0/payload.js.map +1 -0
- package/dist/vta/backup/initiate-export/1.0/payload.d.ts +514 -0
- package/dist/vta/backup/initiate-export/1.0/payload.d.ts.map +1 -0
- package/dist/vta/backup/initiate-export/1.0/payload.js +267 -0
- package/dist/vta/backup/initiate-export/1.0/payload.js.map +1 -0
- package/dist/vta/backup/initiate-import/1.0/payload.d.ts +510 -0
- package/dist/vta/backup/initiate-import/1.0/payload.d.ts.map +1 -0
- package/dist/vta/backup/initiate-import/1.0/payload.js +266 -0
- package/dist/vta/backup/initiate-import/1.0/payload.js.map +1 -0
- package/dist/vta/management/reload-services/1.0/payload.d.ts +230 -0
- package/dist/vta/management/reload-services/1.0/payload.d.ts.map +1 -0
- package/dist/vta/management/reload-services/1.0/payload.js +130 -0
- package/dist/vta/management/reload-services/1.0/payload.js.map +1 -0
- package/package.json +1 -1
- package/src/index.ts +8 -0
- package/src/rooms/keys/open/0.1/payload.ts +237 -0
- package/src/rooms/keys/present/0.1/payload.ts +224 -0
- package/src/vta/backup/abort/1.0/payload.ts +191 -0
- package/src/vta/backup/complete-export/1.0/payload.ts +191 -0
- package/src/vta/backup/finalize-import/1.0/payload.ts +333 -0
- package/src/vta/backup/initiate-export/1.0/payload.ts +350 -0
- package/src/vta/backup/initiate-import/1.0/payload.ts +349 -0
- package/src/vta/management/reload-services/1.0/payload.ts +167 -0
|
@@ -0,0 +1,510 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Generated by scripts/build-ts-bindings.mjs — DO NOT EDIT BY HAND.
|
|
3
|
+
* Source: specs/vta/backup/initiate-import/1.0/payload.schema.json
|
|
4
|
+
*/
|
|
5
|
+
import type { Ext } from "../../../../_shared/components.js";
|
|
6
|
+
/**
|
|
7
|
+
* Asks the recipient to open a slot for an encrypted bundle the producer is about to upload, pre-committing the digest and size so the transfer is verifiable. The outer document members (id, type, issuer, recipient, issuedAt, expiresAt, proof) are owned by the framework — SPEC §6.3.
|
|
8
|
+
*/
|
|
9
|
+
export interface VTABackupInitiateImportPayload {
|
|
10
|
+
/**
|
|
11
|
+
* Lowercase hex SHA-256 of the bytes about to be uploaded, committed before the upload begins. The recipient refuses a stream that hashes differently, which is what bounds the damage from a leaked write token. A wire-integrity check only: it says the bytes that arrived are the bytes that were sent, and nothing about whether they are worth applying.
|
|
12
|
+
*/
|
|
13
|
+
expectedSha256: string;
|
|
14
|
+
/**
|
|
15
|
+
* Byte count of the upload. Lets the recipient size the slot and refuse a truncated or oversized transfer without hashing it first. A zero-length bundle is not a degenerate case — there is nothing to import — so the floor is 1.
|
|
16
|
+
*/
|
|
17
|
+
expectedSizeBytes: number;
|
|
18
|
+
/**
|
|
19
|
+
* Requested transport mechanism — how the bytes move, not how they are encrypted. `stream` is the only value this version defines and is what an absent member means. Deliberately not an enum, so a recipient offering more can be asked for it without a specification revision; one that does not implement the request refuses with unsupportedAlgorithm.
|
|
20
|
+
*/
|
|
21
|
+
algorithm?: string;
|
|
22
|
+
/**
|
|
23
|
+
* Ecosystem-defined extension members per SPEC.md §4.5.1.
|
|
24
|
+
*/
|
|
25
|
+
ext?: Ext;
|
|
26
|
+
}
|
|
27
|
+
export interface VTABackupInitiateImportResponsePayload {
|
|
28
|
+
descriptor: BundleDescriptor;
|
|
29
|
+
/**
|
|
30
|
+
* Operator-facing text describing how to complete the upload. Advisory: a producer must not parse it or derive behaviour from it, and a recipient must not put a secret in it.
|
|
31
|
+
*/
|
|
32
|
+
completionHint?: string;
|
|
33
|
+
/**
|
|
34
|
+
* Ecosystem-defined extension members per SPEC.md §4.5.1.
|
|
35
|
+
*/
|
|
36
|
+
ext?: Ext;
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Where to write the bytes, on what terms, and until when.
|
|
40
|
+
*/
|
|
41
|
+
export interface BundleDescriptor {
|
|
42
|
+
/**
|
|
43
|
+
* Handle for this bundle across its whole lifecycle. Quoted back by finalize-import and abort. Recipient-generated and unguessable, which is what lets an unauthorized reference be answered as not-found without confirming existence.
|
|
44
|
+
*/
|
|
45
|
+
bundleId: string;
|
|
46
|
+
/**
|
|
47
|
+
* The mechanism actually used, which is authoritative over what was requested.
|
|
48
|
+
*/
|
|
49
|
+
algorithm: string;
|
|
50
|
+
/**
|
|
51
|
+
* Where to write the bytes. Write-only: a recipient must not serve staged bytes back from this address, or a leaked token becomes a read of the operator's bundle. A recipient with no address at which it is reachable cannot produce this and refuses with transportUnavailable.
|
|
52
|
+
*/
|
|
53
|
+
transportUrl: string;
|
|
54
|
+
/**
|
|
55
|
+
* Bearer credential for transportUrl, presented in the X-Backup-Token header. Minted per bundle and never reused. A recipient should store only a hash of it. Leaking it lets a third party fill the slot; expectedSha256 is what bounds that to a failed transfer rather than a staged substitution.
|
|
56
|
+
*/
|
|
57
|
+
transportToken: string;
|
|
58
|
+
/**
|
|
59
|
+
* Echoed from the request, so the descriptor stands alone as the terms of the transfer.
|
|
60
|
+
*/
|
|
61
|
+
expectedSha256: string;
|
|
62
|
+
/**
|
|
63
|
+
* Echoed from the request, so the descriptor stands alone as the terms of the transfer.
|
|
64
|
+
*/
|
|
65
|
+
expectedSizeBytes: number;
|
|
66
|
+
/**
|
|
67
|
+
* After which the slot closes, the token is refused, and any staged bytes are discarded unread. Short by design: the window is how long a writable endpoint into the agent exists.
|
|
68
|
+
*/
|
|
69
|
+
expiresAt: string;
|
|
70
|
+
}
|
|
71
|
+
/** Shared definitions this specification references, re-exported under the names it used to declare them with. */
|
|
72
|
+
export type { Ext };
|
|
73
|
+
/** Trust Task type URI. */
|
|
74
|
+
export declare const TYPE_URI: "https://trusttasks.org/spec/vta/backup/initiate-import/1.0";
|
|
75
|
+
/** Stable alias for this specification's request payload shape. */
|
|
76
|
+
export type Payload = VTABackupInitiateImportPayload;
|
|
77
|
+
/** Trust Task response type URI (request type URI + "#response"). */
|
|
78
|
+
export declare const RESPONSE_TYPE_URI: "https://trusttasks.org/spec/vta/backup/initiate-import/1.0#response";
|
|
79
|
+
/** Stable alias for this specification's success-response payload shape. */
|
|
80
|
+
export type Response = VTABackupInitiateImportResponsePayload;
|
|
81
|
+
/**
|
|
82
|
+
* This specification's payload schema, as a value.
|
|
83
|
+
*
|
|
84
|
+
* SPEC.md §7.2 item 2 is performed against this. It is shipped as data
|
|
85
|
+
* rather than only as a `.json` file because TypeScript types are erased
|
|
86
|
+
* at runtime: without a schema a consumer has nothing to validate, and
|
|
87
|
+
* every REQUIRED payload member is optional in practice. Cross-file
|
|
88
|
+
* `$ref`s are already inlined, so it needs no resolver.
|
|
89
|
+
*/
|
|
90
|
+
export declare const PAYLOAD_SCHEMA: {
|
|
91
|
+
readonly $schema: "https://json-schema.org/draft/2020-12/schema";
|
|
92
|
+
readonly $id: "https://trusttasks.org/spec/vta/backup/initiate-import/1.0";
|
|
93
|
+
readonly title: "VTA Backup — Initiate Import — payload";
|
|
94
|
+
readonly description: "Asks the recipient to open a slot for an encrypted bundle the producer is about to upload, pre-committing the digest and size so the transfer is verifiable. The outer document members (id, type, issuer, recipient, issuedAt, expiresAt, proof) are owned by the framework — SPEC §6.3.";
|
|
95
|
+
readonly type: "object";
|
|
96
|
+
readonly additionalProperties: false;
|
|
97
|
+
readonly required: readonly ["expectedSha256", "expectedSizeBytes"];
|
|
98
|
+
readonly properties: {
|
|
99
|
+
readonly expectedSha256: {
|
|
100
|
+
readonly type: "string";
|
|
101
|
+
readonly pattern: "^[0-9a-f]{64}$";
|
|
102
|
+
readonly description: "Lowercase hex SHA-256 of the bytes about to be uploaded, committed before the upload begins. The recipient refuses a stream that hashes differently, which is what bounds the damage from a leaked write token. A wire-integrity check only: it says the bytes that arrived are the bytes that were sent, and nothing about whether they are worth applying.";
|
|
103
|
+
};
|
|
104
|
+
readonly expectedSizeBytes: {
|
|
105
|
+
readonly type: "integer";
|
|
106
|
+
readonly minimum: 1;
|
|
107
|
+
readonly description: "Byte count of the upload. Lets the recipient size the slot and refuse a truncated or oversized transfer without hashing it first. A zero-length bundle is not a degenerate case — there is nothing to import — so the floor is 1.";
|
|
108
|
+
};
|
|
109
|
+
readonly algorithm: {
|
|
110
|
+
readonly type: "string";
|
|
111
|
+
readonly minLength: 1;
|
|
112
|
+
readonly maxLength: 64;
|
|
113
|
+
readonly description: "Requested transport mechanism — how the bytes move, not how they are encrypted. `stream` is the only value this version defines and is what an absent member means. Deliberately not an enum, so a recipient offering more can be asked for it without a specification revision; one that does not implement the request refuses with unsupportedAlgorithm.";
|
|
114
|
+
};
|
|
115
|
+
readonly ext: {
|
|
116
|
+
readonly $ref: "#/$defs/Ext";
|
|
117
|
+
readonly description: "Ecosystem-defined extension members per SPEC.md §4.5.1.";
|
|
118
|
+
};
|
|
119
|
+
};
|
|
120
|
+
readonly $defs: {
|
|
121
|
+
readonly Response: {
|
|
122
|
+
readonly $anchor: "response";
|
|
123
|
+
readonly title: "VTA Backup Initiate Import — response payload";
|
|
124
|
+
readonly type: "object";
|
|
125
|
+
readonly additionalProperties: false;
|
|
126
|
+
readonly required: readonly ["descriptor"];
|
|
127
|
+
readonly properties: {
|
|
128
|
+
readonly descriptor: {
|
|
129
|
+
readonly $ref: "#/$defs/BundleDescriptor";
|
|
130
|
+
readonly description: "Where to write the bytes, on what terms, and until when.";
|
|
131
|
+
};
|
|
132
|
+
readonly completionHint: {
|
|
133
|
+
readonly type: "string";
|
|
134
|
+
readonly maxLength: 1024;
|
|
135
|
+
readonly description: "Operator-facing text describing how to complete the upload. Advisory: a producer must not parse it or derive behaviour from it, and a recipient must not put a secret in it.";
|
|
136
|
+
};
|
|
137
|
+
readonly ext: {
|
|
138
|
+
readonly $ref: "#/$defs/Ext";
|
|
139
|
+
readonly description: "Ecosystem-defined extension members per SPEC.md §4.5.1.";
|
|
140
|
+
};
|
|
141
|
+
};
|
|
142
|
+
};
|
|
143
|
+
readonly BundleDescriptor: {
|
|
144
|
+
readonly title: "Bundle descriptor";
|
|
145
|
+
readonly type: "object";
|
|
146
|
+
readonly additionalProperties: false;
|
|
147
|
+
readonly description: "The control-plane account of an out-of-band byte transfer. Shared in shape with initiate-export, where it describes a download rather than an upload.";
|
|
148
|
+
readonly required: readonly ["bundleId", "algorithm", "transportUrl", "transportToken", "expectedSha256", "expectedSizeBytes", "expiresAt"];
|
|
149
|
+
readonly properties: {
|
|
150
|
+
readonly bundleId: {
|
|
151
|
+
readonly type: "string";
|
|
152
|
+
readonly pattern: "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$";
|
|
153
|
+
readonly description: "Handle for this bundle across its whole lifecycle. Quoted back by finalize-import and abort. Recipient-generated and unguessable, which is what lets an unauthorized reference be answered as not-found without confirming existence.";
|
|
154
|
+
};
|
|
155
|
+
readonly algorithm: {
|
|
156
|
+
readonly type: "string";
|
|
157
|
+
readonly minLength: 1;
|
|
158
|
+
readonly maxLength: 64;
|
|
159
|
+
readonly description: "The mechanism actually used, which is authoritative over what was requested.";
|
|
160
|
+
};
|
|
161
|
+
readonly transportUrl: {
|
|
162
|
+
readonly type: "string";
|
|
163
|
+
readonly format: "uri";
|
|
164
|
+
readonly maxLength: 2048;
|
|
165
|
+
readonly description: "Where to write the bytes. Write-only: a recipient must not serve staged bytes back from this address, or a leaked token becomes a read of the operator's bundle. A recipient with no address at which it is reachable cannot produce this and refuses with transportUnavailable.";
|
|
166
|
+
};
|
|
167
|
+
readonly transportToken: {
|
|
168
|
+
readonly type: "string";
|
|
169
|
+
readonly minLength: 1;
|
|
170
|
+
readonly maxLength: 1024;
|
|
171
|
+
readonly description: "Bearer credential for transportUrl, presented in the X-Backup-Token header. Minted per bundle and never reused. A recipient should store only a hash of it. Leaking it lets a third party fill the slot; expectedSha256 is what bounds that to a failed transfer rather than a staged substitution.";
|
|
172
|
+
};
|
|
173
|
+
readonly expectedSha256: {
|
|
174
|
+
readonly type: "string";
|
|
175
|
+
readonly pattern: "^[0-9a-f]{64}$";
|
|
176
|
+
readonly description: "Echoed from the request, so the descriptor stands alone as the terms of the transfer.";
|
|
177
|
+
};
|
|
178
|
+
readonly expectedSizeBytes: {
|
|
179
|
+
readonly type: "integer";
|
|
180
|
+
readonly minimum: 1;
|
|
181
|
+
readonly description: "Echoed from the request, so the descriptor stands alone as the terms of the transfer.";
|
|
182
|
+
};
|
|
183
|
+
readonly expiresAt: {
|
|
184
|
+
readonly type: "string";
|
|
185
|
+
readonly format: "date-time";
|
|
186
|
+
readonly description: "After which the slot closes, the token is refused, and any staged bytes are discarded unread. Short by design: the window is how long a writable endpoint into the agent exists.";
|
|
187
|
+
};
|
|
188
|
+
};
|
|
189
|
+
};
|
|
190
|
+
readonly Ext: {
|
|
191
|
+
readonly title: "Ext";
|
|
192
|
+
readonly 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.";
|
|
193
|
+
readonly type: "object";
|
|
194
|
+
readonly minProperties: 1;
|
|
195
|
+
readonly additionalProperties: true;
|
|
196
|
+
readonly propertyNames: {
|
|
197
|
+
readonly pattern: "^[a-z][a-z0-9-]*(\\.[a-z0-9-]+)+$";
|
|
198
|
+
};
|
|
199
|
+
};
|
|
200
|
+
};
|
|
201
|
+
};
|
|
202
|
+
/** As {@link PAYLOAD_SCHEMA}, for the success-response variant. */
|
|
203
|
+
export declare const RESPONSE_PAYLOAD_SCHEMA: {
|
|
204
|
+
readonly $schema: "https://json-schema.org/draft/2020-12/schema";
|
|
205
|
+
readonly $ref: "#/$defs/Response";
|
|
206
|
+
readonly $defs: {
|
|
207
|
+
readonly Response: {
|
|
208
|
+
readonly $anchor: "response";
|
|
209
|
+
readonly title: "VTA Backup Initiate Import — response payload";
|
|
210
|
+
readonly type: "object";
|
|
211
|
+
readonly additionalProperties: false;
|
|
212
|
+
readonly required: readonly ["descriptor"];
|
|
213
|
+
readonly properties: {
|
|
214
|
+
readonly descriptor: {
|
|
215
|
+
readonly $ref: "#/$defs/BundleDescriptor";
|
|
216
|
+
readonly description: "Where to write the bytes, on what terms, and until when.";
|
|
217
|
+
};
|
|
218
|
+
readonly completionHint: {
|
|
219
|
+
readonly type: "string";
|
|
220
|
+
readonly maxLength: 1024;
|
|
221
|
+
readonly description: "Operator-facing text describing how to complete the upload. Advisory: a producer must not parse it or derive behaviour from it, and a recipient must not put a secret in it.";
|
|
222
|
+
};
|
|
223
|
+
readonly ext: {
|
|
224
|
+
readonly $ref: "#/$defs/Ext";
|
|
225
|
+
readonly description: "Ecosystem-defined extension members per SPEC.md §4.5.1.";
|
|
226
|
+
};
|
|
227
|
+
};
|
|
228
|
+
};
|
|
229
|
+
readonly BundleDescriptor: {
|
|
230
|
+
readonly title: "Bundle descriptor";
|
|
231
|
+
readonly type: "object";
|
|
232
|
+
readonly additionalProperties: false;
|
|
233
|
+
readonly description: "The control-plane account of an out-of-band byte transfer. Shared in shape with initiate-export, where it describes a download rather than an upload.";
|
|
234
|
+
readonly required: readonly ["bundleId", "algorithm", "transportUrl", "transportToken", "expectedSha256", "expectedSizeBytes", "expiresAt"];
|
|
235
|
+
readonly properties: {
|
|
236
|
+
readonly bundleId: {
|
|
237
|
+
readonly type: "string";
|
|
238
|
+
readonly pattern: "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$";
|
|
239
|
+
readonly description: "Handle for this bundle across its whole lifecycle. Quoted back by finalize-import and abort. Recipient-generated and unguessable, which is what lets an unauthorized reference be answered as not-found without confirming existence.";
|
|
240
|
+
};
|
|
241
|
+
readonly algorithm: {
|
|
242
|
+
readonly type: "string";
|
|
243
|
+
readonly minLength: 1;
|
|
244
|
+
readonly maxLength: 64;
|
|
245
|
+
readonly description: "The mechanism actually used, which is authoritative over what was requested.";
|
|
246
|
+
};
|
|
247
|
+
readonly transportUrl: {
|
|
248
|
+
readonly type: "string";
|
|
249
|
+
readonly format: "uri";
|
|
250
|
+
readonly maxLength: 2048;
|
|
251
|
+
readonly description: "Where to write the bytes. Write-only: a recipient must not serve staged bytes back from this address, or a leaked token becomes a read of the operator's bundle. A recipient with no address at which it is reachable cannot produce this and refuses with transportUnavailable.";
|
|
252
|
+
};
|
|
253
|
+
readonly transportToken: {
|
|
254
|
+
readonly type: "string";
|
|
255
|
+
readonly minLength: 1;
|
|
256
|
+
readonly maxLength: 1024;
|
|
257
|
+
readonly description: "Bearer credential for transportUrl, presented in the X-Backup-Token header. Minted per bundle and never reused. A recipient should store only a hash of it. Leaking it lets a third party fill the slot; expectedSha256 is what bounds that to a failed transfer rather than a staged substitution.";
|
|
258
|
+
};
|
|
259
|
+
readonly expectedSha256: {
|
|
260
|
+
readonly type: "string";
|
|
261
|
+
readonly pattern: "^[0-9a-f]{64}$";
|
|
262
|
+
readonly description: "Echoed from the request, so the descriptor stands alone as the terms of the transfer.";
|
|
263
|
+
};
|
|
264
|
+
readonly expectedSizeBytes: {
|
|
265
|
+
readonly type: "integer";
|
|
266
|
+
readonly minimum: 1;
|
|
267
|
+
readonly description: "Echoed from the request, so the descriptor stands alone as the terms of the transfer.";
|
|
268
|
+
};
|
|
269
|
+
readonly expiresAt: {
|
|
270
|
+
readonly type: "string";
|
|
271
|
+
readonly format: "date-time";
|
|
272
|
+
readonly description: "After which the slot closes, the token is refused, and any staged bytes are discarded unread. Short by design: the window is how long a writable endpoint into the agent exists.";
|
|
273
|
+
};
|
|
274
|
+
};
|
|
275
|
+
};
|
|
276
|
+
readonly Ext: {
|
|
277
|
+
readonly title: "Ext";
|
|
278
|
+
readonly 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.";
|
|
279
|
+
readonly type: "object";
|
|
280
|
+
readonly minProperties: 1;
|
|
281
|
+
readonly additionalProperties: true;
|
|
282
|
+
readonly propertyNames: {
|
|
283
|
+
readonly pattern: "^[a-z][a-z0-9-]*(\\.[a-z0-9-]+)+$";
|
|
284
|
+
};
|
|
285
|
+
};
|
|
286
|
+
};
|
|
287
|
+
};
|
|
288
|
+
/**
|
|
289
|
+
* SPEC.md §7.2 policy for the request variant, from this specification's
|
|
290
|
+
* front matter. Pass to `consumeInbound` — items 5b, 7 and 8 are
|
|
291
|
+
* per-specification and cannot be derived from the document alone, and
|
|
292
|
+
* item 2 needs the schema this carries.
|
|
293
|
+
*/
|
|
294
|
+
export declare const SPEC: {
|
|
295
|
+
readonly typeUri: "https://trusttasks.org/spec/vta/backup/initiate-import/1.0";
|
|
296
|
+
readonly isBearer: false;
|
|
297
|
+
readonly isProofRequired: true;
|
|
298
|
+
readonly isRecipientRequired: true;
|
|
299
|
+
readonly isIssuedAtRequired: true;
|
|
300
|
+
readonly payloadSchema: {
|
|
301
|
+
readonly $schema: "https://json-schema.org/draft/2020-12/schema";
|
|
302
|
+
readonly $id: "https://trusttasks.org/spec/vta/backup/initiate-import/1.0";
|
|
303
|
+
readonly title: "VTA Backup — Initiate Import — payload";
|
|
304
|
+
readonly description: "Asks the recipient to open a slot for an encrypted bundle the producer is about to upload, pre-committing the digest and size so the transfer is verifiable. The outer document members (id, type, issuer, recipient, issuedAt, expiresAt, proof) are owned by the framework — SPEC §6.3.";
|
|
305
|
+
readonly type: "object";
|
|
306
|
+
readonly additionalProperties: false;
|
|
307
|
+
readonly required: readonly ["expectedSha256", "expectedSizeBytes"];
|
|
308
|
+
readonly properties: {
|
|
309
|
+
readonly expectedSha256: {
|
|
310
|
+
readonly type: "string";
|
|
311
|
+
readonly pattern: "^[0-9a-f]{64}$";
|
|
312
|
+
readonly description: "Lowercase hex SHA-256 of the bytes about to be uploaded, committed before the upload begins. The recipient refuses a stream that hashes differently, which is what bounds the damage from a leaked write token. A wire-integrity check only: it says the bytes that arrived are the bytes that were sent, and nothing about whether they are worth applying.";
|
|
313
|
+
};
|
|
314
|
+
readonly expectedSizeBytes: {
|
|
315
|
+
readonly type: "integer";
|
|
316
|
+
readonly minimum: 1;
|
|
317
|
+
readonly description: "Byte count of the upload. Lets the recipient size the slot and refuse a truncated or oversized transfer without hashing it first. A zero-length bundle is not a degenerate case — there is nothing to import — so the floor is 1.";
|
|
318
|
+
};
|
|
319
|
+
readonly algorithm: {
|
|
320
|
+
readonly type: "string";
|
|
321
|
+
readonly minLength: 1;
|
|
322
|
+
readonly maxLength: 64;
|
|
323
|
+
readonly description: "Requested transport mechanism — how the bytes move, not how they are encrypted. `stream` is the only value this version defines and is what an absent member means. Deliberately not an enum, so a recipient offering more can be asked for it without a specification revision; one that does not implement the request refuses with unsupportedAlgorithm.";
|
|
324
|
+
};
|
|
325
|
+
readonly ext: {
|
|
326
|
+
readonly $ref: "#/$defs/Ext";
|
|
327
|
+
readonly description: "Ecosystem-defined extension members per SPEC.md §4.5.1.";
|
|
328
|
+
};
|
|
329
|
+
};
|
|
330
|
+
readonly $defs: {
|
|
331
|
+
readonly Response: {
|
|
332
|
+
readonly $anchor: "response";
|
|
333
|
+
readonly title: "VTA Backup Initiate Import — response payload";
|
|
334
|
+
readonly type: "object";
|
|
335
|
+
readonly additionalProperties: false;
|
|
336
|
+
readonly required: readonly ["descriptor"];
|
|
337
|
+
readonly properties: {
|
|
338
|
+
readonly descriptor: {
|
|
339
|
+
readonly $ref: "#/$defs/BundleDescriptor";
|
|
340
|
+
readonly description: "Where to write the bytes, on what terms, and until when.";
|
|
341
|
+
};
|
|
342
|
+
readonly completionHint: {
|
|
343
|
+
readonly type: "string";
|
|
344
|
+
readonly maxLength: 1024;
|
|
345
|
+
readonly description: "Operator-facing text describing how to complete the upload. Advisory: a producer must not parse it or derive behaviour from it, and a recipient must not put a secret in it.";
|
|
346
|
+
};
|
|
347
|
+
readonly ext: {
|
|
348
|
+
readonly $ref: "#/$defs/Ext";
|
|
349
|
+
readonly description: "Ecosystem-defined extension members per SPEC.md §4.5.1.";
|
|
350
|
+
};
|
|
351
|
+
};
|
|
352
|
+
};
|
|
353
|
+
readonly BundleDescriptor: {
|
|
354
|
+
readonly title: "Bundle descriptor";
|
|
355
|
+
readonly type: "object";
|
|
356
|
+
readonly additionalProperties: false;
|
|
357
|
+
readonly description: "The control-plane account of an out-of-band byte transfer. Shared in shape with initiate-export, where it describes a download rather than an upload.";
|
|
358
|
+
readonly required: readonly ["bundleId", "algorithm", "transportUrl", "transportToken", "expectedSha256", "expectedSizeBytes", "expiresAt"];
|
|
359
|
+
readonly properties: {
|
|
360
|
+
readonly bundleId: {
|
|
361
|
+
readonly type: "string";
|
|
362
|
+
readonly pattern: "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$";
|
|
363
|
+
readonly description: "Handle for this bundle across its whole lifecycle. Quoted back by finalize-import and abort. Recipient-generated and unguessable, which is what lets an unauthorized reference be answered as not-found without confirming existence.";
|
|
364
|
+
};
|
|
365
|
+
readonly algorithm: {
|
|
366
|
+
readonly type: "string";
|
|
367
|
+
readonly minLength: 1;
|
|
368
|
+
readonly maxLength: 64;
|
|
369
|
+
readonly description: "The mechanism actually used, which is authoritative over what was requested.";
|
|
370
|
+
};
|
|
371
|
+
readonly transportUrl: {
|
|
372
|
+
readonly type: "string";
|
|
373
|
+
readonly format: "uri";
|
|
374
|
+
readonly maxLength: 2048;
|
|
375
|
+
readonly description: "Where to write the bytes. Write-only: a recipient must not serve staged bytes back from this address, or a leaked token becomes a read of the operator's bundle. A recipient with no address at which it is reachable cannot produce this and refuses with transportUnavailable.";
|
|
376
|
+
};
|
|
377
|
+
readonly transportToken: {
|
|
378
|
+
readonly type: "string";
|
|
379
|
+
readonly minLength: 1;
|
|
380
|
+
readonly maxLength: 1024;
|
|
381
|
+
readonly description: "Bearer credential for transportUrl, presented in the X-Backup-Token header. Minted per bundle and never reused. A recipient should store only a hash of it. Leaking it lets a third party fill the slot; expectedSha256 is what bounds that to a failed transfer rather than a staged substitution.";
|
|
382
|
+
};
|
|
383
|
+
readonly expectedSha256: {
|
|
384
|
+
readonly type: "string";
|
|
385
|
+
readonly pattern: "^[0-9a-f]{64}$";
|
|
386
|
+
readonly description: "Echoed from the request, so the descriptor stands alone as the terms of the transfer.";
|
|
387
|
+
};
|
|
388
|
+
readonly expectedSizeBytes: {
|
|
389
|
+
readonly type: "integer";
|
|
390
|
+
readonly minimum: 1;
|
|
391
|
+
readonly description: "Echoed from the request, so the descriptor stands alone as the terms of the transfer.";
|
|
392
|
+
};
|
|
393
|
+
readonly expiresAt: {
|
|
394
|
+
readonly type: "string";
|
|
395
|
+
readonly format: "date-time";
|
|
396
|
+
readonly description: "After which the slot closes, the token is refused, and any staged bytes are discarded unread. Short by design: the window is how long a writable endpoint into the agent exists.";
|
|
397
|
+
};
|
|
398
|
+
};
|
|
399
|
+
};
|
|
400
|
+
readonly Ext: {
|
|
401
|
+
readonly title: "Ext";
|
|
402
|
+
readonly 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.";
|
|
403
|
+
readonly type: "object";
|
|
404
|
+
readonly minProperties: 1;
|
|
405
|
+
readonly additionalProperties: true;
|
|
406
|
+
readonly propertyNames: {
|
|
407
|
+
readonly pattern: "^[a-z][a-z0-9-]*(\\.[a-z0-9-]+)+$";
|
|
408
|
+
};
|
|
409
|
+
};
|
|
410
|
+
};
|
|
411
|
+
};
|
|
412
|
+
};
|
|
413
|
+
/**
|
|
414
|
+
* SPEC.md §7.2 policy for the success-response variant. `isRecipientRequired`
|
|
415
|
+
* tracks the *issuer* party's requirement because a response swaps the
|
|
416
|
+
* parties (§7.3 item 5).
|
|
417
|
+
*/
|
|
418
|
+
export declare const RESPONSE_SPEC: {
|
|
419
|
+
readonly typeUri: "https://trusttasks.org/spec/vta/backup/initiate-import/1.0#response";
|
|
420
|
+
readonly isBearer: false;
|
|
421
|
+
readonly isProofRequired: true;
|
|
422
|
+
readonly isRecipientRequired: true;
|
|
423
|
+
readonly isIssuedAtRequired: true;
|
|
424
|
+
readonly payloadSchema: {
|
|
425
|
+
readonly $schema: "https://json-schema.org/draft/2020-12/schema";
|
|
426
|
+
readonly $ref: "#/$defs/Response";
|
|
427
|
+
readonly $defs: {
|
|
428
|
+
readonly Response: {
|
|
429
|
+
readonly $anchor: "response";
|
|
430
|
+
readonly title: "VTA Backup Initiate Import — response payload";
|
|
431
|
+
readonly type: "object";
|
|
432
|
+
readonly additionalProperties: false;
|
|
433
|
+
readonly required: readonly ["descriptor"];
|
|
434
|
+
readonly properties: {
|
|
435
|
+
readonly descriptor: {
|
|
436
|
+
readonly $ref: "#/$defs/BundleDescriptor";
|
|
437
|
+
readonly description: "Where to write the bytes, on what terms, and until when.";
|
|
438
|
+
};
|
|
439
|
+
readonly completionHint: {
|
|
440
|
+
readonly type: "string";
|
|
441
|
+
readonly maxLength: 1024;
|
|
442
|
+
readonly description: "Operator-facing text describing how to complete the upload. Advisory: a producer must not parse it or derive behaviour from it, and a recipient must not put a secret in it.";
|
|
443
|
+
};
|
|
444
|
+
readonly ext: {
|
|
445
|
+
readonly $ref: "#/$defs/Ext";
|
|
446
|
+
readonly description: "Ecosystem-defined extension members per SPEC.md §4.5.1.";
|
|
447
|
+
};
|
|
448
|
+
};
|
|
449
|
+
};
|
|
450
|
+
readonly BundleDescriptor: {
|
|
451
|
+
readonly title: "Bundle descriptor";
|
|
452
|
+
readonly type: "object";
|
|
453
|
+
readonly additionalProperties: false;
|
|
454
|
+
readonly description: "The control-plane account of an out-of-band byte transfer. Shared in shape with initiate-export, where it describes a download rather than an upload.";
|
|
455
|
+
readonly required: readonly ["bundleId", "algorithm", "transportUrl", "transportToken", "expectedSha256", "expectedSizeBytes", "expiresAt"];
|
|
456
|
+
readonly properties: {
|
|
457
|
+
readonly bundleId: {
|
|
458
|
+
readonly type: "string";
|
|
459
|
+
readonly pattern: "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$";
|
|
460
|
+
readonly description: "Handle for this bundle across its whole lifecycle. Quoted back by finalize-import and abort. Recipient-generated and unguessable, which is what lets an unauthorized reference be answered as not-found without confirming existence.";
|
|
461
|
+
};
|
|
462
|
+
readonly algorithm: {
|
|
463
|
+
readonly type: "string";
|
|
464
|
+
readonly minLength: 1;
|
|
465
|
+
readonly maxLength: 64;
|
|
466
|
+
readonly description: "The mechanism actually used, which is authoritative over what was requested.";
|
|
467
|
+
};
|
|
468
|
+
readonly transportUrl: {
|
|
469
|
+
readonly type: "string";
|
|
470
|
+
readonly format: "uri";
|
|
471
|
+
readonly maxLength: 2048;
|
|
472
|
+
readonly description: "Where to write the bytes. Write-only: a recipient must not serve staged bytes back from this address, or a leaked token becomes a read of the operator's bundle. A recipient with no address at which it is reachable cannot produce this and refuses with transportUnavailable.";
|
|
473
|
+
};
|
|
474
|
+
readonly transportToken: {
|
|
475
|
+
readonly type: "string";
|
|
476
|
+
readonly minLength: 1;
|
|
477
|
+
readonly maxLength: 1024;
|
|
478
|
+
readonly description: "Bearer credential for transportUrl, presented in the X-Backup-Token header. Minted per bundle and never reused. A recipient should store only a hash of it. Leaking it lets a third party fill the slot; expectedSha256 is what bounds that to a failed transfer rather than a staged substitution.";
|
|
479
|
+
};
|
|
480
|
+
readonly expectedSha256: {
|
|
481
|
+
readonly type: "string";
|
|
482
|
+
readonly pattern: "^[0-9a-f]{64}$";
|
|
483
|
+
readonly description: "Echoed from the request, so the descriptor stands alone as the terms of the transfer.";
|
|
484
|
+
};
|
|
485
|
+
readonly expectedSizeBytes: {
|
|
486
|
+
readonly type: "integer";
|
|
487
|
+
readonly minimum: 1;
|
|
488
|
+
readonly description: "Echoed from the request, so the descriptor stands alone as the terms of the transfer.";
|
|
489
|
+
};
|
|
490
|
+
readonly expiresAt: {
|
|
491
|
+
readonly type: "string";
|
|
492
|
+
readonly format: "date-time";
|
|
493
|
+
readonly description: "After which the slot closes, the token is refused, and any staged bytes are discarded unread. Short by design: the window is how long a writable endpoint into the agent exists.";
|
|
494
|
+
};
|
|
495
|
+
};
|
|
496
|
+
};
|
|
497
|
+
readonly Ext: {
|
|
498
|
+
readonly title: "Ext";
|
|
499
|
+
readonly 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.";
|
|
500
|
+
readonly type: "object";
|
|
501
|
+
readonly minProperties: 1;
|
|
502
|
+
readonly additionalProperties: true;
|
|
503
|
+
readonly propertyNames: {
|
|
504
|
+
readonly pattern: "^[a-z][a-z0-9-]*(\\.[a-z0-9-]+)+$";
|
|
505
|
+
};
|
|
506
|
+
};
|
|
507
|
+
};
|
|
508
|
+
};
|
|
509
|
+
};
|
|
510
|
+
//# sourceMappingURL=payload.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"payload.d.ts","sourceRoot":"","sources":["../../../../../src/vta/backup/initiate-import/1.0/payload.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,mCAAmC,CAAC;AAG7D;;GAEG;AACH,MAAM,WAAW,8BAA8B;IAC7C;;OAEG;IACH,cAAc,EAAE,MAAM,CAAC;IACvB;;OAEG;IACH,iBAAiB,EAAE,MAAM,CAAC;IAC1B;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;OAEG;IACH,GAAG,CAAC,EAAE,GAAG,CAAC;CACX;AACD,MAAM,WAAW,sCAAsC;IACrD,UAAU,EAAE,gBAAgB,CAAC;IAC7B;;OAEG;IACH,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB;;OAEG;IACH,GAAG,CAAC,EAAE,GAAG,CAAC;CACX;AACD;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAC/B;;OAEG;IACH,QAAQ,EAAE,MAAM,CAAC;IACjB;;OAEG;IACH,SAAS,EAAE,MAAM,CAAC;IAClB;;OAEG;IACH,YAAY,EAAE,MAAM,CAAC;IACrB;;OAEG;IACH,cAAc,EAAE,MAAM,CAAC;IACvB;;OAEG;IACH,cAAc,EAAE,MAAM,CAAC;IACvB;;OAEG;IACH,iBAAiB,EAAE,MAAM,CAAC;IAC1B;;OAEG;IACH,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,kHAAkH;AAClH,YAAY,EAAE,GAAG,EAAE,CAAC;AAEpB,2BAA2B;AAC3B,eAAO,MAAM,QAAQ,EAAG,4DAAqE,CAAC;AAE9F,mEAAmE;AACnE,MAAM,MAAM,OAAO,GAAG,8BAA8B,CAAC;AAErD,qEAAqE;AACrE,eAAO,MAAM,iBAAiB,EAAG,qEAA8E,CAAC;AAEhH,4EAA4E;AAC5E,MAAM,MAAM,QAAQ,GAAG,sCAAsC,CAAC;AAE9D;;;;;;;;GAQG;AACH,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA4HjB,CAAC;AAEX,mEAAmE;AACnE,eAAO,MAAM,uBAAuB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA8F1B,CAAC;AAEX;;;;;GAKG;AACH,eAAO,MAAM,IAAI;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAOP,CAAC;AAEX;;;;GAIG;AACH,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAOhB,CAAC"}
|