@openvtc/trust-tasks 0.26.8 → 0.26.10
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 +126 -0
- package/dist/_shared/components.d.ts +43 -0
- package/dist/_shared/components.d.ts.map +1 -1
- package/dist/external/credentials/issue/0.3/payload.d.ts +1523 -0
- package/dist/external/credentials/issue/0.3/payload.d.ts.map +1 -0
- package/dist/external/credentials/issue/0.3/payload.js +847 -0
- package/dist/external/credentials/issue/0.3/payload.js.map +1 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4 -0
- package/dist/index.js.map +1 -1
- package/dist/vtc/_shared/0.1/admission.d.ts +16 -0
- package/dist/vtc/_shared/0.1/admission.d.ts.map +1 -0
- package/dist/vtc/_shared/0.1/admission.js +6 -0
- package/dist/vtc/_shared/0.1/admission.js.map +1 -0
- package/dist/vtc/members/admit/0.1/payload.d.ts +481 -0
- package/dist/vtc/members/admit/0.1/payload.d.ts.map +1 -0
- package/dist/vtc/members/admit/0.1/payload.js +281 -0
- package/dist/vtc/members/admit/0.1/payload.js.map +1 -0
- package/dist/vtc/members/make-membership/0.1/payload.d.ts +447 -0
- package/dist/vtc/members/make-membership/0.1/payload.d.ts.map +1 -0
- package/dist/vtc/members/make-membership/0.1/payload.js +267 -0
- package/dist/vtc/members/make-membership/0.1/payload.js.map +1 -0
- package/package.json +1 -1
- package/src/_shared/components.ts +43 -0
- package/src/external/credentials/issue/0.3/payload.ts +999 -0
- package/src/index.ts +4 -0
- package/src/vtc/_shared/0.1/admission.ts +17 -0
- package/src/vtc/members/admit/0.1/payload.ts +326 -0
- package/src/vtc/members/make-membership/0.1/payload.ts +304 -0
|
@@ -0,0 +1,999 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Generated by scripts/build-ts-bindings.mjs — DO NOT EDIT BY HAND.
|
|
3
|
+
* Source: specs/external/credentials/issue/0.3/payload.schema.json
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
import type { AccountContextId, AccountId, CredentialScope, Ext, ProviderObjectAction, ProviderObjectPrefix } from "../../../../_shared/components.js";
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* Obtain a short-lived, downscoped provider credential from an external account, sealed to the caller: session or token credentials under `scope`, or a batch of presigned requests on one object under `presign`. The outer document members are owned by the framework — SPEC §6.3.
|
|
11
|
+
*/
|
|
12
|
+
export type ExternalCredentialsIssuePayload = {
|
|
13
|
+
context: AccountContextId;
|
|
14
|
+
account: AccountId;
|
|
15
|
+
/**
|
|
16
|
+
* For every brokered model but `s3-static-presign`: the prefix and actions, or the OAuth scopes, the session or token is downscoped to. `objectKey` is not used in this version.
|
|
17
|
+
*/
|
|
18
|
+
scope?: CredentialScope;
|
|
19
|
+
presign?: PresignBatch;
|
|
20
|
+
/**
|
|
21
|
+
* Requested lifetime; never more than the binding's `maxTtlSeconds`. For `presign`, the lifetime of every URL in the batch.
|
|
22
|
+
*/
|
|
23
|
+
ttlSeconds: number;
|
|
24
|
+
ext?: Ext;
|
|
25
|
+
} & {
|
|
26
|
+
[k: string]: unknown | undefined;
|
|
27
|
+
};
|
|
28
|
+
/**
|
|
29
|
+
* One operation to presign, discriminated by `operation`. The ceiling action each needs is in `PresignOperation`.
|
|
30
|
+
*/
|
|
31
|
+
export type PresignRequest =
|
|
32
|
+
| PresignPut
|
|
33
|
+
| PresignGet
|
|
34
|
+
| PresignHead
|
|
35
|
+
| PresignDelete
|
|
36
|
+
| PresignCreateMultipart
|
|
37
|
+
| PresignUploadPart
|
|
38
|
+
| PresignListParts
|
|
39
|
+
| PresignCompleteMultipart
|
|
40
|
+
| PresignAbortMultipart;
|
|
41
|
+
/**
|
|
42
|
+
* A SHA-256 digest in standard base64 (RFC 4648 §4, padded), as S3 carries it in `x-amz-checksum-sha256`.
|
|
43
|
+
*/
|
|
44
|
+
export type ChecksumSha256 = string;
|
|
45
|
+
export type ExternalCredentialsIssueResponsePayload = {
|
|
46
|
+
[k: string]: unknown | undefined;
|
|
47
|
+
};
|
|
48
|
+
|
|
49
|
+
/**
|
|
50
|
+
* `s3-static-presign` only: up to 64 operations on **one** object, `prefix` + `objectKey`, and at most one multipart upload of it. Each operation becomes one presigned request, sealed together. Consistency rules JSON Schema cannot state, which the custodian enforces: `uploadId` is present exactly when an operation needs it (`upload-part`, `list-parts`, `complete-multipart`, `abort-multipart`) and absent when the batch holds `create-multipart`; no two operations are identical; no two `upload-part` operations name the same `partNumber`.
|
|
51
|
+
*/
|
|
52
|
+
export interface PresignBatch {
|
|
53
|
+
prefix: ProviderObjectPrefix;
|
|
54
|
+
/**
|
|
55
|
+
* The object's name within `prefix`. Every request in the batch names `prefix` + `objectKey` and no other object.
|
|
56
|
+
*/
|
|
57
|
+
objectKey: string;
|
|
58
|
+
/**
|
|
59
|
+
* The multipart upload the batch's multipart operations act on, as storage returned it from CreateMultipartUpload. Signed into each such request's query, percent-encoded by the SigV4 encoder, never interpolated.
|
|
60
|
+
*/
|
|
61
|
+
uploadId?: string;
|
|
62
|
+
/**
|
|
63
|
+
* At most 64. Each presigned request is bearer authority until it expires, so a batch holds what a consumer can use within its lifetime; a larger upload asks again, or writes larger parts. A batch whose sealed answer would exceed `sealedCredential`'s bound is refused with `responseTooLarge`, whatever its count.
|
|
64
|
+
*
|
|
65
|
+
* @minItems 1
|
|
66
|
+
* @maxItems 64
|
|
67
|
+
*/
|
|
68
|
+
requests: [PresignRequest, ...PresignRequest[]];
|
|
69
|
+
}
|
|
70
|
+
/**
|
|
71
|
+
* PutObject of the whole object, bound to its exact length and SHA-256.
|
|
72
|
+
*/
|
|
73
|
+
export interface PresignPut {
|
|
74
|
+
operation: "put";
|
|
75
|
+
/**
|
|
76
|
+
* The object's exact length in bytes, signed into the request as `Content-Length`. At most 5 GiB, S3's single-request ceiling.
|
|
77
|
+
*/
|
|
78
|
+
contentLength: number;
|
|
79
|
+
checksumSha256: ChecksumSha256;
|
|
80
|
+
}
|
|
81
|
+
/**
|
|
82
|
+
* GetObject.
|
|
83
|
+
*/
|
|
84
|
+
export interface PresignGet {
|
|
85
|
+
operation: "get";
|
|
86
|
+
}
|
|
87
|
+
/**
|
|
88
|
+
* HeadObject, with `x-amz-checksum-mode: ENABLED` signed so storage reports the object's checksum.
|
|
89
|
+
*/
|
|
90
|
+
export interface PresignHead {
|
|
91
|
+
operation: "head";
|
|
92
|
+
}
|
|
93
|
+
/**
|
|
94
|
+
* DeleteObject.
|
|
95
|
+
*/
|
|
96
|
+
export interface PresignDelete {
|
|
97
|
+
operation: "delete";
|
|
98
|
+
}
|
|
99
|
+
/**
|
|
100
|
+
* CreateMultipartUpload, with `x-amz-checksum-algorithm: SHA256` signed so every part of the upload must carry a SHA-256 checksum.
|
|
101
|
+
*/
|
|
102
|
+
export interface PresignCreateMultipart {
|
|
103
|
+
operation: "create-multipart";
|
|
104
|
+
}
|
|
105
|
+
/**
|
|
106
|
+
* UploadPart of one part of `uploadId`, bound to its number, its exact length and its SHA-256.
|
|
107
|
+
*/
|
|
108
|
+
export interface PresignUploadPart {
|
|
109
|
+
operation: "upload-part";
|
|
110
|
+
partNumber: number;
|
|
111
|
+
/**
|
|
112
|
+
* The part's exact length in bytes, signed into the request as `Content-Length`. At most 5 GiB, S3's part ceiling.
|
|
113
|
+
*/
|
|
114
|
+
contentLength: number;
|
|
115
|
+
checksumSha256: ChecksumSha256;
|
|
116
|
+
}
|
|
117
|
+
/**
|
|
118
|
+
* ListParts of `uploadId`: each part's number, length, ETag and checksum, up to 1000 per page.
|
|
119
|
+
*/
|
|
120
|
+
export interface PresignListParts {
|
|
121
|
+
operation: "list-parts";
|
|
122
|
+
/**
|
|
123
|
+
* List parts after this number. Absent, from the first.
|
|
124
|
+
*/
|
|
125
|
+
partNumberMarker?: number;
|
|
126
|
+
}
|
|
127
|
+
/**
|
|
128
|
+
* CompleteMultipartUpload of `uploadId`, bound to the assembled object's exact length.
|
|
129
|
+
*/
|
|
130
|
+
export interface PresignCompleteMultipart {
|
|
131
|
+
operation: "complete-multipart";
|
|
132
|
+
/**
|
|
133
|
+
* The assembled object's exact length in bytes, signed into the request as `x-amz-mp-object-size`, so storage refuses a completion that would assemble any other size. At most 5 TiB, S3's object ceiling.
|
|
134
|
+
*/
|
|
135
|
+
contentLength: number;
|
|
136
|
+
}
|
|
137
|
+
/**
|
|
138
|
+
* AbortMultipartUpload of `uploadId`.
|
|
139
|
+
*/
|
|
140
|
+
export interface PresignAbortMultipart {
|
|
141
|
+
operation: "abort-multipart";
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
/** Shared definitions this specification references, re-exported under the names it used to declare them with. */
|
|
145
|
+
export type { AccountContextId, AccountId, CredentialScope, Ext, ProviderObjectAction, ProviderObjectPrefix };
|
|
146
|
+
|
|
147
|
+
/** Trust Task type URI. */
|
|
148
|
+
export const TYPE_URI = "https://trusttasks.org/spec/external/credentials/issue/0.3" as const;
|
|
149
|
+
|
|
150
|
+
/** Stable alias for this specification's request payload shape. */
|
|
151
|
+
export type Payload = ExternalCredentialsIssuePayload;
|
|
152
|
+
|
|
153
|
+
/** Trust Task response type URI (request type URI + "#response"). */
|
|
154
|
+
export const RESPONSE_TYPE_URI = "https://trusttasks.org/spec/external/credentials/issue/0.3#response" as const;
|
|
155
|
+
|
|
156
|
+
/** Stable alias for this specification's success-response payload shape. */
|
|
157
|
+
export type Response = ExternalCredentialsIssueResponsePayload;
|
|
158
|
+
|
|
159
|
+
/**
|
|
160
|
+
* This specification's payload schema, as a value.
|
|
161
|
+
*
|
|
162
|
+
* SPEC.md §7.2 item 2 is performed against this. It is shipped as data
|
|
163
|
+
* rather than only as a `.json` file because TypeScript types are erased
|
|
164
|
+
* at runtime: without a schema a consumer has nothing to validate, and
|
|
165
|
+
* every REQUIRED payload member is optional in practice. Cross-file
|
|
166
|
+
* `$ref`s are already inlined, so it needs no resolver.
|
|
167
|
+
*/
|
|
168
|
+
export const PAYLOAD_SCHEMA = {
|
|
169
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
170
|
+
"$id": "https://trusttasks.org/spec/external/credentials/issue/0.3",
|
|
171
|
+
"title": "External Credentials — Issue — payload",
|
|
172
|
+
"description": "Obtain a short-lived, downscoped provider credential from an external account, sealed to the caller: session or token credentials under `scope`, or a batch of presigned requests on one object under `presign`. The outer document members are owned by the framework — SPEC §6.3.",
|
|
173
|
+
"type": "object",
|
|
174
|
+
"additionalProperties": false,
|
|
175
|
+
"required": [
|
|
176
|
+
"context",
|
|
177
|
+
"account",
|
|
178
|
+
"ttlSeconds"
|
|
179
|
+
],
|
|
180
|
+
"oneOf": [
|
|
181
|
+
{
|
|
182
|
+
"required": [
|
|
183
|
+
"scope"
|
|
184
|
+
],
|
|
185
|
+
"not": {
|
|
186
|
+
"required": [
|
|
187
|
+
"presign"
|
|
188
|
+
]
|
|
189
|
+
}
|
|
190
|
+
},
|
|
191
|
+
{
|
|
192
|
+
"required": [
|
|
193
|
+
"presign"
|
|
194
|
+
],
|
|
195
|
+
"not": {
|
|
196
|
+
"required": [
|
|
197
|
+
"scope"
|
|
198
|
+
]
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
],
|
|
202
|
+
"properties": {
|
|
203
|
+
"context": {
|
|
204
|
+
"$ref": "#/$defs/AccountContextId"
|
|
205
|
+
},
|
|
206
|
+
"account": {
|
|
207
|
+
"$ref": "#/$defs/AccountId"
|
|
208
|
+
},
|
|
209
|
+
"scope": {
|
|
210
|
+
"$ref": "#/$defs/CredentialScope",
|
|
211
|
+
"description": "For every brokered model but `s3-static-presign`: the prefix and actions, or the OAuth scopes, the session or token is downscoped to. `objectKey` is not used in this version."
|
|
212
|
+
},
|
|
213
|
+
"presign": {
|
|
214
|
+
"$ref": "#/$defs/PresignBatch"
|
|
215
|
+
},
|
|
216
|
+
"ttlSeconds": {
|
|
217
|
+
"type": "integer",
|
|
218
|
+
"minimum": 60,
|
|
219
|
+
"maximum": 3600,
|
|
220
|
+
"description": "Requested lifetime; never more than the binding's `maxTtlSeconds`. For `presign`, the lifetime of every URL in the batch."
|
|
221
|
+
},
|
|
222
|
+
"ext": {
|
|
223
|
+
"$ref": "#/$defs/Ext"
|
|
224
|
+
}
|
|
225
|
+
},
|
|
226
|
+
"$defs": {
|
|
227
|
+
"ChecksumSha256": {
|
|
228
|
+
"title": "ChecksumSha256",
|
|
229
|
+
"type": "string",
|
|
230
|
+
"minLength": 44,
|
|
231
|
+
"maxLength": 44,
|
|
232
|
+
"pattern": "^[A-Za-z0-9+/]{43}=$",
|
|
233
|
+
"description": "A SHA-256 digest in standard base64 (RFC 4648 §4, padded), as S3 carries it in `x-amz-checksum-sha256`."
|
|
234
|
+
},
|
|
235
|
+
"PresignBatch": {
|
|
236
|
+
"title": "PresignBatch",
|
|
237
|
+
"type": "object",
|
|
238
|
+
"additionalProperties": false,
|
|
239
|
+
"required": [
|
|
240
|
+
"prefix",
|
|
241
|
+
"objectKey",
|
|
242
|
+
"requests"
|
|
243
|
+
],
|
|
244
|
+
"description": "`s3-static-presign` only: up to 64 operations on **one** object, `prefix` + `objectKey`, and at most one multipart upload of it. Each operation becomes one presigned request, sealed together. Consistency rules JSON Schema cannot state, which the custodian enforces: `uploadId` is present exactly when an operation needs it (`upload-part`, `list-parts`, `complete-multipart`, `abort-multipart`) and absent when the batch holds `create-multipart`; no two operations are identical; no two `upload-part` operations name the same `partNumber`.",
|
|
245
|
+
"properties": {
|
|
246
|
+
"prefix": {
|
|
247
|
+
"$ref": "#/$defs/ProviderObjectPrefix"
|
|
248
|
+
},
|
|
249
|
+
"objectKey": {
|
|
250
|
+
"type": "string",
|
|
251
|
+
"minLength": 1,
|
|
252
|
+
"maxLength": 1024,
|
|
253
|
+
"pattern": "^[A-Za-z0-9._-]+$",
|
|
254
|
+
"description": "The object's name within `prefix`. Every request in the batch names `prefix` + `objectKey` and no other object."
|
|
255
|
+
},
|
|
256
|
+
"uploadId": {
|
|
257
|
+
"type": "string",
|
|
258
|
+
"minLength": 1,
|
|
259
|
+
"maxLength": 1024,
|
|
260
|
+
"pattern": "^[A-Za-z0-9._~+/=-]+$",
|
|
261
|
+
"description": "The multipart upload the batch's multipart operations act on, as storage returned it from CreateMultipartUpload. Signed into each such request's query, percent-encoded by the SigV4 encoder, never interpolated."
|
|
262
|
+
},
|
|
263
|
+
"requests": {
|
|
264
|
+
"type": "array",
|
|
265
|
+
"minItems": 1,
|
|
266
|
+
"maxItems": 64,
|
|
267
|
+
"description": "At most 64. Each presigned request is bearer authority until it expires, so a batch holds what a consumer can use within its lifetime; a larger upload asks again, or writes larger parts. A batch whose sealed answer would exceed `sealedCredential`'s bound is refused with `responseTooLarge`, whatever its count.",
|
|
268
|
+
"items": {
|
|
269
|
+
"$ref": "#/$defs/PresignRequest"
|
|
270
|
+
}
|
|
271
|
+
}
|
|
272
|
+
}
|
|
273
|
+
},
|
|
274
|
+
"PresignRequest": {
|
|
275
|
+
"title": "PresignRequest",
|
|
276
|
+
"description": "One operation to presign, discriminated by `operation`. The ceiling action each needs is in `PresignOperation`.",
|
|
277
|
+
"oneOf": [
|
|
278
|
+
{
|
|
279
|
+
"title": "PresignPut",
|
|
280
|
+
"type": "object",
|
|
281
|
+
"additionalProperties": false,
|
|
282
|
+
"required": [
|
|
283
|
+
"operation",
|
|
284
|
+
"contentLength",
|
|
285
|
+
"checksumSha256"
|
|
286
|
+
],
|
|
287
|
+
"description": "PutObject of the whole object, bound to its exact length and SHA-256.",
|
|
288
|
+
"properties": {
|
|
289
|
+
"operation": {
|
|
290
|
+
"type": "string",
|
|
291
|
+
"const": "put"
|
|
292
|
+
},
|
|
293
|
+
"contentLength": {
|
|
294
|
+
"type": "integer",
|
|
295
|
+
"minimum": 0,
|
|
296
|
+
"maximum": 5368709120,
|
|
297
|
+
"description": "The object's exact length in bytes, signed into the request as `Content-Length`. At most 5 GiB, S3's single-request ceiling."
|
|
298
|
+
},
|
|
299
|
+
"checksumSha256": {
|
|
300
|
+
"$ref": "#/$defs/ChecksumSha256"
|
|
301
|
+
}
|
|
302
|
+
}
|
|
303
|
+
},
|
|
304
|
+
{
|
|
305
|
+
"title": "PresignGet",
|
|
306
|
+
"type": "object",
|
|
307
|
+
"additionalProperties": false,
|
|
308
|
+
"required": [
|
|
309
|
+
"operation"
|
|
310
|
+
],
|
|
311
|
+
"description": "GetObject.",
|
|
312
|
+
"properties": {
|
|
313
|
+
"operation": {
|
|
314
|
+
"type": "string",
|
|
315
|
+
"const": "get"
|
|
316
|
+
}
|
|
317
|
+
}
|
|
318
|
+
},
|
|
319
|
+
{
|
|
320
|
+
"title": "PresignHead",
|
|
321
|
+
"type": "object",
|
|
322
|
+
"additionalProperties": false,
|
|
323
|
+
"required": [
|
|
324
|
+
"operation"
|
|
325
|
+
],
|
|
326
|
+
"description": "HeadObject, with `x-amz-checksum-mode: ENABLED` signed so storage reports the object's checksum.",
|
|
327
|
+
"properties": {
|
|
328
|
+
"operation": {
|
|
329
|
+
"type": "string",
|
|
330
|
+
"const": "head"
|
|
331
|
+
}
|
|
332
|
+
}
|
|
333
|
+
},
|
|
334
|
+
{
|
|
335
|
+
"title": "PresignDelete",
|
|
336
|
+
"type": "object",
|
|
337
|
+
"additionalProperties": false,
|
|
338
|
+
"required": [
|
|
339
|
+
"operation"
|
|
340
|
+
],
|
|
341
|
+
"description": "DeleteObject.",
|
|
342
|
+
"properties": {
|
|
343
|
+
"operation": {
|
|
344
|
+
"type": "string",
|
|
345
|
+
"const": "delete"
|
|
346
|
+
}
|
|
347
|
+
}
|
|
348
|
+
},
|
|
349
|
+
{
|
|
350
|
+
"title": "PresignCreateMultipart",
|
|
351
|
+
"type": "object",
|
|
352
|
+
"additionalProperties": false,
|
|
353
|
+
"required": [
|
|
354
|
+
"operation"
|
|
355
|
+
],
|
|
356
|
+
"description": "CreateMultipartUpload, with `x-amz-checksum-algorithm: SHA256` signed so every part of the upload must carry a SHA-256 checksum.",
|
|
357
|
+
"properties": {
|
|
358
|
+
"operation": {
|
|
359
|
+
"type": "string",
|
|
360
|
+
"const": "create-multipart"
|
|
361
|
+
}
|
|
362
|
+
}
|
|
363
|
+
},
|
|
364
|
+
{
|
|
365
|
+
"title": "PresignUploadPart",
|
|
366
|
+
"type": "object",
|
|
367
|
+
"additionalProperties": false,
|
|
368
|
+
"required": [
|
|
369
|
+
"operation",
|
|
370
|
+
"partNumber",
|
|
371
|
+
"contentLength",
|
|
372
|
+
"checksumSha256"
|
|
373
|
+
],
|
|
374
|
+
"description": "UploadPart of one part of `uploadId`, bound to its number, its exact length and its SHA-256.",
|
|
375
|
+
"properties": {
|
|
376
|
+
"operation": {
|
|
377
|
+
"type": "string",
|
|
378
|
+
"const": "upload-part"
|
|
379
|
+
},
|
|
380
|
+
"partNumber": {
|
|
381
|
+
"type": "integer",
|
|
382
|
+
"minimum": 1,
|
|
383
|
+
"maximum": 10000
|
|
384
|
+
},
|
|
385
|
+
"contentLength": {
|
|
386
|
+
"type": "integer",
|
|
387
|
+
"minimum": 1,
|
|
388
|
+
"maximum": 5368709120,
|
|
389
|
+
"description": "The part's exact length in bytes, signed into the request as `Content-Length`. At most 5 GiB, S3's part ceiling."
|
|
390
|
+
},
|
|
391
|
+
"checksumSha256": {
|
|
392
|
+
"$ref": "#/$defs/ChecksumSha256"
|
|
393
|
+
}
|
|
394
|
+
}
|
|
395
|
+
},
|
|
396
|
+
{
|
|
397
|
+
"title": "PresignListParts",
|
|
398
|
+
"type": "object",
|
|
399
|
+
"additionalProperties": false,
|
|
400
|
+
"required": [
|
|
401
|
+
"operation"
|
|
402
|
+
],
|
|
403
|
+
"description": "ListParts of `uploadId`: each part's number, length, ETag and checksum, up to 1000 per page.",
|
|
404
|
+
"properties": {
|
|
405
|
+
"operation": {
|
|
406
|
+
"type": "string",
|
|
407
|
+
"const": "list-parts"
|
|
408
|
+
},
|
|
409
|
+
"partNumberMarker": {
|
|
410
|
+
"type": "integer",
|
|
411
|
+
"minimum": 0,
|
|
412
|
+
"maximum": 10000,
|
|
413
|
+
"description": "List parts after this number. Absent, from the first."
|
|
414
|
+
}
|
|
415
|
+
}
|
|
416
|
+
},
|
|
417
|
+
{
|
|
418
|
+
"title": "PresignCompleteMultipart",
|
|
419
|
+
"type": "object",
|
|
420
|
+
"additionalProperties": false,
|
|
421
|
+
"required": [
|
|
422
|
+
"operation",
|
|
423
|
+
"contentLength"
|
|
424
|
+
],
|
|
425
|
+
"description": "CompleteMultipartUpload of `uploadId`, bound to the assembled object's exact length.",
|
|
426
|
+
"properties": {
|
|
427
|
+
"operation": {
|
|
428
|
+
"type": "string",
|
|
429
|
+
"const": "complete-multipart"
|
|
430
|
+
},
|
|
431
|
+
"contentLength": {
|
|
432
|
+
"type": "integer",
|
|
433
|
+
"minimum": 0,
|
|
434
|
+
"maximum": 5497558138880,
|
|
435
|
+
"description": "The assembled object's exact length in bytes, signed into the request as `x-amz-mp-object-size`, so storage refuses a completion that would assemble any other size. At most 5 TiB, S3's object ceiling."
|
|
436
|
+
}
|
|
437
|
+
}
|
|
438
|
+
},
|
|
439
|
+
{
|
|
440
|
+
"title": "PresignAbortMultipart",
|
|
441
|
+
"type": "object",
|
|
442
|
+
"additionalProperties": false,
|
|
443
|
+
"required": [
|
|
444
|
+
"operation"
|
|
445
|
+
],
|
|
446
|
+
"description": "AbortMultipartUpload of `uploadId`.",
|
|
447
|
+
"properties": {
|
|
448
|
+
"operation": {
|
|
449
|
+
"type": "string",
|
|
450
|
+
"const": "abort-multipart"
|
|
451
|
+
}
|
|
452
|
+
}
|
|
453
|
+
}
|
|
454
|
+
]
|
|
455
|
+
},
|
|
456
|
+
"Response": {
|
|
457
|
+
"$anchor": "response",
|
|
458
|
+
"title": "External Credentials — Issue — response payload",
|
|
459
|
+
"type": "object",
|
|
460
|
+
"additionalProperties": false,
|
|
461
|
+
"required": [
|
|
462
|
+
"sealedCredential",
|
|
463
|
+
"expiresAt"
|
|
464
|
+
],
|
|
465
|
+
"oneOf": [
|
|
466
|
+
{
|
|
467
|
+
"required": [
|
|
468
|
+
"scope"
|
|
469
|
+
],
|
|
470
|
+
"not": {
|
|
471
|
+
"required": [
|
|
472
|
+
"presign"
|
|
473
|
+
]
|
|
474
|
+
}
|
|
475
|
+
},
|
|
476
|
+
{
|
|
477
|
+
"required": [
|
|
478
|
+
"presign"
|
|
479
|
+
],
|
|
480
|
+
"not": {
|
|
481
|
+
"required": [
|
|
482
|
+
"scope"
|
|
483
|
+
]
|
|
484
|
+
}
|
|
485
|
+
}
|
|
486
|
+
],
|
|
487
|
+
"properties": {
|
|
488
|
+
"sealedCredential": {
|
|
489
|
+
"type": "string",
|
|
490
|
+
"minLength": 64,
|
|
491
|
+
"maxLength": 262144,
|
|
492
|
+
"pattern": "^-----BEGIN VTA SEALED BUNDLE-----[\\s\\S]+-----END VTA SEALED BUNDLE-----\\s*$",
|
|
493
|
+
"description": "A `SealedTransferBundle` (external/_shared/0.1), sealed to the caller's key-agreement key, whose cleartext is an `ExternalCredentialPayload` for `scope` or a `PresignedRequestSet` for `presign`. Bounded at 256 KiB rather than the shared 64 KiB because a batch of presigned requests does not fit 64 KiB. A custodian never answers above this bound and never truncates the set: a batch whose sealed set would not fit is refused with `responseTooLarge`."
|
|
494
|
+
},
|
|
495
|
+
"expiresAt": {
|
|
496
|
+
"type": "string",
|
|
497
|
+
"format": "date-time",
|
|
498
|
+
"description": "The provider's expiry for the credential, in the clear; for `presign`, the earliest expiry in the batch."
|
|
499
|
+
},
|
|
500
|
+
"scope": {
|
|
501
|
+
"$ref": "#/$defs/CredentialScope",
|
|
502
|
+
"description": "The scope actually granted, which equals the requested one."
|
|
503
|
+
},
|
|
504
|
+
"presign": {
|
|
505
|
+
"$ref": "#/$defs/PresignBatch",
|
|
506
|
+
"description": "The batch actually presigned, which equals the requested one."
|
|
507
|
+
},
|
|
508
|
+
"ext": {
|
|
509
|
+
"$ref": "#/$defs/Ext"
|
|
510
|
+
}
|
|
511
|
+
}
|
|
512
|
+
},
|
|
513
|
+
"Ext": {
|
|
514
|
+
"title": "Ext",
|
|
515
|
+
"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.",
|
|
516
|
+
"type": "object",
|
|
517
|
+
"minProperties": 1,
|
|
518
|
+
"additionalProperties": true,
|
|
519
|
+
"propertyNames": {
|
|
520
|
+
"pattern": "^[a-z][a-z0-9-]*(\\.[a-z0-9-]+)+$"
|
|
521
|
+
}
|
|
522
|
+
},
|
|
523
|
+
"CredentialScope": {
|
|
524
|
+
"title": "CredentialScope",
|
|
525
|
+
"type": "object",
|
|
526
|
+
"additionalProperties": false,
|
|
527
|
+
"description": "What one issuance may do. For storage models, `prefix` and `actions` (both required, a rule this schema leaves to the custodian because other models use neither); for `s3-static-presign`, also `objectKey`, since a presigned URL is one operation on one object; for `oauth2-private-key-jwt`, `scopes`.",
|
|
528
|
+
"properties": {
|
|
529
|
+
"prefix": {
|
|
530
|
+
"$ref": "#/$defs/ProviderObjectPrefix"
|
|
531
|
+
},
|
|
532
|
+
"actions": {
|
|
533
|
+
"type": "array",
|
|
534
|
+
"minItems": 1,
|
|
535
|
+
"maxItems": 3,
|
|
536
|
+
"uniqueItems": true,
|
|
537
|
+
"items": {
|
|
538
|
+
"$ref": "#/$defs/ProviderObjectAction"
|
|
539
|
+
}
|
|
540
|
+
},
|
|
541
|
+
"objectKey": {
|
|
542
|
+
"type": "string",
|
|
543
|
+
"minLength": 1,
|
|
544
|
+
"maxLength": 1024,
|
|
545
|
+
"pattern": "^[A-Za-z0-9._-]+$",
|
|
546
|
+
"description": "`s3-static-presign` only: the object's name within `prefix`. The presigned URL names `prefix` + `objectKey` and nothing else, and `actions` must hold exactly one action."
|
|
547
|
+
},
|
|
548
|
+
"scopes": {
|
|
549
|
+
"type": "array",
|
|
550
|
+
"maxItems": 64,
|
|
551
|
+
"uniqueItems": true,
|
|
552
|
+
"items": {
|
|
553
|
+
"type": "string",
|
|
554
|
+
"maxLength": 256,
|
|
555
|
+
"pattern": "^[!#-\\[\\]-~]+$"
|
|
556
|
+
},
|
|
557
|
+
"description": "`oauth2-private-key-jwt` only: the OAuth scopes requested."
|
|
558
|
+
}
|
|
559
|
+
}
|
|
560
|
+
},
|
|
561
|
+
"ProviderObjectAction": {
|
|
562
|
+
"title": "ProviderObjectAction",
|
|
563
|
+
"type": "string",
|
|
564
|
+
"enum": [
|
|
565
|
+
"put",
|
|
566
|
+
"get",
|
|
567
|
+
"delete"
|
|
568
|
+
],
|
|
569
|
+
"description": "`put`: write an object. `get`: read one. `delete`: remove one. No list, ACL, policy or bucket-level action exists here, so none can be granted."
|
|
570
|
+
},
|
|
571
|
+
"ProviderObjectPrefix": {
|
|
572
|
+
"title": "ProviderObjectPrefix",
|
|
573
|
+
"type": "string",
|
|
574
|
+
"minLength": 2,
|
|
575
|
+
"maxLength": 512,
|
|
576
|
+
"pattern": "^([a-z0-9][a-z0-9._-]{0,127}/){1,16}$",
|
|
577
|
+
"description": "An object-key prefix within the account's bucket: one or more segments of lowercase letters, digits, `.`, `_` and `-`, each beginning with a letter or digit and ending with `/`. No quote, backslash, wildcard, whitespace, `..` segment or empty segment can appear. That is deliberate: the custodian places this value inside a provider policy — an IAM session policy (JSON), a GCS Credential Access Boundary condition (CEL) — and a value able to carry a metacharacter can break out of the string it is placed in and widen the policy. That is a known class of defect (CVE-2026-42811, a CEL injection in downscoped GCS credentials). Even with this pattern, a custodian MUST build provider policies with the provider language's own encoder, never by string interpolation."
|
|
578
|
+
},
|
|
579
|
+
"AccountId": {
|
|
580
|
+
"title": "AccountId",
|
|
581
|
+
"type": "string",
|
|
582
|
+
"minLength": 1,
|
|
583
|
+
"maxLength": 64,
|
|
584
|
+
"pattern": "^[a-z0-9][a-z0-9-]*$",
|
|
585
|
+
"description": "The account's identifier within its context, chosen by whoever creates it. Lowercase letters, digits and hyphens, so that it can be embedded in a certificate subject, a token subject or a provider-side condition without escaping. Unique per context; never reused after deletion while anything that names it (a provider-side trust policy, an audit row) may still exist."
|
|
586
|
+
},
|
|
587
|
+
"AccountContextId": {
|
|
588
|
+
"title": "AccountContextId",
|
|
589
|
+
"type": "string",
|
|
590
|
+
"minLength": 1,
|
|
591
|
+
"maxLength": 256,
|
|
592
|
+
"description": "The custodian context that owns the account. Act scope in this context decides who may manage the account and who may consume it; the account's keys are derived in this context's key space."
|
|
593
|
+
}
|
|
594
|
+
}
|
|
595
|
+
} as const;
|
|
596
|
+
|
|
597
|
+
/** As {@link PAYLOAD_SCHEMA}, for the success-response variant. */
|
|
598
|
+
export const RESPONSE_PAYLOAD_SCHEMA = {
|
|
599
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
600
|
+
"$ref": "#/$defs/Response",
|
|
601
|
+
"$defs": {
|
|
602
|
+
"ChecksumSha256": {
|
|
603
|
+
"title": "ChecksumSha256",
|
|
604
|
+
"type": "string",
|
|
605
|
+
"minLength": 44,
|
|
606
|
+
"maxLength": 44,
|
|
607
|
+
"pattern": "^[A-Za-z0-9+/]{43}=$",
|
|
608
|
+
"description": "A SHA-256 digest in standard base64 (RFC 4648 §4, padded), as S3 carries it in `x-amz-checksum-sha256`."
|
|
609
|
+
},
|
|
610
|
+
"PresignBatch": {
|
|
611
|
+
"title": "PresignBatch",
|
|
612
|
+
"type": "object",
|
|
613
|
+
"additionalProperties": false,
|
|
614
|
+
"required": [
|
|
615
|
+
"prefix",
|
|
616
|
+
"objectKey",
|
|
617
|
+
"requests"
|
|
618
|
+
],
|
|
619
|
+
"description": "`s3-static-presign` only: up to 64 operations on **one** object, `prefix` + `objectKey`, and at most one multipart upload of it. Each operation becomes one presigned request, sealed together. Consistency rules JSON Schema cannot state, which the custodian enforces: `uploadId` is present exactly when an operation needs it (`upload-part`, `list-parts`, `complete-multipart`, `abort-multipart`) and absent when the batch holds `create-multipart`; no two operations are identical; no two `upload-part` operations name the same `partNumber`.",
|
|
620
|
+
"properties": {
|
|
621
|
+
"prefix": {
|
|
622
|
+
"$ref": "#/$defs/ProviderObjectPrefix"
|
|
623
|
+
},
|
|
624
|
+
"objectKey": {
|
|
625
|
+
"type": "string",
|
|
626
|
+
"minLength": 1,
|
|
627
|
+
"maxLength": 1024,
|
|
628
|
+
"pattern": "^[A-Za-z0-9._-]+$",
|
|
629
|
+
"description": "The object's name within `prefix`. Every request in the batch names `prefix` + `objectKey` and no other object."
|
|
630
|
+
},
|
|
631
|
+
"uploadId": {
|
|
632
|
+
"type": "string",
|
|
633
|
+
"minLength": 1,
|
|
634
|
+
"maxLength": 1024,
|
|
635
|
+
"pattern": "^[A-Za-z0-9._~+/=-]+$",
|
|
636
|
+
"description": "The multipart upload the batch's multipart operations act on, as storage returned it from CreateMultipartUpload. Signed into each such request's query, percent-encoded by the SigV4 encoder, never interpolated."
|
|
637
|
+
},
|
|
638
|
+
"requests": {
|
|
639
|
+
"type": "array",
|
|
640
|
+
"minItems": 1,
|
|
641
|
+
"maxItems": 64,
|
|
642
|
+
"description": "At most 64. Each presigned request is bearer authority until it expires, so a batch holds what a consumer can use within its lifetime; a larger upload asks again, or writes larger parts. A batch whose sealed answer would exceed `sealedCredential`'s bound is refused with `responseTooLarge`, whatever its count.",
|
|
643
|
+
"items": {
|
|
644
|
+
"$ref": "#/$defs/PresignRequest"
|
|
645
|
+
}
|
|
646
|
+
}
|
|
647
|
+
}
|
|
648
|
+
},
|
|
649
|
+
"PresignRequest": {
|
|
650
|
+
"title": "PresignRequest",
|
|
651
|
+
"description": "One operation to presign, discriminated by `operation`. The ceiling action each needs is in `PresignOperation`.",
|
|
652
|
+
"oneOf": [
|
|
653
|
+
{
|
|
654
|
+
"title": "PresignPut",
|
|
655
|
+
"type": "object",
|
|
656
|
+
"additionalProperties": false,
|
|
657
|
+
"required": [
|
|
658
|
+
"operation",
|
|
659
|
+
"contentLength",
|
|
660
|
+
"checksumSha256"
|
|
661
|
+
],
|
|
662
|
+
"description": "PutObject of the whole object, bound to its exact length and SHA-256.",
|
|
663
|
+
"properties": {
|
|
664
|
+
"operation": {
|
|
665
|
+
"type": "string",
|
|
666
|
+
"const": "put"
|
|
667
|
+
},
|
|
668
|
+
"contentLength": {
|
|
669
|
+
"type": "integer",
|
|
670
|
+
"minimum": 0,
|
|
671
|
+
"maximum": 5368709120,
|
|
672
|
+
"description": "The object's exact length in bytes, signed into the request as `Content-Length`. At most 5 GiB, S3's single-request ceiling."
|
|
673
|
+
},
|
|
674
|
+
"checksumSha256": {
|
|
675
|
+
"$ref": "#/$defs/ChecksumSha256"
|
|
676
|
+
}
|
|
677
|
+
}
|
|
678
|
+
},
|
|
679
|
+
{
|
|
680
|
+
"title": "PresignGet",
|
|
681
|
+
"type": "object",
|
|
682
|
+
"additionalProperties": false,
|
|
683
|
+
"required": [
|
|
684
|
+
"operation"
|
|
685
|
+
],
|
|
686
|
+
"description": "GetObject.",
|
|
687
|
+
"properties": {
|
|
688
|
+
"operation": {
|
|
689
|
+
"type": "string",
|
|
690
|
+
"const": "get"
|
|
691
|
+
}
|
|
692
|
+
}
|
|
693
|
+
},
|
|
694
|
+
{
|
|
695
|
+
"title": "PresignHead",
|
|
696
|
+
"type": "object",
|
|
697
|
+
"additionalProperties": false,
|
|
698
|
+
"required": [
|
|
699
|
+
"operation"
|
|
700
|
+
],
|
|
701
|
+
"description": "HeadObject, with `x-amz-checksum-mode: ENABLED` signed so storage reports the object's checksum.",
|
|
702
|
+
"properties": {
|
|
703
|
+
"operation": {
|
|
704
|
+
"type": "string",
|
|
705
|
+
"const": "head"
|
|
706
|
+
}
|
|
707
|
+
}
|
|
708
|
+
},
|
|
709
|
+
{
|
|
710
|
+
"title": "PresignDelete",
|
|
711
|
+
"type": "object",
|
|
712
|
+
"additionalProperties": false,
|
|
713
|
+
"required": [
|
|
714
|
+
"operation"
|
|
715
|
+
],
|
|
716
|
+
"description": "DeleteObject.",
|
|
717
|
+
"properties": {
|
|
718
|
+
"operation": {
|
|
719
|
+
"type": "string",
|
|
720
|
+
"const": "delete"
|
|
721
|
+
}
|
|
722
|
+
}
|
|
723
|
+
},
|
|
724
|
+
{
|
|
725
|
+
"title": "PresignCreateMultipart",
|
|
726
|
+
"type": "object",
|
|
727
|
+
"additionalProperties": false,
|
|
728
|
+
"required": [
|
|
729
|
+
"operation"
|
|
730
|
+
],
|
|
731
|
+
"description": "CreateMultipartUpload, with `x-amz-checksum-algorithm: SHA256` signed so every part of the upload must carry a SHA-256 checksum.",
|
|
732
|
+
"properties": {
|
|
733
|
+
"operation": {
|
|
734
|
+
"type": "string",
|
|
735
|
+
"const": "create-multipart"
|
|
736
|
+
}
|
|
737
|
+
}
|
|
738
|
+
},
|
|
739
|
+
{
|
|
740
|
+
"title": "PresignUploadPart",
|
|
741
|
+
"type": "object",
|
|
742
|
+
"additionalProperties": false,
|
|
743
|
+
"required": [
|
|
744
|
+
"operation",
|
|
745
|
+
"partNumber",
|
|
746
|
+
"contentLength",
|
|
747
|
+
"checksumSha256"
|
|
748
|
+
],
|
|
749
|
+
"description": "UploadPart of one part of `uploadId`, bound to its number, its exact length and its SHA-256.",
|
|
750
|
+
"properties": {
|
|
751
|
+
"operation": {
|
|
752
|
+
"type": "string",
|
|
753
|
+
"const": "upload-part"
|
|
754
|
+
},
|
|
755
|
+
"partNumber": {
|
|
756
|
+
"type": "integer",
|
|
757
|
+
"minimum": 1,
|
|
758
|
+
"maximum": 10000
|
|
759
|
+
},
|
|
760
|
+
"contentLength": {
|
|
761
|
+
"type": "integer",
|
|
762
|
+
"minimum": 1,
|
|
763
|
+
"maximum": 5368709120,
|
|
764
|
+
"description": "The part's exact length in bytes, signed into the request as `Content-Length`. At most 5 GiB, S3's part ceiling."
|
|
765
|
+
},
|
|
766
|
+
"checksumSha256": {
|
|
767
|
+
"$ref": "#/$defs/ChecksumSha256"
|
|
768
|
+
}
|
|
769
|
+
}
|
|
770
|
+
},
|
|
771
|
+
{
|
|
772
|
+
"title": "PresignListParts",
|
|
773
|
+
"type": "object",
|
|
774
|
+
"additionalProperties": false,
|
|
775
|
+
"required": [
|
|
776
|
+
"operation"
|
|
777
|
+
],
|
|
778
|
+
"description": "ListParts of `uploadId`: each part's number, length, ETag and checksum, up to 1000 per page.",
|
|
779
|
+
"properties": {
|
|
780
|
+
"operation": {
|
|
781
|
+
"type": "string",
|
|
782
|
+
"const": "list-parts"
|
|
783
|
+
},
|
|
784
|
+
"partNumberMarker": {
|
|
785
|
+
"type": "integer",
|
|
786
|
+
"minimum": 0,
|
|
787
|
+
"maximum": 10000,
|
|
788
|
+
"description": "List parts after this number. Absent, from the first."
|
|
789
|
+
}
|
|
790
|
+
}
|
|
791
|
+
},
|
|
792
|
+
{
|
|
793
|
+
"title": "PresignCompleteMultipart",
|
|
794
|
+
"type": "object",
|
|
795
|
+
"additionalProperties": false,
|
|
796
|
+
"required": [
|
|
797
|
+
"operation",
|
|
798
|
+
"contentLength"
|
|
799
|
+
],
|
|
800
|
+
"description": "CompleteMultipartUpload of `uploadId`, bound to the assembled object's exact length.",
|
|
801
|
+
"properties": {
|
|
802
|
+
"operation": {
|
|
803
|
+
"type": "string",
|
|
804
|
+
"const": "complete-multipart"
|
|
805
|
+
},
|
|
806
|
+
"contentLength": {
|
|
807
|
+
"type": "integer",
|
|
808
|
+
"minimum": 0,
|
|
809
|
+
"maximum": 5497558138880,
|
|
810
|
+
"description": "The assembled object's exact length in bytes, signed into the request as `x-amz-mp-object-size`, so storage refuses a completion that would assemble any other size. At most 5 TiB, S3's object ceiling."
|
|
811
|
+
}
|
|
812
|
+
}
|
|
813
|
+
},
|
|
814
|
+
{
|
|
815
|
+
"title": "PresignAbortMultipart",
|
|
816
|
+
"type": "object",
|
|
817
|
+
"additionalProperties": false,
|
|
818
|
+
"required": [
|
|
819
|
+
"operation"
|
|
820
|
+
],
|
|
821
|
+
"description": "AbortMultipartUpload of `uploadId`.",
|
|
822
|
+
"properties": {
|
|
823
|
+
"operation": {
|
|
824
|
+
"type": "string",
|
|
825
|
+
"const": "abort-multipart"
|
|
826
|
+
}
|
|
827
|
+
}
|
|
828
|
+
}
|
|
829
|
+
]
|
|
830
|
+
},
|
|
831
|
+
"Response": {
|
|
832
|
+
"$anchor": "response",
|
|
833
|
+
"title": "External Credentials — Issue — response payload",
|
|
834
|
+
"type": "object",
|
|
835
|
+
"additionalProperties": false,
|
|
836
|
+
"required": [
|
|
837
|
+
"sealedCredential",
|
|
838
|
+
"expiresAt"
|
|
839
|
+
],
|
|
840
|
+
"oneOf": [
|
|
841
|
+
{
|
|
842
|
+
"required": [
|
|
843
|
+
"scope"
|
|
844
|
+
],
|
|
845
|
+
"not": {
|
|
846
|
+
"required": [
|
|
847
|
+
"presign"
|
|
848
|
+
]
|
|
849
|
+
}
|
|
850
|
+
},
|
|
851
|
+
{
|
|
852
|
+
"required": [
|
|
853
|
+
"presign"
|
|
854
|
+
],
|
|
855
|
+
"not": {
|
|
856
|
+
"required": [
|
|
857
|
+
"scope"
|
|
858
|
+
]
|
|
859
|
+
}
|
|
860
|
+
}
|
|
861
|
+
],
|
|
862
|
+
"properties": {
|
|
863
|
+
"sealedCredential": {
|
|
864
|
+
"type": "string",
|
|
865
|
+
"minLength": 64,
|
|
866
|
+
"maxLength": 262144,
|
|
867
|
+
"pattern": "^-----BEGIN VTA SEALED BUNDLE-----[\\s\\S]+-----END VTA SEALED BUNDLE-----\\s*$",
|
|
868
|
+
"description": "A `SealedTransferBundle` (external/_shared/0.1), sealed to the caller's key-agreement key, whose cleartext is an `ExternalCredentialPayload` for `scope` or a `PresignedRequestSet` for `presign`. Bounded at 256 KiB rather than the shared 64 KiB because a batch of presigned requests does not fit 64 KiB. A custodian never answers above this bound and never truncates the set: a batch whose sealed set would not fit is refused with `responseTooLarge`."
|
|
869
|
+
},
|
|
870
|
+
"expiresAt": {
|
|
871
|
+
"type": "string",
|
|
872
|
+
"format": "date-time",
|
|
873
|
+
"description": "The provider's expiry for the credential, in the clear; for `presign`, the earliest expiry in the batch."
|
|
874
|
+
},
|
|
875
|
+
"scope": {
|
|
876
|
+
"$ref": "#/$defs/CredentialScope",
|
|
877
|
+
"description": "The scope actually granted, which equals the requested one."
|
|
878
|
+
},
|
|
879
|
+
"presign": {
|
|
880
|
+
"$ref": "#/$defs/PresignBatch",
|
|
881
|
+
"description": "The batch actually presigned, which equals the requested one."
|
|
882
|
+
},
|
|
883
|
+
"ext": {
|
|
884
|
+
"$ref": "#/$defs/Ext"
|
|
885
|
+
}
|
|
886
|
+
}
|
|
887
|
+
},
|
|
888
|
+
"Ext": {
|
|
889
|
+
"title": "Ext",
|
|
890
|
+
"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.",
|
|
891
|
+
"type": "object",
|
|
892
|
+
"minProperties": 1,
|
|
893
|
+
"additionalProperties": true,
|
|
894
|
+
"propertyNames": {
|
|
895
|
+
"pattern": "^[a-z][a-z0-9-]*(\\.[a-z0-9-]+)+$"
|
|
896
|
+
}
|
|
897
|
+
},
|
|
898
|
+
"CredentialScope": {
|
|
899
|
+
"title": "CredentialScope",
|
|
900
|
+
"type": "object",
|
|
901
|
+
"additionalProperties": false,
|
|
902
|
+
"description": "What one issuance may do. For storage models, `prefix` and `actions` (both required, a rule this schema leaves to the custodian because other models use neither); for `s3-static-presign`, also `objectKey`, since a presigned URL is one operation on one object; for `oauth2-private-key-jwt`, `scopes`.",
|
|
903
|
+
"properties": {
|
|
904
|
+
"prefix": {
|
|
905
|
+
"$ref": "#/$defs/ProviderObjectPrefix"
|
|
906
|
+
},
|
|
907
|
+
"actions": {
|
|
908
|
+
"type": "array",
|
|
909
|
+
"minItems": 1,
|
|
910
|
+
"maxItems": 3,
|
|
911
|
+
"uniqueItems": true,
|
|
912
|
+
"items": {
|
|
913
|
+
"$ref": "#/$defs/ProviderObjectAction"
|
|
914
|
+
}
|
|
915
|
+
},
|
|
916
|
+
"objectKey": {
|
|
917
|
+
"type": "string",
|
|
918
|
+
"minLength": 1,
|
|
919
|
+
"maxLength": 1024,
|
|
920
|
+
"pattern": "^[A-Za-z0-9._-]+$",
|
|
921
|
+
"description": "`s3-static-presign` only: the object's name within `prefix`. The presigned URL names `prefix` + `objectKey` and nothing else, and `actions` must hold exactly one action."
|
|
922
|
+
},
|
|
923
|
+
"scopes": {
|
|
924
|
+
"type": "array",
|
|
925
|
+
"maxItems": 64,
|
|
926
|
+
"uniqueItems": true,
|
|
927
|
+
"items": {
|
|
928
|
+
"type": "string",
|
|
929
|
+
"maxLength": 256,
|
|
930
|
+
"pattern": "^[!#-\\[\\]-~]+$"
|
|
931
|
+
},
|
|
932
|
+
"description": "`oauth2-private-key-jwt` only: the OAuth scopes requested."
|
|
933
|
+
}
|
|
934
|
+
}
|
|
935
|
+
},
|
|
936
|
+
"ProviderObjectAction": {
|
|
937
|
+
"title": "ProviderObjectAction",
|
|
938
|
+
"type": "string",
|
|
939
|
+
"enum": [
|
|
940
|
+
"put",
|
|
941
|
+
"get",
|
|
942
|
+
"delete"
|
|
943
|
+
],
|
|
944
|
+
"description": "`put`: write an object. `get`: read one. `delete`: remove one. No list, ACL, policy or bucket-level action exists here, so none can be granted."
|
|
945
|
+
},
|
|
946
|
+
"ProviderObjectPrefix": {
|
|
947
|
+
"title": "ProviderObjectPrefix",
|
|
948
|
+
"type": "string",
|
|
949
|
+
"minLength": 2,
|
|
950
|
+
"maxLength": 512,
|
|
951
|
+
"pattern": "^([a-z0-9][a-z0-9._-]{0,127}/){1,16}$",
|
|
952
|
+
"description": "An object-key prefix within the account's bucket: one or more segments of lowercase letters, digits, `.`, `_` and `-`, each beginning with a letter or digit and ending with `/`. No quote, backslash, wildcard, whitespace, `..` segment or empty segment can appear. That is deliberate: the custodian places this value inside a provider policy — an IAM session policy (JSON), a GCS Credential Access Boundary condition (CEL) — and a value able to carry a metacharacter can break out of the string it is placed in and widen the policy. That is a known class of defect (CVE-2026-42811, a CEL injection in downscoped GCS credentials). Even with this pattern, a custodian MUST build provider policies with the provider language's own encoder, never by string interpolation."
|
|
953
|
+
},
|
|
954
|
+
"AccountId": {
|
|
955
|
+
"title": "AccountId",
|
|
956
|
+
"type": "string",
|
|
957
|
+
"minLength": 1,
|
|
958
|
+
"maxLength": 64,
|
|
959
|
+
"pattern": "^[a-z0-9][a-z0-9-]*$",
|
|
960
|
+
"description": "The account's identifier within its context, chosen by whoever creates it. Lowercase letters, digits and hyphens, so that it can be embedded in a certificate subject, a token subject or a provider-side condition without escaping. Unique per context; never reused after deletion while anything that names it (a provider-side trust policy, an audit row) may still exist."
|
|
961
|
+
},
|
|
962
|
+
"AccountContextId": {
|
|
963
|
+
"title": "AccountContextId",
|
|
964
|
+
"type": "string",
|
|
965
|
+
"minLength": 1,
|
|
966
|
+
"maxLength": 256,
|
|
967
|
+
"description": "The custodian context that owns the account. Act scope in this context decides who may manage the account and who may consume it; the account's keys are derived in this context's key space."
|
|
968
|
+
}
|
|
969
|
+
}
|
|
970
|
+
} as const;
|
|
971
|
+
|
|
972
|
+
/**
|
|
973
|
+
* SPEC.md §7.2 policy for the request variant, from this specification's
|
|
974
|
+
* front matter. Pass to `consumeInbound` — items 5b, 7 and 8 are
|
|
975
|
+
* per-specification and cannot be derived from the document alone, and
|
|
976
|
+
* item 2 needs the schema this carries.
|
|
977
|
+
*/
|
|
978
|
+
export const SPEC = {
|
|
979
|
+
typeUri: TYPE_URI,
|
|
980
|
+
isBearer: false,
|
|
981
|
+
isProofRequired: true,
|
|
982
|
+
isRecipientRequired: true,
|
|
983
|
+
isIssuedAtRequired: true,
|
|
984
|
+
payloadSchema: PAYLOAD_SCHEMA,
|
|
985
|
+
} as const;
|
|
986
|
+
|
|
987
|
+
/**
|
|
988
|
+
* SPEC.md §7.2 policy for the success-response variant. `isRecipientRequired`
|
|
989
|
+
* tracks the *issuer* party's requirement because a response swaps the
|
|
990
|
+
* parties (§7.3 item 5).
|
|
991
|
+
*/
|
|
992
|
+
export const RESPONSE_SPEC = {
|
|
993
|
+
typeUri: RESPONSE_TYPE_URI,
|
|
994
|
+
isBearer: false,
|
|
995
|
+
isProofRequired: true,
|
|
996
|
+
isRecipientRequired: true,
|
|
997
|
+
isIssuedAtRequired: true,
|
|
998
|
+
payloadSchema: RESPONSE_PAYLOAD_SCHEMA,
|
|
999
|
+
} as const;
|