@openvtc/trust-tasks 0.20.6 → 0.20.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 +138 -0
- package/dist/_shared/components.d.ts +55 -6
- package/dist/_shared/components.d.ts.map +1 -1
- package/dist/auth/step-up/approve-request/0.3/payload.d.ts +613 -0
- package/dist/auth/step-up/approve-request/0.3/payload.d.ts.map +1 -0
- package/dist/auth/step-up/approve-request/0.3/payload.js +345 -0
- package/dist/auth/step-up/approve-request/0.3/payload.js.map +1 -0
- package/dist/auth/step-up/approve-response/0.4/payload.d.ts +887 -0
- package/dist/auth/step-up/approve-response/0.4/payload.d.ts.map +1 -0
- package/dist/auth/step-up/approve-response/0.4/payload.js +504 -0
- package/dist/auth/step-up/approve-response/0.4/payload.js.map +1 -0
- package/dist/backup/abort/0.1/payload.d.ts +262 -0
- package/dist/backup/abort/0.1/payload.d.ts.map +1 -0
- package/dist/backup/abort/0.1/payload.js +146 -0
- package/dist/backup/abort/0.1/payload.js.map +1 -0
- package/dist/backup/complete-export/0.1/payload.d.ts +262 -0
- package/dist/backup/complete-export/0.1/payload.d.ts.map +1 -0
- package/dist/backup/complete-export/0.1/payload.js +146 -0
- package/dist/backup/complete-export/0.1/payload.js.map +1 -0
- package/dist/backup/finalize-import/0.1/payload.d.ts +395 -0
- package/dist/backup/finalize-import/0.1/payload.d.ts.map +1 -0
- package/dist/backup/finalize-import/0.1/payload.js +209 -0
- package/dist/backup/finalize-import/0.1/payload.js.map +1 -0
- package/dist/backup/get-chunk/0.1/payload.d.ts +461 -0
- package/dist/backup/get-chunk/0.1/payload.d.ts.map +1 -0
- package/dist/backup/get-chunk/0.1/payload.js +250 -0
- package/dist/backup/get-chunk/0.1/payload.js.map +1 -0
- package/dist/backup/initiate-export/0.1/payload.d.ts +896 -0
- package/dist/backup/initiate-export/0.1/payload.d.ts.map +1 -0
- package/dist/backup/initiate-export/0.1/payload.js +507 -0
- package/dist/backup/initiate-export/0.1/payload.js.map +1 -0
- package/dist/backup/initiate-import/0.1/payload.d.ts +888 -0
- package/dist/backup/initiate-import/0.1/payload.d.ts.map +1 -0
- package/dist/backup/initiate-import/0.1/payload.js +504 -0
- package/dist/backup/initiate-import/0.1/payload.js.map +1 -0
- package/dist/backup/put-chunk/0.1/payload.d.ts +495 -0
- package/dist/backup/put-chunk/0.1/payload.d.ts.map +1 -0
- package/dist/backup/put-chunk/0.1/payload.js +265 -0
- package/dist/backup/put-chunk/0.1/payload.js.map +1 -0
- package/dist/git-ns/_shared/0.1/git-ns.d.ts +1 -1
- package/dist/git-ns/_shared/0.1/git-ns.d.ts.map +1 -1
- package/dist/git-ns/_shared/0.2/git-ns.d.ts +1 -1
- package/dist/git-ns/_shared/0.2/git-ns.d.ts.map +1 -1
- package/dist/git-ns/_shared/0.3/git-ns.d.ts +16 -0
- package/dist/git-ns/_shared/0.3/git-ns.d.ts.map +1 -0
- package/dist/git-ns/_shared/0.3/git-ns.js +6 -0
- package/dist/git-ns/_shared/0.3/git-ns.js.map +1 -0
- package/dist/git-ns/bridge/job/0.1/payload.d.ts +1 -1
- package/dist/git-ns/bridge/job/0.1/payload.d.ts.map +1 -1
- package/dist/git-ns/bridge/job/0.2/payload.d.ts +1 -1
- package/dist/git-ns/bridge/job/0.2/payload.d.ts.map +1 -1
- package/dist/git-ns/bridge/job/0.3/payload.d.ts +1068 -0
- package/dist/git-ns/bridge/job/0.3/payload.d.ts.map +1 -0
- package/dist/git-ns/bridge/job/0.3/payload.js +573 -0
- package/dist/git-ns/bridge/job/0.3/payload.js.map +1 -0
- package/dist/git-ns/drift/resolve/0.1/payload.d.ts +1 -1
- package/dist/git-ns/drift/resolve/0.1/payload.d.ts.map +1 -1
- package/dist/git-ns/drift/resolve/0.2/payload.d.ts +1060 -0
- package/dist/git-ns/drift/resolve/0.2/payload.d.ts.map +1 -0
- package/dist/git-ns/drift/resolve/0.2/payload.js +630 -0
- package/dist/git-ns/drift/resolve/0.2/payload.js.map +1 -0
- package/dist/git-ns/namespace/reseat/0.1/payload.d.ts +1 -1
- package/dist/git-ns/namespace/reseat/0.1/payload.d.ts.map +1 -1
- package/dist/git-ns/namespace/reseat/0.2/payload.d.ts +515 -0
- package/dist/git-ns/namespace/reseat/0.2/payload.d.ts.map +1 -0
- package/dist/git-ns/namespace/reseat/0.2/payload.js +296 -0
- package/dist/git-ns/namespace/reseat/0.2/payload.js.map +1 -0
- package/dist/git-ns/repo/adopt/0.1/payload.d.ts +1 -1
- package/dist/git-ns/repo/adopt/0.1/payload.d.ts.map +1 -1
- package/dist/git-ns/repo/adopt/0.2/payload.d.ts +962 -0
- package/dist/git-ns/repo/adopt/0.2/payload.d.ts.map +1 -0
- package/dist/git-ns/repo/adopt/0.2/payload.js +583 -0
- package/dist/git-ns/repo/adopt/0.2/payload.js.map +1 -0
- package/dist/git-ns/repo/archive/0.1/payload.d.ts +1 -1
- package/dist/git-ns/repo/archive/0.1/payload.d.ts.map +1 -1
- package/dist/git-ns/repo/archive/0.2/payload.d.ts +959 -0
- package/dist/git-ns/repo/archive/0.2/payload.d.ts.map +1 -0
- package/dist/git-ns/repo/archive/0.2/payload.js +584 -0
- package/dist/git-ns/repo/archive/0.2/payload.js.map +1 -0
- package/dist/git-ns/repo/create/0.1/payload.d.ts +1 -1
- package/dist/git-ns/repo/create/0.1/payload.d.ts.map +1 -1
- package/dist/git-ns/repo/create/0.2/payload.d.ts +1074 -0
- package/dist/git-ns/repo/create/0.2/payload.d.ts.map +1 -0
- package/dist/git-ns/repo/create/0.2/payload.js +636 -0
- package/dist/git-ns/repo/create/0.2/payload.js.map +1 -0
- package/dist/git-ns/repo/transfer/0.1/payload.d.ts +1 -1
- package/dist/git-ns/repo/transfer/0.1/payload.d.ts.map +1 -1
- package/dist/git-ns/repo/transfer/0.2/payload.d.ts +947 -0
- package/dist/git-ns/repo/transfer/0.2/payload.d.ts.map +1 -0
- package/dist/git-ns/repo/transfer/0.2/payload.js +577 -0
- package/dist/git-ns/repo/transfer/0.2/payload.js.map +1 -0
- package/dist/git-ns/right/grant/0.1/payload.d.ts +1 -1
- package/dist/git-ns/right/grant/0.1/payload.d.ts.map +1 -1
- package/dist/git-ns/right/grant/0.2/payload.d.ts +506 -0
- package/dist/git-ns/right/grant/0.2/payload.d.ts.map +1 -0
- package/dist/git-ns/right/grant/0.2/payload.js +289 -0
- package/dist/git-ns/right/grant/0.2/payload.js.map +1 -0
- package/dist/git-ns/right/revoke/0.1/payload.d.ts +1 -1
- package/dist/git-ns/right/revoke/0.1/payload.d.ts.map +1 -1
- package/dist/git-ns/right/revoke/0.2/payload.d.ts +492 -0
- package/dist/git-ns/right/revoke/0.2/payload.d.ts.map +1 -0
- package/dist/git-ns/right/revoke/0.2/payload.js +284 -0
- package/dist/git-ns/right/revoke/0.2/payload.js.map +1 -0
- package/dist/git-ns/view/0.1/payload.d.ts +1 -1
- package/dist/git-ns/view/0.1/payload.d.ts.map +1 -1
- package/dist/git-ns/view/0.2/payload.d.ts +1 -1
- package/dist/git-ns/view/0.2/payload.d.ts.map +1 -1
- package/dist/git-ns/view/0.3/payload.d.ts +1524 -0
- package/dist/git-ns/view/0.3/payload.d.ts.map +1 -0
- package/dist/git-ns/view/0.3/payload.js +918 -0
- package/dist/git-ns/view/0.3/payload.js.map +1 -0
- package/dist/index.d.ts +20 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +20 -0
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/_shared/components.ts +55 -6
- package/src/auth/step-up/approve-request/0.3/payload.ts +421 -0
- package/src/auth/step-up/approve-response/0.4/payload.ts +593 -0
- package/src/backup/abort/0.1/payload.ts +191 -0
- package/src/backup/complete-export/0.1/payload.ts +191 -0
- package/src/backup/finalize-import/0.1/payload.ts +279 -0
- package/src/backup/get-chunk/0.1/payload.ts +308 -0
- package/src/backup/initiate-export/0.1/payload.ts +564 -0
- package/src/backup/initiate-import/0.1/payload.ts +561 -0
- package/src/backup/put-chunk/0.1/payload.ts +331 -0
- package/src/git-ns/_shared/0.1/git-ns.ts +1 -1
- package/src/git-ns/_shared/0.2/git-ns.ts +1 -1
- package/src/git-ns/_shared/0.3/git-ns.ts +17 -0
- package/src/git-ns/bridge/job/0.1/payload.ts +1 -1
- package/src/git-ns/bridge/job/0.2/payload.ts +1 -1
- package/src/git-ns/bridge/job/0.3/payload.ts +691 -0
- package/src/git-ns/drift/resolve/0.1/payload.ts +1 -1
- package/src/git-ns/drift/resolve/0.2/payload.ts +699 -0
- package/src/git-ns/namespace/reseat/0.1/payload.ts +1 -1
- package/src/git-ns/namespace/reseat/0.2/payload.ts +342 -0
- package/src/git-ns/repo/adopt/0.1/payload.ts +1 -1
- package/src/git-ns/repo/adopt/0.2/payload.ts +628 -0
- package/src/git-ns/repo/archive/0.1/payload.ts +1 -1
- package/src/git-ns/repo/archive/0.2/payload.ts +626 -0
- package/src/git-ns/repo/create/0.1/payload.ts +1 -1
- package/src/git-ns/repo/create/0.2/payload.ts +689 -0
- package/src/git-ns/repo/transfer/0.1/payload.ts +1 -1
- package/src/git-ns/repo/transfer/0.2/payload.ts +619 -0
- package/src/git-ns/right/grant/0.1/payload.ts +1 -1
- package/src/git-ns/right/grant/0.2/payload.ts +340 -0
- package/src/git-ns/right/revoke/0.1/payload.ts +1 -1
- package/src/git-ns/right/revoke/0.2/payload.ts +331 -0
- package/src/git-ns/view/0.1/payload.ts +1 -1
- package/src/git-ns/view/0.2/payload.ts +1 -1
- package/src/git-ns/view/0.3/payload.ts +981 -0
- package/src/index.ts +20 -0
|
@@ -0,0 +1,888 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Generated by scripts/build-ts-bindings.mjs — DO NOT EDIT BY HAND.
|
|
3
|
+
* Source: specs/backup/initiate-import/0.1/payload.schema.json
|
|
4
|
+
*/
|
|
5
|
+
import type { BundleDescriptor, BundleId, ChunkCount, ChunkedDescriptor, ChunkManifest, ChunkSize, DigestMultibase, ExpectedSha256, ExpectedSizeBytes, ExpiresAt, Ext, StreamDescriptor } from "../../../_shared/components.js";
|
|
6
|
+
/**
|
|
7
|
+
* Asks the recipient to open a slot for an encrypted bundle the producer is about to upload — by an HTTPS address (`stream`) or chunk by chunk over Trust Task documents (`chunkedTrustTask`) — pre-committing the digest and size, and for a chunked upload the chunk manifest, 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 BackupInitiateImportPayload {
|
|
10
|
+
/**
|
|
11
|
+
* Lowercase hex SHA-256 of the whole bundle about to be uploaded, committed before the upload begins. The recipient refuses bytes that hash differently, which is what bounds the damage from a leaked write token or a substituted chunk. 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: ExpectedSha256;
|
|
14
|
+
/**
|
|
15
|
+
* Byte count of the upload. Lets the recipient size the slot and refuse a truncated or oversized transfer without hashing it first.
|
|
16
|
+
*/
|
|
17
|
+
expectedSizeBytes: ExpectedSizeBytes;
|
|
18
|
+
/**
|
|
19
|
+
* Requested transport mechanism — how the bytes move, not how they are encrypted. This version defines `stream` (what an absent member means) and `chunkedTrustTask`. 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
|
+
* The chunk manifest the upload will follow. REQUIRED when `algorithm` is `chunkedTrustTask` and forbidden otherwise — a rule over two members that this schema does not express; a recipient refuses a violation with invalidManifest. Pre-committed for the same reason the whole-bundle digest is: the recipient knows what each chunk must be before it receives any.
|
|
24
|
+
*/
|
|
25
|
+
chunks?: ChunkManifest;
|
|
26
|
+
/**
|
|
27
|
+
* Ecosystem-defined extension members per SPEC.md §4.5.1.
|
|
28
|
+
*/
|
|
29
|
+
ext?: Ext;
|
|
30
|
+
}
|
|
31
|
+
export interface BackupInitiateImportResponsePayload {
|
|
32
|
+
/**
|
|
33
|
+
* Where or how to write the bytes, on what terms, and until when.
|
|
34
|
+
*/
|
|
35
|
+
descriptor: BundleDescriptor;
|
|
36
|
+
/**
|
|
37
|
+
* 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.
|
|
38
|
+
*/
|
|
39
|
+
completionHint?: string;
|
|
40
|
+
/**
|
|
41
|
+
* Ecosystem-defined extension members per SPEC.md §4.5.1.
|
|
42
|
+
*/
|
|
43
|
+
ext?: Ext;
|
|
44
|
+
}
|
|
45
|
+
/** Shared definitions this specification references, re-exported under the names it used to declare them with. */
|
|
46
|
+
export type { BundleDescriptor, BundleId, ChunkCount, ChunkedDescriptor, ChunkManifest, ChunkSize, DigestMultibase, ExpectedSha256, ExpectedSizeBytes, ExpiresAt, Ext, StreamDescriptor };
|
|
47
|
+
/** Trust Task type URI. */
|
|
48
|
+
export declare const TYPE_URI: "https://trusttasks.org/spec/backup/initiate-import/0.1";
|
|
49
|
+
/** Stable alias for this specification's request payload shape. */
|
|
50
|
+
export type Payload = BackupInitiateImportPayload;
|
|
51
|
+
/** Trust Task response type URI (request type URI + "#response"). */
|
|
52
|
+
export declare const RESPONSE_TYPE_URI: "https://trusttasks.org/spec/backup/initiate-import/0.1#response";
|
|
53
|
+
/** Stable alias for this specification's success-response payload shape. */
|
|
54
|
+
export type Response = BackupInitiateImportResponsePayload;
|
|
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 declare const PAYLOAD_SCHEMA: {
|
|
65
|
+
readonly $schema: "https://json-schema.org/draft/2020-12/schema";
|
|
66
|
+
readonly $id: "https://trusttasks.org/spec/backup/initiate-import/0.1";
|
|
67
|
+
readonly title: "Backup — Initiate Import — payload";
|
|
68
|
+
readonly description: "Asks the recipient to open a slot for an encrypted bundle the producer is about to upload — by an HTTPS address (`stream`) or chunk by chunk over Trust Task documents (`chunkedTrustTask`) — pre-committing the digest and size, and for a chunked upload the chunk manifest, so the transfer is verifiable. The outer document members (id, type, issuer, recipient, issuedAt, expiresAt, proof) are owned by the framework — SPEC §6.3.";
|
|
69
|
+
readonly type: "object";
|
|
70
|
+
readonly additionalProperties: false;
|
|
71
|
+
readonly required: readonly ["expectedSha256", "expectedSizeBytes"];
|
|
72
|
+
readonly properties: {
|
|
73
|
+
readonly expectedSha256: {
|
|
74
|
+
readonly $ref: "#/$defs/ExpectedSha256";
|
|
75
|
+
readonly description: "Lowercase hex SHA-256 of the whole bundle about to be uploaded, committed before the upload begins. The recipient refuses bytes that hash differently, which is what bounds the damage from a leaked write token or a substituted chunk. 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.";
|
|
76
|
+
};
|
|
77
|
+
readonly expectedSizeBytes: {
|
|
78
|
+
readonly $ref: "#/$defs/ExpectedSizeBytes";
|
|
79
|
+
readonly description: "Byte count of the upload. Lets the recipient size the slot and refuse a truncated or oversized transfer without hashing it first.";
|
|
80
|
+
};
|
|
81
|
+
readonly algorithm: {
|
|
82
|
+
readonly type: "string";
|
|
83
|
+
readonly minLength: 1;
|
|
84
|
+
readonly maxLength: 64;
|
|
85
|
+
readonly description: "Requested transport mechanism — how the bytes move, not how they are encrypted. This version defines `stream` (what an absent member means) and `chunkedTrustTask`. 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.";
|
|
86
|
+
};
|
|
87
|
+
readonly chunks: {
|
|
88
|
+
readonly $ref: "#/$defs/ChunkManifest";
|
|
89
|
+
readonly description: "The chunk manifest the upload will follow. REQUIRED when `algorithm` is `chunkedTrustTask` and forbidden otherwise — a rule over two members that this schema does not express; a recipient refuses a violation with invalidManifest. Pre-committed for the same reason the whole-bundle digest is: the recipient knows what each chunk must be before it receives any.";
|
|
90
|
+
};
|
|
91
|
+
readonly ext: {
|
|
92
|
+
readonly $ref: "#/$defs/Ext";
|
|
93
|
+
readonly description: "Ecosystem-defined extension members per SPEC.md §4.5.1.";
|
|
94
|
+
};
|
|
95
|
+
};
|
|
96
|
+
readonly $defs: {
|
|
97
|
+
readonly Response: {
|
|
98
|
+
readonly $anchor: "response";
|
|
99
|
+
readonly title: "Backup — Initiate Import — response payload";
|
|
100
|
+
readonly type: "object";
|
|
101
|
+
readonly additionalProperties: false;
|
|
102
|
+
readonly required: readonly ["descriptor"];
|
|
103
|
+
readonly properties: {
|
|
104
|
+
readonly descriptor: {
|
|
105
|
+
readonly $ref: "#/$defs/BundleDescriptor";
|
|
106
|
+
readonly description: "Where or how to write the bytes, on what terms, and until when.";
|
|
107
|
+
};
|
|
108
|
+
readonly completionHint: {
|
|
109
|
+
readonly type: "string";
|
|
110
|
+
readonly maxLength: 1024;
|
|
111
|
+
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.";
|
|
112
|
+
};
|
|
113
|
+
readonly ext: {
|
|
114
|
+
readonly $ref: "#/$defs/Ext";
|
|
115
|
+
readonly description: "Ecosystem-defined extension members per SPEC.md §4.5.1.";
|
|
116
|
+
};
|
|
117
|
+
};
|
|
118
|
+
};
|
|
119
|
+
readonly Ext: {
|
|
120
|
+
readonly title: "Ext";
|
|
121
|
+
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.";
|
|
122
|
+
readonly type: "object";
|
|
123
|
+
readonly minProperties: 1;
|
|
124
|
+
readonly additionalProperties: true;
|
|
125
|
+
readonly propertyNames: {
|
|
126
|
+
readonly pattern: "^[a-z][a-z0-9-]*(\\.[a-z0-9-]+)+$";
|
|
127
|
+
};
|
|
128
|
+
};
|
|
129
|
+
readonly BundleDescriptor: {
|
|
130
|
+
readonly title: "BundleDescriptor";
|
|
131
|
+
readonly description: "The control-plane account of a bundle transfer: which algorithm, on what terms, until when. Exactly one of the two shapes — they are mutually exclusive, since StreamDescriptor requires `transportUrl` and `transportToken` and forbids `chunks`, and ChunkedDescriptor requires `chunks` and forbids both.";
|
|
132
|
+
readonly oneOf: readonly [{
|
|
133
|
+
readonly $ref: "#/$defs/StreamDescriptor";
|
|
134
|
+
}, {
|
|
135
|
+
readonly $ref: "#/$defs/ChunkedDescriptor";
|
|
136
|
+
}];
|
|
137
|
+
};
|
|
138
|
+
readonly ChunkedDescriptor: {
|
|
139
|
+
readonly title: "ChunkedDescriptor";
|
|
140
|
+
readonly type: "object";
|
|
141
|
+
readonly additionalProperties: false;
|
|
142
|
+
readonly description: "A descriptor for the `chunkedTrustTask` algorithm. Carries no address and no bearer token: every chunk moves in a Trust Task document whose sender the transport authenticates, so possession of a token would add nothing and would be one more secret to leak.";
|
|
143
|
+
readonly required: readonly ["bundleId", "algorithm", "chunks", "expectedSha256", "expectedSizeBytes", "expiresAt"];
|
|
144
|
+
readonly properties: {
|
|
145
|
+
readonly bundleId: {
|
|
146
|
+
readonly $ref: "#/$defs/BundleId";
|
|
147
|
+
};
|
|
148
|
+
readonly algorithm: {
|
|
149
|
+
readonly type: "string";
|
|
150
|
+
readonly enum: readonly ["chunkedTrustTask"];
|
|
151
|
+
readonly description: "Discriminates this shape from StreamDescriptor.";
|
|
152
|
+
};
|
|
153
|
+
readonly chunks: {
|
|
154
|
+
readonly $ref: "#/$defs/ChunkManifest";
|
|
155
|
+
};
|
|
156
|
+
readonly expectedSha256: {
|
|
157
|
+
readonly $ref: "#/$defs/ExpectedSha256";
|
|
158
|
+
};
|
|
159
|
+
readonly expectedSizeBytes: {
|
|
160
|
+
readonly $ref: "#/$defs/ExpectedSizeBytes";
|
|
161
|
+
};
|
|
162
|
+
readonly expiresAt: {
|
|
163
|
+
readonly $ref: "#/$defs/ExpiresAt";
|
|
164
|
+
};
|
|
165
|
+
};
|
|
166
|
+
};
|
|
167
|
+
readonly ExpiresAt: {
|
|
168
|
+
readonly title: "ExpiresAt";
|
|
169
|
+
readonly description: "After which the bundle is collected: staged bytes discarded, tokens and chunk requests refused. Short by design. For a chunked transfer a recipient may move it later as chunks are exchanged, never past its own ceiling — each chunk response reports the current value.";
|
|
170
|
+
readonly type: "string";
|
|
171
|
+
readonly format: "date-time";
|
|
172
|
+
};
|
|
173
|
+
readonly ExpectedSizeBytes: {
|
|
174
|
+
readonly title: "ExpectedSizeBytes";
|
|
175
|
+
readonly description: "Total byte count of the bundle. A zero-length bundle is not a degenerate success — nothing was serialized — so the floor is 1.";
|
|
176
|
+
readonly type: "integer";
|
|
177
|
+
readonly minimum: 1;
|
|
178
|
+
};
|
|
179
|
+
readonly ExpectedSha256: {
|
|
180
|
+
readonly title: "ExpectedSha256";
|
|
181
|
+
readonly description: "Lowercase hex SHA-256 of the whole bundle's bytes. Kept in the hex form the 1.0 descriptor published rather than moved to DigestMultibase, because it is an unchanged member of an existing descriptor and re-encoding it would break every stream producer for no gain in what it checks. For a chunked transfer it is the check over the reassembled bundle, applied after every chunk has verified individually, so that a correct set of chunks assembled in the wrong order is still caught.";
|
|
182
|
+
readonly type: "string";
|
|
183
|
+
readonly pattern: "^[0-9a-f]{64}$";
|
|
184
|
+
};
|
|
185
|
+
readonly ChunkManifest: {
|
|
186
|
+
readonly title: "ChunkManifest";
|
|
187
|
+
readonly description: "The terms of a `chunkedTrustTask` transfer, committed before any chunk moves. On export the recipient states them in the descriptor; on import the producer pre-commits them in the request and the recipient echoes them. Either way the manifest arrives in a document whose proof is REQUIRED, so the per-chunk digests are authenticated by the party that computed them and each chunk can be verified — and a single bad chunk re-fetched or refused — on arrival rather than only after reassembly.\n\nConsistency rules JSON Schema cannot state: `chunkCount` MUST equal ceil(expectedSizeBytes / chunkSize) for the bundle the manifest describes, and `chunkDigests` MUST have exactly `chunkCount` items. A party receiving a manifest violating either MUST refuse it.";
|
|
188
|
+
readonly type: "object";
|
|
189
|
+
readonly additionalProperties: false;
|
|
190
|
+
readonly required: readonly ["chunkSize", "chunkCount", "chunkDigests"];
|
|
191
|
+
readonly properties: {
|
|
192
|
+
readonly chunkSize: {
|
|
193
|
+
readonly $ref: "#/$defs/ChunkSize";
|
|
194
|
+
};
|
|
195
|
+
readonly chunkCount: {
|
|
196
|
+
readonly $ref: "#/$defs/ChunkCount";
|
|
197
|
+
};
|
|
198
|
+
readonly chunkDigests: {
|
|
199
|
+
readonly type: "array";
|
|
200
|
+
readonly minItems: 1;
|
|
201
|
+
readonly maxItems: 4096;
|
|
202
|
+
readonly description: "Digest of each chunk's raw bytes (not of its base64url encoding), in index order. Compared as decoded multihash bytes, never as encoded strings. sha2-256 is RECOMMENDED and MUST be implemented by every party; a party that does not implement the hash a digest names MUST treat the manifest as unverifiable rather than skip the check.";
|
|
203
|
+
readonly items: {
|
|
204
|
+
readonly $ref: "#/$defs/DigestMultibase";
|
|
205
|
+
};
|
|
206
|
+
};
|
|
207
|
+
};
|
|
208
|
+
};
|
|
209
|
+
readonly ChunkCount: {
|
|
210
|
+
readonly title: "ChunkCount";
|
|
211
|
+
readonly description: "Number of chunks in the bundle, equal to ceil(expectedSizeBytes / chunkSize). Bounded at 4096 so that the manifest itself — one digest per chunk — fits in the single document that carries it under the same message-size reasoning as a chunk.";
|
|
212
|
+
readonly type: "integer";
|
|
213
|
+
readonly minimum: 1;
|
|
214
|
+
readonly maximum: 4096;
|
|
215
|
+
};
|
|
216
|
+
readonly ChunkSize: {
|
|
217
|
+
readonly title: "ChunkSize";
|
|
218
|
+
readonly description: "Size in bytes of every chunk except the last, which carries the remainder and is between 1 and this value inclusive. The ceiling of 262144 (256 KiB) is normative and is derived in `vta/backup/initiate-export/1.1` under Chunked transfer: it is the largest power of two whose `get-chunk` or `put-chunk` document still fits a 1 MiB mediator message after base64url encoding of `data`, DIDComm authcrypt encoding, and two nested forward wrappers. The floor of 16384 keeps a 1 GiB bundle within `ChunkCount`'s ceiling at sizes a constrained transport can still choose.";
|
|
219
|
+
readonly type: "integer";
|
|
220
|
+
readonly minimum: 16384;
|
|
221
|
+
readonly maximum: 262144;
|
|
222
|
+
};
|
|
223
|
+
readonly DigestMultibase: {
|
|
224
|
+
readonly title: "DigestMultibase";
|
|
225
|
+
readonly description: "A cryptographic digest as a multibase-encoded multihash — the encoding the W3C Verifiable Credentials Data Model 2.0 defines for `digestMultibase`, and the one `did:webvh` uses for its SCID and entry hashes.\n\nMultihash carries the hash algorithm in-band, so the value is self-describing and the wire format survives an algorithm change without a schema revision; multibase does the same for the base encoding, so a verifier never infers base58 from base64url by context. A bare hex string or a `sha-256:`-style prefix hard-codes one algorithm into the wire contract and is non-conforming here.\n\nThis definition constrains the *encoding only*. What the digest is computed over is stated by each referencing field, because it differs legitimately: a digest over a JSON document is taken over its RFC 8785 (JCS) canonicalization, while a digest over an opaque artifact is taken over its bytes. A field whose input is a JSON document and which does not name a canonicalization is not reproducible.\n\nRestricted to the two multibase headers W3C Controlled Identifiers 1.0 §2.4 normatively requires — `z` (base58btc) and `u` (base64url-no-pad). CID permits others but states that \"interoperability is not guaranteed between implementations using such values\", and a registry whose purpose is interoperability should not mint digests a conforming verifier may be unable to read. The alphabets are enforced rather than assumed: base58btc excludes 0, O, I and l, and an earlier permissive pattern let three published examples carry digests that were not valid base58 at all. base58btc is RECOMMENDED, for consistency with `did:key` and `did:webvh`.";
|
|
226
|
+
readonly type: "string";
|
|
227
|
+
readonly minLength: 16;
|
|
228
|
+
readonly pattern: "^(z[1-9A-HJ-NP-Za-km-z]+|u[A-Za-z0-9_-]+)$";
|
|
229
|
+
readonly examples: readonly ["zQmbWqxBEKC3P8tqsKc98xmWNzrzDtRLMiMPL8wBuTGsMnR"];
|
|
230
|
+
};
|
|
231
|
+
readonly BundleId: {
|
|
232
|
+
readonly title: "BundleId";
|
|
233
|
+
readonly description: "Handle for a bundle across its whole lifecycle. Recipient-generated and unguessable, which is what lets an unauthorized reference be answered as not-found without confirming existence. Opaque: a producer quotes what it was given and must not derive, guess or enumerate one.";
|
|
234
|
+
readonly type: "string";
|
|
235
|
+
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}$";
|
|
236
|
+
};
|
|
237
|
+
readonly StreamDescriptor: {
|
|
238
|
+
readonly title: "StreamDescriptor";
|
|
239
|
+
readonly type: "object";
|
|
240
|
+
readonly additionalProperties: false;
|
|
241
|
+
readonly description: "A descriptor for a transfer that happens outside Trust Task documents, at an address the recipient publishes — the `stream` algorithm, and any other algorithm a recipient offers that is shaped as an address plus a bearer credential. Identical in members to the `vta/backup/*/1.0` descriptor.";
|
|
242
|
+
readonly required: readonly ["bundleId", "algorithm", "transportUrl", "transportToken", "expectedSha256", "expectedSizeBytes", "expiresAt"];
|
|
243
|
+
readonly properties: {
|
|
244
|
+
readonly bundleId: {
|
|
245
|
+
readonly $ref: "#/$defs/BundleId";
|
|
246
|
+
};
|
|
247
|
+
readonly algorithm: {
|
|
248
|
+
readonly type: "string";
|
|
249
|
+
readonly minLength: 1;
|
|
250
|
+
readonly maxLength: 64;
|
|
251
|
+
readonly description: "The mechanism in use. Never `chunkedTrustTask`, which has its own descriptor shape; a descriptor naming it with a transport address is malformed.";
|
|
252
|
+
};
|
|
253
|
+
readonly transportUrl: {
|
|
254
|
+
readonly type: "string";
|
|
255
|
+
readonly format: "uri";
|
|
256
|
+
readonly maxLength: 2048;
|
|
257
|
+
readonly description: "Where to fetch (export) or write (import) the bytes. A recipient with no address at which it is reachable cannot produce this and refuses with transportUnavailable rather than returning an unusable one. An import address is write-only: staged bytes are never served back from it.";
|
|
258
|
+
};
|
|
259
|
+
readonly transportToken: {
|
|
260
|
+
readonly type: "string";
|
|
261
|
+
readonly minLength: 1;
|
|
262
|
+
readonly maxLength: 1024;
|
|
263
|
+
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, and should accept an export token once.";
|
|
264
|
+
};
|
|
265
|
+
readonly expectedSha256: {
|
|
266
|
+
readonly $ref: "#/$defs/ExpectedSha256";
|
|
267
|
+
};
|
|
268
|
+
readonly expectedSizeBytes: {
|
|
269
|
+
readonly $ref: "#/$defs/ExpectedSizeBytes";
|
|
270
|
+
};
|
|
271
|
+
readonly expiresAt: {
|
|
272
|
+
readonly $ref: "#/$defs/ExpiresAt";
|
|
273
|
+
};
|
|
274
|
+
};
|
|
275
|
+
};
|
|
276
|
+
};
|
|
277
|
+
};
|
|
278
|
+
/** As {@link PAYLOAD_SCHEMA}, for the success-response variant. */
|
|
279
|
+
export declare const RESPONSE_PAYLOAD_SCHEMA: {
|
|
280
|
+
readonly $schema: "https://json-schema.org/draft/2020-12/schema";
|
|
281
|
+
readonly $ref: "#/$defs/Response";
|
|
282
|
+
readonly $defs: {
|
|
283
|
+
readonly Response: {
|
|
284
|
+
readonly $anchor: "response";
|
|
285
|
+
readonly title: "Backup — Initiate Import — response payload";
|
|
286
|
+
readonly type: "object";
|
|
287
|
+
readonly additionalProperties: false;
|
|
288
|
+
readonly required: readonly ["descriptor"];
|
|
289
|
+
readonly properties: {
|
|
290
|
+
readonly descriptor: {
|
|
291
|
+
readonly $ref: "#/$defs/BundleDescriptor";
|
|
292
|
+
readonly description: "Where or how to write the bytes, on what terms, and until when.";
|
|
293
|
+
};
|
|
294
|
+
readonly completionHint: {
|
|
295
|
+
readonly type: "string";
|
|
296
|
+
readonly maxLength: 1024;
|
|
297
|
+
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.";
|
|
298
|
+
};
|
|
299
|
+
readonly ext: {
|
|
300
|
+
readonly $ref: "#/$defs/Ext";
|
|
301
|
+
readonly description: "Ecosystem-defined extension members per SPEC.md §4.5.1.";
|
|
302
|
+
};
|
|
303
|
+
};
|
|
304
|
+
};
|
|
305
|
+
readonly Ext: {
|
|
306
|
+
readonly title: "Ext";
|
|
307
|
+
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.";
|
|
308
|
+
readonly type: "object";
|
|
309
|
+
readonly minProperties: 1;
|
|
310
|
+
readonly additionalProperties: true;
|
|
311
|
+
readonly propertyNames: {
|
|
312
|
+
readonly pattern: "^[a-z][a-z0-9-]*(\\.[a-z0-9-]+)+$";
|
|
313
|
+
};
|
|
314
|
+
};
|
|
315
|
+
readonly BundleDescriptor: {
|
|
316
|
+
readonly title: "BundleDescriptor";
|
|
317
|
+
readonly description: "The control-plane account of a bundle transfer: which algorithm, on what terms, until when. Exactly one of the two shapes — they are mutually exclusive, since StreamDescriptor requires `transportUrl` and `transportToken` and forbids `chunks`, and ChunkedDescriptor requires `chunks` and forbids both.";
|
|
318
|
+
readonly oneOf: readonly [{
|
|
319
|
+
readonly $ref: "#/$defs/StreamDescriptor";
|
|
320
|
+
}, {
|
|
321
|
+
readonly $ref: "#/$defs/ChunkedDescriptor";
|
|
322
|
+
}];
|
|
323
|
+
};
|
|
324
|
+
readonly ChunkedDescriptor: {
|
|
325
|
+
readonly title: "ChunkedDescriptor";
|
|
326
|
+
readonly type: "object";
|
|
327
|
+
readonly additionalProperties: false;
|
|
328
|
+
readonly description: "A descriptor for the `chunkedTrustTask` algorithm. Carries no address and no bearer token: every chunk moves in a Trust Task document whose sender the transport authenticates, so possession of a token would add nothing and would be one more secret to leak.";
|
|
329
|
+
readonly required: readonly ["bundleId", "algorithm", "chunks", "expectedSha256", "expectedSizeBytes", "expiresAt"];
|
|
330
|
+
readonly properties: {
|
|
331
|
+
readonly bundleId: {
|
|
332
|
+
readonly $ref: "#/$defs/BundleId";
|
|
333
|
+
};
|
|
334
|
+
readonly algorithm: {
|
|
335
|
+
readonly type: "string";
|
|
336
|
+
readonly enum: readonly ["chunkedTrustTask"];
|
|
337
|
+
readonly description: "Discriminates this shape from StreamDescriptor.";
|
|
338
|
+
};
|
|
339
|
+
readonly chunks: {
|
|
340
|
+
readonly $ref: "#/$defs/ChunkManifest";
|
|
341
|
+
};
|
|
342
|
+
readonly expectedSha256: {
|
|
343
|
+
readonly $ref: "#/$defs/ExpectedSha256";
|
|
344
|
+
};
|
|
345
|
+
readonly expectedSizeBytes: {
|
|
346
|
+
readonly $ref: "#/$defs/ExpectedSizeBytes";
|
|
347
|
+
};
|
|
348
|
+
readonly expiresAt: {
|
|
349
|
+
readonly $ref: "#/$defs/ExpiresAt";
|
|
350
|
+
};
|
|
351
|
+
};
|
|
352
|
+
};
|
|
353
|
+
readonly ExpiresAt: {
|
|
354
|
+
readonly title: "ExpiresAt";
|
|
355
|
+
readonly description: "After which the bundle is collected: staged bytes discarded, tokens and chunk requests refused. Short by design. For a chunked transfer a recipient may move it later as chunks are exchanged, never past its own ceiling — each chunk response reports the current value.";
|
|
356
|
+
readonly type: "string";
|
|
357
|
+
readonly format: "date-time";
|
|
358
|
+
};
|
|
359
|
+
readonly ExpectedSizeBytes: {
|
|
360
|
+
readonly title: "ExpectedSizeBytes";
|
|
361
|
+
readonly description: "Total byte count of the bundle. A zero-length bundle is not a degenerate success — nothing was serialized — so the floor is 1.";
|
|
362
|
+
readonly type: "integer";
|
|
363
|
+
readonly minimum: 1;
|
|
364
|
+
};
|
|
365
|
+
readonly ExpectedSha256: {
|
|
366
|
+
readonly title: "ExpectedSha256";
|
|
367
|
+
readonly description: "Lowercase hex SHA-256 of the whole bundle's bytes. Kept in the hex form the 1.0 descriptor published rather than moved to DigestMultibase, because it is an unchanged member of an existing descriptor and re-encoding it would break every stream producer for no gain in what it checks. For a chunked transfer it is the check over the reassembled bundle, applied after every chunk has verified individually, so that a correct set of chunks assembled in the wrong order is still caught.";
|
|
368
|
+
readonly type: "string";
|
|
369
|
+
readonly pattern: "^[0-9a-f]{64}$";
|
|
370
|
+
};
|
|
371
|
+
readonly ChunkManifest: {
|
|
372
|
+
readonly title: "ChunkManifest";
|
|
373
|
+
readonly description: "The terms of a `chunkedTrustTask` transfer, committed before any chunk moves. On export the recipient states them in the descriptor; on import the producer pre-commits them in the request and the recipient echoes them. Either way the manifest arrives in a document whose proof is REQUIRED, so the per-chunk digests are authenticated by the party that computed them and each chunk can be verified — and a single bad chunk re-fetched or refused — on arrival rather than only after reassembly.\n\nConsistency rules JSON Schema cannot state: `chunkCount` MUST equal ceil(expectedSizeBytes / chunkSize) for the bundle the manifest describes, and `chunkDigests` MUST have exactly `chunkCount` items. A party receiving a manifest violating either MUST refuse it.";
|
|
374
|
+
readonly type: "object";
|
|
375
|
+
readonly additionalProperties: false;
|
|
376
|
+
readonly required: readonly ["chunkSize", "chunkCount", "chunkDigests"];
|
|
377
|
+
readonly properties: {
|
|
378
|
+
readonly chunkSize: {
|
|
379
|
+
readonly $ref: "#/$defs/ChunkSize";
|
|
380
|
+
};
|
|
381
|
+
readonly chunkCount: {
|
|
382
|
+
readonly $ref: "#/$defs/ChunkCount";
|
|
383
|
+
};
|
|
384
|
+
readonly chunkDigests: {
|
|
385
|
+
readonly type: "array";
|
|
386
|
+
readonly minItems: 1;
|
|
387
|
+
readonly maxItems: 4096;
|
|
388
|
+
readonly description: "Digest of each chunk's raw bytes (not of its base64url encoding), in index order. Compared as decoded multihash bytes, never as encoded strings. sha2-256 is RECOMMENDED and MUST be implemented by every party; a party that does not implement the hash a digest names MUST treat the manifest as unverifiable rather than skip the check.";
|
|
389
|
+
readonly items: {
|
|
390
|
+
readonly $ref: "#/$defs/DigestMultibase";
|
|
391
|
+
};
|
|
392
|
+
};
|
|
393
|
+
};
|
|
394
|
+
};
|
|
395
|
+
readonly ChunkCount: {
|
|
396
|
+
readonly title: "ChunkCount";
|
|
397
|
+
readonly description: "Number of chunks in the bundle, equal to ceil(expectedSizeBytes / chunkSize). Bounded at 4096 so that the manifest itself — one digest per chunk — fits in the single document that carries it under the same message-size reasoning as a chunk.";
|
|
398
|
+
readonly type: "integer";
|
|
399
|
+
readonly minimum: 1;
|
|
400
|
+
readonly maximum: 4096;
|
|
401
|
+
};
|
|
402
|
+
readonly ChunkSize: {
|
|
403
|
+
readonly title: "ChunkSize";
|
|
404
|
+
readonly description: "Size in bytes of every chunk except the last, which carries the remainder and is between 1 and this value inclusive. The ceiling of 262144 (256 KiB) is normative and is derived in `vta/backup/initiate-export/1.1` under Chunked transfer: it is the largest power of two whose `get-chunk` or `put-chunk` document still fits a 1 MiB mediator message after base64url encoding of `data`, DIDComm authcrypt encoding, and two nested forward wrappers. The floor of 16384 keeps a 1 GiB bundle within `ChunkCount`'s ceiling at sizes a constrained transport can still choose.";
|
|
405
|
+
readonly type: "integer";
|
|
406
|
+
readonly minimum: 16384;
|
|
407
|
+
readonly maximum: 262144;
|
|
408
|
+
};
|
|
409
|
+
readonly DigestMultibase: {
|
|
410
|
+
readonly title: "DigestMultibase";
|
|
411
|
+
readonly description: "A cryptographic digest as a multibase-encoded multihash — the encoding the W3C Verifiable Credentials Data Model 2.0 defines for `digestMultibase`, and the one `did:webvh` uses for its SCID and entry hashes.\n\nMultihash carries the hash algorithm in-band, so the value is self-describing and the wire format survives an algorithm change without a schema revision; multibase does the same for the base encoding, so a verifier never infers base58 from base64url by context. A bare hex string or a `sha-256:`-style prefix hard-codes one algorithm into the wire contract and is non-conforming here.\n\nThis definition constrains the *encoding only*. What the digest is computed over is stated by each referencing field, because it differs legitimately: a digest over a JSON document is taken over its RFC 8785 (JCS) canonicalization, while a digest over an opaque artifact is taken over its bytes. A field whose input is a JSON document and which does not name a canonicalization is not reproducible.\n\nRestricted to the two multibase headers W3C Controlled Identifiers 1.0 §2.4 normatively requires — `z` (base58btc) and `u` (base64url-no-pad). CID permits others but states that \"interoperability is not guaranteed between implementations using such values\", and a registry whose purpose is interoperability should not mint digests a conforming verifier may be unable to read. The alphabets are enforced rather than assumed: base58btc excludes 0, O, I and l, and an earlier permissive pattern let three published examples carry digests that were not valid base58 at all. base58btc is RECOMMENDED, for consistency with `did:key` and `did:webvh`.";
|
|
412
|
+
readonly type: "string";
|
|
413
|
+
readonly minLength: 16;
|
|
414
|
+
readonly pattern: "^(z[1-9A-HJ-NP-Za-km-z]+|u[A-Za-z0-9_-]+)$";
|
|
415
|
+
readonly examples: readonly ["zQmbWqxBEKC3P8tqsKc98xmWNzrzDtRLMiMPL8wBuTGsMnR"];
|
|
416
|
+
};
|
|
417
|
+
readonly BundleId: {
|
|
418
|
+
readonly title: "BundleId";
|
|
419
|
+
readonly description: "Handle for a bundle across its whole lifecycle. Recipient-generated and unguessable, which is what lets an unauthorized reference be answered as not-found without confirming existence. Opaque: a producer quotes what it was given and must not derive, guess or enumerate one.";
|
|
420
|
+
readonly type: "string";
|
|
421
|
+
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}$";
|
|
422
|
+
};
|
|
423
|
+
readonly StreamDescriptor: {
|
|
424
|
+
readonly title: "StreamDescriptor";
|
|
425
|
+
readonly type: "object";
|
|
426
|
+
readonly additionalProperties: false;
|
|
427
|
+
readonly description: "A descriptor for a transfer that happens outside Trust Task documents, at an address the recipient publishes — the `stream` algorithm, and any other algorithm a recipient offers that is shaped as an address plus a bearer credential. Identical in members to the `vta/backup/*/1.0` descriptor.";
|
|
428
|
+
readonly required: readonly ["bundleId", "algorithm", "transportUrl", "transportToken", "expectedSha256", "expectedSizeBytes", "expiresAt"];
|
|
429
|
+
readonly properties: {
|
|
430
|
+
readonly bundleId: {
|
|
431
|
+
readonly $ref: "#/$defs/BundleId";
|
|
432
|
+
};
|
|
433
|
+
readonly algorithm: {
|
|
434
|
+
readonly type: "string";
|
|
435
|
+
readonly minLength: 1;
|
|
436
|
+
readonly maxLength: 64;
|
|
437
|
+
readonly description: "The mechanism in use. Never `chunkedTrustTask`, which has its own descriptor shape; a descriptor naming it with a transport address is malformed.";
|
|
438
|
+
};
|
|
439
|
+
readonly transportUrl: {
|
|
440
|
+
readonly type: "string";
|
|
441
|
+
readonly format: "uri";
|
|
442
|
+
readonly maxLength: 2048;
|
|
443
|
+
readonly description: "Where to fetch (export) or write (import) the bytes. A recipient with no address at which it is reachable cannot produce this and refuses with transportUnavailable rather than returning an unusable one. An import address is write-only: staged bytes are never served back from it.";
|
|
444
|
+
};
|
|
445
|
+
readonly transportToken: {
|
|
446
|
+
readonly type: "string";
|
|
447
|
+
readonly minLength: 1;
|
|
448
|
+
readonly maxLength: 1024;
|
|
449
|
+
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, and should accept an export token once.";
|
|
450
|
+
};
|
|
451
|
+
readonly expectedSha256: {
|
|
452
|
+
readonly $ref: "#/$defs/ExpectedSha256";
|
|
453
|
+
};
|
|
454
|
+
readonly expectedSizeBytes: {
|
|
455
|
+
readonly $ref: "#/$defs/ExpectedSizeBytes";
|
|
456
|
+
};
|
|
457
|
+
readonly expiresAt: {
|
|
458
|
+
readonly $ref: "#/$defs/ExpiresAt";
|
|
459
|
+
};
|
|
460
|
+
};
|
|
461
|
+
};
|
|
462
|
+
};
|
|
463
|
+
};
|
|
464
|
+
/**
|
|
465
|
+
* SPEC.md §7.2 policy for the request variant, from this specification's
|
|
466
|
+
* front matter. Pass to `consumeInbound` — items 5b, 7 and 8 are
|
|
467
|
+
* per-specification and cannot be derived from the document alone, and
|
|
468
|
+
* item 2 needs the schema this carries.
|
|
469
|
+
*/
|
|
470
|
+
export declare const SPEC: {
|
|
471
|
+
readonly typeUri: "https://trusttasks.org/spec/backup/initiate-import/0.1";
|
|
472
|
+
readonly isBearer: false;
|
|
473
|
+
readonly isProofRequired: true;
|
|
474
|
+
readonly isRecipientRequired: true;
|
|
475
|
+
readonly isIssuedAtRequired: true;
|
|
476
|
+
readonly payloadSchema: {
|
|
477
|
+
readonly $schema: "https://json-schema.org/draft/2020-12/schema";
|
|
478
|
+
readonly $id: "https://trusttasks.org/spec/backup/initiate-import/0.1";
|
|
479
|
+
readonly title: "Backup — Initiate Import — payload";
|
|
480
|
+
readonly description: "Asks the recipient to open a slot for an encrypted bundle the producer is about to upload — by an HTTPS address (`stream`) or chunk by chunk over Trust Task documents (`chunkedTrustTask`) — pre-committing the digest and size, and for a chunked upload the chunk manifest, so the transfer is verifiable. The outer document members (id, type, issuer, recipient, issuedAt, expiresAt, proof) are owned by the framework — SPEC §6.3.";
|
|
481
|
+
readonly type: "object";
|
|
482
|
+
readonly additionalProperties: false;
|
|
483
|
+
readonly required: readonly ["expectedSha256", "expectedSizeBytes"];
|
|
484
|
+
readonly properties: {
|
|
485
|
+
readonly expectedSha256: {
|
|
486
|
+
readonly $ref: "#/$defs/ExpectedSha256";
|
|
487
|
+
readonly description: "Lowercase hex SHA-256 of the whole bundle about to be uploaded, committed before the upload begins. The recipient refuses bytes that hash differently, which is what bounds the damage from a leaked write token or a substituted chunk. 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.";
|
|
488
|
+
};
|
|
489
|
+
readonly expectedSizeBytes: {
|
|
490
|
+
readonly $ref: "#/$defs/ExpectedSizeBytes";
|
|
491
|
+
readonly description: "Byte count of the upload. Lets the recipient size the slot and refuse a truncated or oversized transfer without hashing it first.";
|
|
492
|
+
};
|
|
493
|
+
readonly algorithm: {
|
|
494
|
+
readonly type: "string";
|
|
495
|
+
readonly minLength: 1;
|
|
496
|
+
readonly maxLength: 64;
|
|
497
|
+
readonly description: "Requested transport mechanism — how the bytes move, not how they are encrypted. This version defines `stream` (what an absent member means) and `chunkedTrustTask`. 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.";
|
|
498
|
+
};
|
|
499
|
+
readonly chunks: {
|
|
500
|
+
readonly $ref: "#/$defs/ChunkManifest";
|
|
501
|
+
readonly description: "The chunk manifest the upload will follow. REQUIRED when `algorithm` is `chunkedTrustTask` and forbidden otherwise — a rule over two members that this schema does not express; a recipient refuses a violation with invalidManifest. Pre-committed for the same reason the whole-bundle digest is: the recipient knows what each chunk must be before it receives any.";
|
|
502
|
+
};
|
|
503
|
+
readonly ext: {
|
|
504
|
+
readonly $ref: "#/$defs/Ext";
|
|
505
|
+
readonly description: "Ecosystem-defined extension members per SPEC.md §4.5.1.";
|
|
506
|
+
};
|
|
507
|
+
};
|
|
508
|
+
readonly $defs: {
|
|
509
|
+
readonly Response: {
|
|
510
|
+
readonly $anchor: "response";
|
|
511
|
+
readonly title: "Backup — Initiate Import — response payload";
|
|
512
|
+
readonly type: "object";
|
|
513
|
+
readonly additionalProperties: false;
|
|
514
|
+
readonly required: readonly ["descriptor"];
|
|
515
|
+
readonly properties: {
|
|
516
|
+
readonly descriptor: {
|
|
517
|
+
readonly $ref: "#/$defs/BundleDescriptor";
|
|
518
|
+
readonly description: "Where or how to write the bytes, on what terms, and until when.";
|
|
519
|
+
};
|
|
520
|
+
readonly completionHint: {
|
|
521
|
+
readonly type: "string";
|
|
522
|
+
readonly maxLength: 1024;
|
|
523
|
+
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.";
|
|
524
|
+
};
|
|
525
|
+
readonly ext: {
|
|
526
|
+
readonly $ref: "#/$defs/Ext";
|
|
527
|
+
readonly description: "Ecosystem-defined extension members per SPEC.md §4.5.1.";
|
|
528
|
+
};
|
|
529
|
+
};
|
|
530
|
+
};
|
|
531
|
+
readonly Ext: {
|
|
532
|
+
readonly title: "Ext";
|
|
533
|
+
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.";
|
|
534
|
+
readonly type: "object";
|
|
535
|
+
readonly minProperties: 1;
|
|
536
|
+
readonly additionalProperties: true;
|
|
537
|
+
readonly propertyNames: {
|
|
538
|
+
readonly pattern: "^[a-z][a-z0-9-]*(\\.[a-z0-9-]+)+$";
|
|
539
|
+
};
|
|
540
|
+
};
|
|
541
|
+
readonly BundleDescriptor: {
|
|
542
|
+
readonly title: "BundleDescriptor";
|
|
543
|
+
readonly description: "The control-plane account of a bundle transfer: which algorithm, on what terms, until when. Exactly one of the two shapes — they are mutually exclusive, since StreamDescriptor requires `transportUrl` and `transportToken` and forbids `chunks`, and ChunkedDescriptor requires `chunks` and forbids both.";
|
|
544
|
+
readonly oneOf: readonly [{
|
|
545
|
+
readonly $ref: "#/$defs/StreamDescriptor";
|
|
546
|
+
}, {
|
|
547
|
+
readonly $ref: "#/$defs/ChunkedDescriptor";
|
|
548
|
+
}];
|
|
549
|
+
};
|
|
550
|
+
readonly ChunkedDescriptor: {
|
|
551
|
+
readonly title: "ChunkedDescriptor";
|
|
552
|
+
readonly type: "object";
|
|
553
|
+
readonly additionalProperties: false;
|
|
554
|
+
readonly description: "A descriptor for the `chunkedTrustTask` algorithm. Carries no address and no bearer token: every chunk moves in a Trust Task document whose sender the transport authenticates, so possession of a token would add nothing and would be one more secret to leak.";
|
|
555
|
+
readonly required: readonly ["bundleId", "algorithm", "chunks", "expectedSha256", "expectedSizeBytes", "expiresAt"];
|
|
556
|
+
readonly properties: {
|
|
557
|
+
readonly bundleId: {
|
|
558
|
+
readonly $ref: "#/$defs/BundleId";
|
|
559
|
+
};
|
|
560
|
+
readonly algorithm: {
|
|
561
|
+
readonly type: "string";
|
|
562
|
+
readonly enum: readonly ["chunkedTrustTask"];
|
|
563
|
+
readonly description: "Discriminates this shape from StreamDescriptor.";
|
|
564
|
+
};
|
|
565
|
+
readonly chunks: {
|
|
566
|
+
readonly $ref: "#/$defs/ChunkManifest";
|
|
567
|
+
};
|
|
568
|
+
readonly expectedSha256: {
|
|
569
|
+
readonly $ref: "#/$defs/ExpectedSha256";
|
|
570
|
+
};
|
|
571
|
+
readonly expectedSizeBytes: {
|
|
572
|
+
readonly $ref: "#/$defs/ExpectedSizeBytes";
|
|
573
|
+
};
|
|
574
|
+
readonly expiresAt: {
|
|
575
|
+
readonly $ref: "#/$defs/ExpiresAt";
|
|
576
|
+
};
|
|
577
|
+
};
|
|
578
|
+
};
|
|
579
|
+
readonly ExpiresAt: {
|
|
580
|
+
readonly title: "ExpiresAt";
|
|
581
|
+
readonly description: "After which the bundle is collected: staged bytes discarded, tokens and chunk requests refused. Short by design. For a chunked transfer a recipient may move it later as chunks are exchanged, never past its own ceiling — each chunk response reports the current value.";
|
|
582
|
+
readonly type: "string";
|
|
583
|
+
readonly format: "date-time";
|
|
584
|
+
};
|
|
585
|
+
readonly ExpectedSizeBytes: {
|
|
586
|
+
readonly title: "ExpectedSizeBytes";
|
|
587
|
+
readonly description: "Total byte count of the bundle. A zero-length bundle is not a degenerate success — nothing was serialized — so the floor is 1.";
|
|
588
|
+
readonly type: "integer";
|
|
589
|
+
readonly minimum: 1;
|
|
590
|
+
};
|
|
591
|
+
readonly ExpectedSha256: {
|
|
592
|
+
readonly title: "ExpectedSha256";
|
|
593
|
+
readonly description: "Lowercase hex SHA-256 of the whole bundle's bytes. Kept in the hex form the 1.0 descriptor published rather than moved to DigestMultibase, because it is an unchanged member of an existing descriptor and re-encoding it would break every stream producer for no gain in what it checks. For a chunked transfer it is the check over the reassembled bundle, applied after every chunk has verified individually, so that a correct set of chunks assembled in the wrong order is still caught.";
|
|
594
|
+
readonly type: "string";
|
|
595
|
+
readonly pattern: "^[0-9a-f]{64}$";
|
|
596
|
+
};
|
|
597
|
+
readonly ChunkManifest: {
|
|
598
|
+
readonly title: "ChunkManifest";
|
|
599
|
+
readonly description: "The terms of a `chunkedTrustTask` transfer, committed before any chunk moves. On export the recipient states them in the descriptor; on import the producer pre-commits them in the request and the recipient echoes them. Either way the manifest arrives in a document whose proof is REQUIRED, so the per-chunk digests are authenticated by the party that computed them and each chunk can be verified — and a single bad chunk re-fetched or refused — on arrival rather than only after reassembly.\n\nConsistency rules JSON Schema cannot state: `chunkCount` MUST equal ceil(expectedSizeBytes / chunkSize) for the bundle the manifest describes, and `chunkDigests` MUST have exactly `chunkCount` items. A party receiving a manifest violating either MUST refuse it.";
|
|
600
|
+
readonly type: "object";
|
|
601
|
+
readonly additionalProperties: false;
|
|
602
|
+
readonly required: readonly ["chunkSize", "chunkCount", "chunkDigests"];
|
|
603
|
+
readonly properties: {
|
|
604
|
+
readonly chunkSize: {
|
|
605
|
+
readonly $ref: "#/$defs/ChunkSize";
|
|
606
|
+
};
|
|
607
|
+
readonly chunkCount: {
|
|
608
|
+
readonly $ref: "#/$defs/ChunkCount";
|
|
609
|
+
};
|
|
610
|
+
readonly chunkDigests: {
|
|
611
|
+
readonly type: "array";
|
|
612
|
+
readonly minItems: 1;
|
|
613
|
+
readonly maxItems: 4096;
|
|
614
|
+
readonly description: "Digest of each chunk's raw bytes (not of its base64url encoding), in index order. Compared as decoded multihash bytes, never as encoded strings. sha2-256 is RECOMMENDED and MUST be implemented by every party; a party that does not implement the hash a digest names MUST treat the manifest as unverifiable rather than skip the check.";
|
|
615
|
+
readonly items: {
|
|
616
|
+
readonly $ref: "#/$defs/DigestMultibase";
|
|
617
|
+
};
|
|
618
|
+
};
|
|
619
|
+
};
|
|
620
|
+
};
|
|
621
|
+
readonly ChunkCount: {
|
|
622
|
+
readonly title: "ChunkCount";
|
|
623
|
+
readonly description: "Number of chunks in the bundle, equal to ceil(expectedSizeBytes / chunkSize). Bounded at 4096 so that the manifest itself — one digest per chunk — fits in the single document that carries it under the same message-size reasoning as a chunk.";
|
|
624
|
+
readonly type: "integer";
|
|
625
|
+
readonly minimum: 1;
|
|
626
|
+
readonly maximum: 4096;
|
|
627
|
+
};
|
|
628
|
+
readonly ChunkSize: {
|
|
629
|
+
readonly title: "ChunkSize";
|
|
630
|
+
readonly description: "Size in bytes of every chunk except the last, which carries the remainder and is between 1 and this value inclusive. The ceiling of 262144 (256 KiB) is normative and is derived in `vta/backup/initiate-export/1.1` under Chunked transfer: it is the largest power of two whose `get-chunk` or `put-chunk` document still fits a 1 MiB mediator message after base64url encoding of `data`, DIDComm authcrypt encoding, and two nested forward wrappers. The floor of 16384 keeps a 1 GiB bundle within `ChunkCount`'s ceiling at sizes a constrained transport can still choose.";
|
|
631
|
+
readonly type: "integer";
|
|
632
|
+
readonly minimum: 16384;
|
|
633
|
+
readonly maximum: 262144;
|
|
634
|
+
};
|
|
635
|
+
readonly DigestMultibase: {
|
|
636
|
+
readonly title: "DigestMultibase";
|
|
637
|
+
readonly description: "A cryptographic digest as a multibase-encoded multihash — the encoding the W3C Verifiable Credentials Data Model 2.0 defines for `digestMultibase`, and the one `did:webvh` uses for its SCID and entry hashes.\n\nMultihash carries the hash algorithm in-band, so the value is self-describing and the wire format survives an algorithm change without a schema revision; multibase does the same for the base encoding, so a verifier never infers base58 from base64url by context. A bare hex string or a `sha-256:`-style prefix hard-codes one algorithm into the wire contract and is non-conforming here.\n\nThis definition constrains the *encoding only*. What the digest is computed over is stated by each referencing field, because it differs legitimately: a digest over a JSON document is taken over its RFC 8785 (JCS) canonicalization, while a digest over an opaque artifact is taken over its bytes. A field whose input is a JSON document and which does not name a canonicalization is not reproducible.\n\nRestricted to the two multibase headers W3C Controlled Identifiers 1.0 §2.4 normatively requires — `z` (base58btc) and `u` (base64url-no-pad). CID permits others but states that \"interoperability is not guaranteed between implementations using such values\", and a registry whose purpose is interoperability should not mint digests a conforming verifier may be unable to read. The alphabets are enforced rather than assumed: base58btc excludes 0, O, I and l, and an earlier permissive pattern let three published examples carry digests that were not valid base58 at all. base58btc is RECOMMENDED, for consistency with `did:key` and `did:webvh`.";
|
|
638
|
+
readonly type: "string";
|
|
639
|
+
readonly minLength: 16;
|
|
640
|
+
readonly pattern: "^(z[1-9A-HJ-NP-Za-km-z]+|u[A-Za-z0-9_-]+)$";
|
|
641
|
+
readonly examples: readonly ["zQmbWqxBEKC3P8tqsKc98xmWNzrzDtRLMiMPL8wBuTGsMnR"];
|
|
642
|
+
};
|
|
643
|
+
readonly BundleId: {
|
|
644
|
+
readonly title: "BundleId";
|
|
645
|
+
readonly description: "Handle for a bundle across its whole lifecycle. Recipient-generated and unguessable, which is what lets an unauthorized reference be answered as not-found without confirming existence. Opaque: a producer quotes what it was given and must not derive, guess or enumerate one.";
|
|
646
|
+
readonly type: "string";
|
|
647
|
+
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}$";
|
|
648
|
+
};
|
|
649
|
+
readonly StreamDescriptor: {
|
|
650
|
+
readonly title: "StreamDescriptor";
|
|
651
|
+
readonly type: "object";
|
|
652
|
+
readonly additionalProperties: false;
|
|
653
|
+
readonly description: "A descriptor for a transfer that happens outside Trust Task documents, at an address the recipient publishes — the `stream` algorithm, and any other algorithm a recipient offers that is shaped as an address plus a bearer credential. Identical in members to the `vta/backup/*/1.0` descriptor.";
|
|
654
|
+
readonly required: readonly ["bundleId", "algorithm", "transportUrl", "transportToken", "expectedSha256", "expectedSizeBytes", "expiresAt"];
|
|
655
|
+
readonly properties: {
|
|
656
|
+
readonly bundleId: {
|
|
657
|
+
readonly $ref: "#/$defs/BundleId";
|
|
658
|
+
};
|
|
659
|
+
readonly algorithm: {
|
|
660
|
+
readonly type: "string";
|
|
661
|
+
readonly minLength: 1;
|
|
662
|
+
readonly maxLength: 64;
|
|
663
|
+
readonly description: "The mechanism in use. Never `chunkedTrustTask`, which has its own descriptor shape; a descriptor naming it with a transport address is malformed.";
|
|
664
|
+
};
|
|
665
|
+
readonly transportUrl: {
|
|
666
|
+
readonly type: "string";
|
|
667
|
+
readonly format: "uri";
|
|
668
|
+
readonly maxLength: 2048;
|
|
669
|
+
readonly description: "Where to fetch (export) or write (import) the bytes. A recipient with no address at which it is reachable cannot produce this and refuses with transportUnavailable rather than returning an unusable one. An import address is write-only: staged bytes are never served back from it.";
|
|
670
|
+
};
|
|
671
|
+
readonly transportToken: {
|
|
672
|
+
readonly type: "string";
|
|
673
|
+
readonly minLength: 1;
|
|
674
|
+
readonly maxLength: 1024;
|
|
675
|
+
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, and should accept an export token once.";
|
|
676
|
+
};
|
|
677
|
+
readonly expectedSha256: {
|
|
678
|
+
readonly $ref: "#/$defs/ExpectedSha256";
|
|
679
|
+
};
|
|
680
|
+
readonly expectedSizeBytes: {
|
|
681
|
+
readonly $ref: "#/$defs/ExpectedSizeBytes";
|
|
682
|
+
};
|
|
683
|
+
readonly expiresAt: {
|
|
684
|
+
readonly $ref: "#/$defs/ExpiresAt";
|
|
685
|
+
};
|
|
686
|
+
};
|
|
687
|
+
};
|
|
688
|
+
};
|
|
689
|
+
};
|
|
690
|
+
};
|
|
691
|
+
/**
|
|
692
|
+
* SPEC.md §7.2 policy for the success-response variant. `isRecipientRequired`
|
|
693
|
+
* tracks the *issuer* party's requirement because a response swaps the
|
|
694
|
+
* parties (§7.3 item 5).
|
|
695
|
+
*/
|
|
696
|
+
export declare const RESPONSE_SPEC: {
|
|
697
|
+
readonly typeUri: "https://trusttasks.org/spec/backup/initiate-import/0.1#response";
|
|
698
|
+
readonly isBearer: false;
|
|
699
|
+
readonly isProofRequired: true;
|
|
700
|
+
readonly isRecipientRequired: true;
|
|
701
|
+
readonly isIssuedAtRequired: true;
|
|
702
|
+
readonly payloadSchema: {
|
|
703
|
+
readonly $schema: "https://json-schema.org/draft/2020-12/schema";
|
|
704
|
+
readonly $ref: "#/$defs/Response";
|
|
705
|
+
readonly $defs: {
|
|
706
|
+
readonly Response: {
|
|
707
|
+
readonly $anchor: "response";
|
|
708
|
+
readonly title: "Backup — Initiate Import — response payload";
|
|
709
|
+
readonly type: "object";
|
|
710
|
+
readonly additionalProperties: false;
|
|
711
|
+
readonly required: readonly ["descriptor"];
|
|
712
|
+
readonly properties: {
|
|
713
|
+
readonly descriptor: {
|
|
714
|
+
readonly $ref: "#/$defs/BundleDescriptor";
|
|
715
|
+
readonly description: "Where or how to write the bytes, on what terms, and until when.";
|
|
716
|
+
};
|
|
717
|
+
readonly completionHint: {
|
|
718
|
+
readonly type: "string";
|
|
719
|
+
readonly maxLength: 1024;
|
|
720
|
+
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.";
|
|
721
|
+
};
|
|
722
|
+
readonly ext: {
|
|
723
|
+
readonly $ref: "#/$defs/Ext";
|
|
724
|
+
readonly description: "Ecosystem-defined extension members per SPEC.md §4.5.1.";
|
|
725
|
+
};
|
|
726
|
+
};
|
|
727
|
+
};
|
|
728
|
+
readonly Ext: {
|
|
729
|
+
readonly title: "Ext";
|
|
730
|
+
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.";
|
|
731
|
+
readonly type: "object";
|
|
732
|
+
readonly minProperties: 1;
|
|
733
|
+
readonly additionalProperties: true;
|
|
734
|
+
readonly propertyNames: {
|
|
735
|
+
readonly pattern: "^[a-z][a-z0-9-]*(\\.[a-z0-9-]+)+$";
|
|
736
|
+
};
|
|
737
|
+
};
|
|
738
|
+
readonly BundleDescriptor: {
|
|
739
|
+
readonly title: "BundleDescriptor";
|
|
740
|
+
readonly description: "The control-plane account of a bundle transfer: which algorithm, on what terms, until when. Exactly one of the two shapes — they are mutually exclusive, since StreamDescriptor requires `transportUrl` and `transportToken` and forbids `chunks`, and ChunkedDescriptor requires `chunks` and forbids both.";
|
|
741
|
+
readonly oneOf: readonly [{
|
|
742
|
+
readonly $ref: "#/$defs/StreamDescriptor";
|
|
743
|
+
}, {
|
|
744
|
+
readonly $ref: "#/$defs/ChunkedDescriptor";
|
|
745
|
+
}];
|
|
746
|
+
};
|
|
747
|
+
readonly ChunkedDescriptor: {
|
|
748
|
+
readonly title: "ChunkedDescriptor";
|
|
749
|
+
readonly type: "object";
|
|
750
|
+
readonly additionalProperties: false;
|
|
751
|
+
readonly description: "A descriptor for the `chunkedTrustTask` algorithm. Carries no address and no bearer token: every chunk moves in a Trust Task document whose sender the transport authenticates, so possession of a token would add nothing and would be one more secret to leak.";
|
|
752
|
+
readonly required: readonly ["bundleId", "algorithm", "chunks", "expectedSha256", "expectedSizeBytes", "expiresAt"];
|
|
753
|
+
readonly properties: {
|
|
754
|
+
readonly bundleId: {
|
|
755
|
+
readonly $ref: "#/$defs/BundleId";
|
|
756
|
+
};
|
|
757
|
+
readonly algorithm: {
|
|
758
|
+
readonly type: "string";
|
|
759
|
+
readonly enum: readonly ["chunkedTrustTask"];
|
|
760
|
+
readonly description: "Discriminates this shape from StreamDescriptor.";
|
|
761
|
+
};
|
|
762
|
+
readonly chunks: {
|
|
763
|
+
readonly $ref: "#/$defs/ChunkManifest";
|
|
764
|
+
};
|
|
765
|
+
readonly expectedSha256: {
|
|
766
|
+
readonly $ref: "#/$defs/ExpectedSha256";
|
|
767
|
+
};
|
|
768
|
+
readonly expectedSizeBytes: {
|
|
769
|
+
readonly $ref: "#/$defs/ExpectedSizeBytes";
|
|
770
|
+
};
|
|
771
|
+
readonly expiresAt: {
|
|
772
|
+
readonly $ref: "#/$defs/ExpiresAt";
|
|
773
|
+
};
|
|
774
|
+
};
|
|
775
|
+
};
|
|
776
|
+
readonly ExpiresAt: {
|
|
777
|
+
readonly title: "ExpiresAt";
|
|
778
|
+
readonly description: "After which the bundle is collected: staged bytes discarded, tokens and chunk requests refused. Short by design. For a chunked transfer a recipient may move it later as chunks are exchanged, never past its own ceiling — each chunk response reports the current value.";
|
|
779
|
+
readonly type: "string";
|
|
780
|
+
readonly format: "date-time";
|
|
781
|
+
};
|
|
782
|
+
readonly ExpectedSizeBytes: {
|
|
783
|
+
readonly title: "ExpectedSizeBytes";
|
|
784
|
+
readonly description: "Total byte count of the bundle. A zero-length bundle is not a degenerate success — nothing was serialized — so the floor is 1.";
|
|
785
|
+
readonly type: "integer";
|
|
786
|
+
readonly minimum: 1;
|
|
787
|
+
};
|
|
788
|
+
readonly ExpectedSha256: {
|
|
789
|
+
readonly title: "ExpectedSha256";
|
|
790
|
+
readonly description: "Lowercase hex SHA-256 of the whole bundle's bytes. Kept in the hex form the 1.0 descriptor published rather than moved to DigestMultibase, because it is an unchanged member of an existing descriptor and re-encoding it would break every stream producer for no gain in what it checks. For a chunked transfer it is the check over the reassembled bundle, applied after every chunk has verified individually, so that a correct set of chunks assembled in the wrong order is still caught.";
|
|
791
|
+
readonly type: "string";
|
|
792
|
+
readonly pattern: "^[0-9a-f]{64}$";
|
|
793
|
+
};
|
|
794
|
+
readonly ChunkManifest: {
|
|
795
|
+
readonly title: "ChunkManifest";
|
|
796
|
+
readonly description: "The terms of a `chunkedTrustTask` transfer, committed before any chunk moves. On export the recipient states them in the descriptor; on import the producer pre-commits them in the request and the recipient echoes them. Either way the manifest arrives in a document whose proof is REQUIRED, so the per-chunk digests are authenticated by the party that computed them and each chunk can be verified — and a single bad chunk re-fetched or refused — on arrival rather than only after reassembly.\n\nConsistency rules JSON Schema cannot state: `chunkCount` MUST equal ceil(expectedSizeBytes / chunkSize) for the bundle the manifest describes, and `chunkDigests` MUST have exactly `chunkCount` items. A party receiving a manifest violating either MUST refuse it.";
|
|
797
|
+
readonly type: "object";
|
|
798
|
+
readonly additionalProperties: false;
|
|
799
|
+
readonly required: readonly ["chunkSize", "chunkCount", "chunkDigests"];
|
|
800
|
+
readonly properties: {
|
|
801
|
+
readonly chunkSize: {
|
|
802
|
+
readonly $ref: "#/$defs/ChunkSize";
|
|
803
|
+
};
|
|
804
|
+
readonly chunkCount: {
|
|
805
|
+
readonly $ref: "#/$defs/ChunkCount";
|
|
806
|
+
};
|
|
807
|
+
readonly chunkDigests: {
|
|
808
|
+
readonly type: "array";
|
|
809
|
+
readonly minItems: 1;
|
|
810
|
+
readonly maxItems: 4096;
|
|
811
|
+
readonly description: "Digest of each chunk's raw bytes (not of its base64url encoding), in index order. Compared as decoded multihash bytes, never as encoded strings. sha2-256 is RECOMMENDED and MUST be implemented by every party; a party that does not implement the hash a digest names MUST treat the manifest as unverifiable rather than skip the check.";
|
|
812
|
+
readonly items: {
|
|
813
|
+
readonly $ref: "#/$defs/DigestMultibase";
|
|
814
|
+
};
|
|
815
|
+
};
|
|
816
|
+
};
|
|
817
|
+
};
|
|
818
|
+
readonly ChunkCount: {
|
|
819
|
+
readonly title: "ChunkCount";
|
|
820
|
+
readonly description: "Number of chunks in the bundle, equal to ceil(expectedSizeBytes / chunkSize). Bounded at 4096 so that the manifest itself — one digest per chunk — fits in the single document that carries it under the same message-size reasoning as a chunk.";
|
|
821
|
+
readonly type: "integer";
|
|
822
|
+
readonly minimum: 1;
|
|
823
|
+
readonly maximum: 4096;
|
|
824
|
+
};
|
|
825
|
+
readonly ChunkSize: {
|
|
826
|
+
readonly title: "ChunkSize";
|
|
827
|
+
readonly description: "Size in bytes of every chunk except the last, which carries the remainder and is between 1 and this value inclusive. The ceiling of 262144 (256 KiB) is normative and is derived in `vta/backup/initiate-export/1.1` under Chunked transfer: it is the largest power of two whose `get-chunk` or `put-chunk` document still fits a 1 MiB mediator message after base64url encoding of `data`, DIDComm authcrypt encoding, and two nested forward wrappers. The floor of 16384 keeps a 1 GiB bundle within `ChunkCount`'s ceiling at sizes a constrained transport can still choose.";
|
|
828
|
+
readonly type: "integer";
|
|
829
|
+
readonly minimum: 16384;
|
|
830
|
+
readonly maximum: 262144;
|
|
831
|
+
};
|
|
832
|
+
readonly DigestMultibase: {
|
|
833
|
+
readonly title: "DigestMultibase";
|
|
834
|
+
readonly description: "A cryptographic digest as a multibase-encoded multihash — the encoding the W3C Verifiable Credentials Data Model 2.0 defines for `digestMultibase`, and the one `did:webvh` uses for its SCID and entry hashes.\n\nMultihash carries the hash algorithm in-band, so the value is self-describing and the wire format survives an algorithm change without a schema revision; multibase does the same for the base encoding, so a verifier never infers base58 from base64url by context. A bare hex string or a `sha-256:`-style prefix hard-codes one algorithm into the wire contract and is non-conforming here.\n\nThis definition constrains the *encoding only*. What the digest is computed over is stated by each referencing field, because it differs legitimately: a digest over a JSON document is taken over its RFC 8785 (JCS) canonicalization, while a digest over an opaque artifact is taken over its bytes. A field whose input is a JSON document and which does not name a canonicalization is not reproducible.\n\nRestricted to the two multibase headers W3C Controlled Identifiers 1.0 §2.4 normatively requires — `z` (base58btc) and `u` (base64url-no-pad). CID permits others but states that \"interoperability is not guaranteed between implementations using such values\", and a registry whose purpose is interoperability should not mint digests a conforming verifier may be unable to read. The alphabets are enforced rather than assumed: base58btc excludes 0, O, I and l, and an earlier permissive pattern let three published examples carry digests that were not valid base58 at all. base58btc is RECOMMENDED, for consistency with `did:key` and `did:webvh`.";
|
|
835
|
+
readonly type: "string";
|
|
836
|
+
readonly minLength: 16;
|
|
837
|
+
readonly pattern: "^(z[1-9A-HJ-NP-Za-km-z]+|u[A-Za-z0-9_-]+)$";
|
|
838
|
+
readonly examples: readonly ["zQmbWqxBEKC3P8tqsKc98xmWNzrzDtRLMiMPL8wBuTGsMnR"];
|
|
839
|
+
};
|
|
840
|
+
readonly BundleId: {
|
|
841
|
+
readonly title: "BundleId";
|
|
842
|
+
readonly description: "Handle for a bundle across its whole lifecycle. Recipient-generated and unguessable, which is what lets an unauthorized reference be answered as not-found without confirming existence. Opaque: a producer quotes what it was given and must not derive, guess or enumerate one.";
|
|
843
|
+
readonly type: "string";
|
|
844
|
+
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}$";
|
|
845
|
+
};
|
|
846
|
+
readonly StreamDescriptor: {
|
|
847
|
+
readonly title: "StreamDescriptor";
|
|
848
|
+
readonly type: "object";
|
|
849
|
+
readonly additionalProperties: false;
|
|
850
|
+
readonly description: "A descriptor for a transfer that happens outside Trust Task documents, at an address the recipient publishes — the `stream` algorithm, and any other algorithm a recipient offers that is shaped as an address plus a bearer credential. Identical in members to the `vta/backup/*/1.0` descriptor.";
|
|
851
|
+
readonly required: readonly ["bundleId", "algorithm", "transportUrl", "transportToken", "expectedSha256", "expectedSizeBytes", "expiresAt"];
|
|
852
|
+
readonly properties: {
|
|
853
|
+
readonly bundleId: {
|
|
854
|
+
readonly $ref: "#/$defs/BundleId";
|
|
855
|
+
};
|
|
856
|
+
readonly algorithm: {
|
|
857
|
+
readonly type: "string";
|
|
858
|
+
readonly minLength: 1;
|
|
859
|
+
readonly maxLength: 64;
|
|
860
|
+
readonly description: "The mechanism in use. Never `chunkedTrustTask`, which has its own descriptor shape; a descriptor naming it with a transport address is malformed.";
|
|
861
|
+
};
|
|
862
|
+
readonly transportUrl: {
|
|
863
|
+
readonly type: "string";
|
|
864
|
+
readonly format: "uri";
|
|
865
|
+
readonly maxLength: 2048;
|
|
866
|
+
readonly description: "Where to fetch (export) or write (import) the bytes. A recipient with no address at which it is reachable cannot produce this and refuses with transportUnavailable rather than returning an unusable one. An import address is write-only: staged bytes are never served back from it.";
|
|
867
|
+
};
|
|
868
|
+
readonly transportToken: {
|
|
869
|
+
readonly type: "string";
|
|
870
|
+
readonly minLength: 1;
|
|
871
|
+
readonly maxLength: 1024;
|
|
872
|
+
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, and should accept an export token once.";
|
|
873
|
+
};
|
|
874
|
+
readonly expectedSha256: {
|
|
875
|
+
readonly $ref: "#/$defs/ExpectedSha256";
|
|
876
|
+
};
|
|
877
|
+
readonly expectedSizeBytes: {
|
|
878
|
+
readonly $ref: "#/$defs/ExpectedSizeBytes";
|
|
879
|
+
};
|
|
880
|
+
readonly expiresAt: {
|
|
881
|
+
readonly $ref: "#/$defs/ExpiresAt";
|
|
882
|
+
};
|
|
883
|
+
};
|
|
884
|
+
};
|
|
885
|
+
};
|
|
886
|
+
};
|
|
887
|
+
};
|
|
888
|
+
//# sourceMappingURL=payload.d.ts.map
|