-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathblob-store-openapi.yml
More file actions
439 lines (429 loc) · 19.3 KB
/
Copy pathblob-store-openapi.yml
File metadata and controls
439 lines (429 loc) · 19.3 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
openapi: 3.0.4
info:
title: BlobStore API
version: 1.0.0
x-products: [idk, edk, vdx]
description: |
Canonical provider-neutral BlobStore API over the IDK `BlobService` contract.
BlobStore persists opaque bytes and metadata; it never receives vault or wallet key material.
Binary PUT and GET bodies are streamable. Conditional writes and deletes are atomic only when
advertised by the selected store's capability document; implementations must not emulate them
with an unsafe check-then-write sequence.
servers:
- url: https://api.example.com/api/blob-store/v1
description: Production server.
- url: http://localhost:8080/api/blob-store/v1
description: Local development server.
security:
- bearer: []
tags:
- name: BlobStores
description: Store capability discovery.
- name: Blobs
description: Streaming opaque-byte CRUD, listing, search, copy, and move.
- name: ContentAddressing
description: Content-addressed storage and integrity verification.
- name: TemporaryUrls
description: Time-bounded provider URLs where supported.
paths:
/stores/{storeId}/capabilities:
get:
tags: [BlobStores]
operationId: getBlobStoreCapabilities
summary: Get store capabilities
parameters:
- $ref: '#/components/parameters/StoreId'
responses:
'200':
description: Truthful capabilities for the selected configured store.
content:
application/json:
schema: { $ref: './blob-store-components.yml#/components/schemas/BlobStoreCapabilities' }
'401': { $ref: './blob-store-components.yml#/components/responses/BlobUnauthorized' }
'403': { $ref: './blob-store-components.yml#/components/responses/BlobForbidden' }
'404': { $ref: './blob-store-components.yml#/components/responses/BlobNotFound' }
'500': { $ref: './blob-store-components.yml#/components/responses/BlobErrorResponse' }
/stores/{storeId}/blobs:
get:
tags: [Blobs]
operationId: listBlobs
summary: List blobs and common prefixes
parameters:
- $ref: '#/components/parameters/StoreId'
- name: prefix
in: query
schema: { type: string }
- name: delimiter
in: query
schema: { type: string, default: / }
- name: recursive
in: query
schema: { type: boolean, default: false }
- name: pageSize
in: query
schema: { type: integer, minimum: 1, maximum: 1000, default: 100 }
- name: pageToken
in: query
schema: { type: string }
responses:
'200':
description: Bounded page of descriptors and virtual/common folders.
content:
application/json:
schema: { $ref: './blob-store-components.yml#/components/schemas/BlobListResult' }
'400': { $ref: './blob-store-components.yml#/components/responses/BlobBadRequest' }
'401': { $ref: './blob-store-components.yml#/components/responses/BlobUnauthorized' }
'403': { $ref: './blob-store-components.yml#/components/responses/BlobForbidden' }
'404': { $ref: './blob-store-components.yml#/components/responses/BlobNotFound' }
'501': { $ref: './blob-store-components.yml#/components/responses/BlobUnsupported' }
'500': { $ref: './blob-store-components.yml#/components/responses/BlobErrorResponse' }
/stores/{storeId}/blobs/content:
parameters:
- $ref: '#/components/parameters/StoreId'
- $ref: '#/components/parameters/BlobPathQuery'
put:
tags: [Blobs]
operationId: putBlob
summary: Stream a blob into a store
description: >-
Writes or atomically replaces an opaque object. `If-None-Match: *` is create-only;
`If-Match` or `X-Expected-Revision` performs compare-and-set. The service verifies the
optional Digest header while consuming the stream and rejects partial writes.
parameters:
- $ref: '#/components/parameters/IfMatch'
- $ref: '#/components/parameters/IfNoneMatch'
- $ref: '#/components/parameters/ExpectedRevision'
- $ref: '#/components/parameters/Digest'
- $ref: '#/components/parameters/BlobMetadata'
requestBody:
required: true
content:
application/octet-stream:
schema: { type: string, format: binary }
responses:
'201':
description: Blob created.
content:
application/json:
schema: { $ref: './blob-store-components.yml#/components/schemas/BlobDescriptor' }
'200':
description: Blob atomically replaced.
content:
application/json:
schema: { $ref: './blob-store-components.yml#/components/schemas/BlobDescriptor' }
'400': { $ref: './blob-store-components.yml#/components/responses/BlobBadRequest' }
'401': { $ref: './blob-store-components.yml#/components/responses/BlobUnauthorized' }
'403': { $ref: './blob-store-components.yml#/components/responses/BlobForbidden' }
'409': { $ref: './blob-store-components.yml#/components/responses/BlobConflict' }
'412': { $ref: './blob-store-components.yml#/components/responses/BlobPreconditionFailed' }
'501': { $ref: './blob-store-components.yml#/components/responses/BlobUnsupported' }
'500': { $ref: './blob-store-components.yml#/components/responses/BlobErrorResponse' }
get:
tags: [Blobs]
operationId: streamBlob
summary: Stream blob bytes
parameters:
- name: Range
in: header
description: Standard byte range, for example `bytes=0-1048575`.
schema: { type: string }
responses:
'200':
$ref: '#/components/responses/BlobBytes'
'206':
$ref: '#/components/responses/PartialBlobBytes'
'401': { $ref: './blob-store-components.yml#/components/responses/BlobUnauthorized' }
'403': { $ref: './blob-store-components.yml#/components/responses/BlobForbidden' }
'404': { $ref: './blob-store-components.yml#/components/responses/BlobNotFound' }
'416': { $ref: './blob-store-components.yml#/components/responses/BlobRangeNotSatisfiable' }
'500': { $ref: './blob-store-components.yml#/components/responses/BlobErrorResponse' }
head:
tags: [Blobs]
operationId: getBlobInfo
summary: Get blob metadata without content
responses:
'200':
description: Blob exists; descriptor fields are returned in response headers.
headers:
ETag: { schema: { type: string } }
X-Blob-Revision: { schema: { type: integer, format: int64 } }
Content-Length: { schema: { type: integer, format: int64 } }
Content-Type: { schema: { type: string } }
Digest: { schema: { type: string } }
'401': { $ref: './blob-store-components.yml#/components/responses/BlobUnauthorized' }
'403': { $ref: './blob-store-components.yml#/components/responses/BlobForbidden' }
'404': { $ref: './blob-store-components.yml#/components/responses/BlobNotFound' }
'500': { $ref: './blob-store-components.yml#/components/responses/BlobErrorResponse' }
delete:
tags: [Blobs]
operationId: deleteBlob
summary: Delete a blob conditionally
description: >-
When `If-Match` or `X-Expected-Revision` is supplied, deletion is atomic and fails
rather than deleting a newer object. An unconditional request retains BlobService delete behavior.
parameters:
- $ref: '#/components/parameters/IfMatch'
- $ref: '#/components/parameters/ExpectedRevision'
responses:
'200':
description: Whether an object was deleted.
content:
application/json:
schema: { $ref: './blob-store-components.yml#/components/schemas/DeleteResult' }
'401': { $ref: './blob-store-components.yml#/components/responses/BlobUnauthorized' }
'403': { $ref: './blob-store-components.yml#/components/responses/BlobForbidden' }
'404': { $ref: './blob-store-components.yml#/components/responses/BlobNotFound' }
'412': { $ref: './blob-store-components.yml#/components/responses/BlobPreconditionFailed' }
'501': { $ref: './blob-store-components.yml#/components/responses/BlobUnsupported' }
'500': { $ref: './blob-store-components.yml#/components/responses/BlobErrorResponse' }
/blobs:search:
post:
tags: [Blobs]
operationId: searchBlobs
summary: Search indexed blob metadata
parameters:
- name: storeId
in: query
schema: { type: string }
requestBody:
required: true
content:
application/json:
schema: { $ref: './blob-store-components.yml#/components/schemas/MetadataSearchQuery' }
responses:
'200':
description: Matching descriptors. Object bodies are never opened by metadata search.
content:
application/json:
schema:
type: array
items: { $ref: './blob-store-components.yml#/components/schemas/BlobDescriptor' }
'400': { $ref: './blob-store-components.yml#/components/responses/BlobBadRequest' }
'401': { $ref: './blob-store-components.yml#/components/responses/BlobUnauthorized' }
'403': { $ref: './blob-store-components.yml#/components/responses/BlobForbidden' }
'501': { $ref: './blob-store-components.yml#/components/responses/BlobUnsupported' }
'500': { $ref: './blob-store-components.yml#/components/responses/BlobErrorResponse' }
/stores/{storeId}/blobs:verify:
post:
tags: [Blobs]
operationId: verifyBlobIntegrity
summary: Verify a blob against an expected content address
description: Reads the selected object through the backend integrity path without returning its bytes.
parameters:
- $ref: '#/components/parameters/StoreId'
- $ref: '#/components/parameters/BlobPathQuery'
requestBody:
required: true
content:
application/json:
schema: { $ref: './blob-store-components.yml#/components/schemas/ContentAddress' }
responses:
'200':
description: Integrity verification result.
content:
application/json:
schema: { $ref: './blob-store-components.yml#/components/schemas/VerifyResult' }
'400': { $ref: './blob-store-components.yml#/components/responses/BlobBadRequest' }
'401': { $ref: './blob-store-components.yml#/components/responses/BlobUnauthorized' }
'403': { $ref: './blob-store-components.yml#/components/responses/BlobForbidden' }
'404': { $ref: './blob-store-components.yml#/components/responses/BlobNotFound' }
'501': { $ref: './blob-store-components.yml#/components/responses/BlobUnsupported' }
'500': { $ref: './blob-store-components.yml#/components/responses/BlobErrorResponse' }
/blobs:copy:
post:
tags: [Blobs]
operationId: copyBlob
summary: Copy a blob within or across configured stores
requestBody:
required: true
content:
application/json:
schema: { $ref: './blob-store-components.yml#/components/schemas/BlobTransferRequest' }
responses:
'201':
description: Destination descriptor.
content:
application/json:
schema: { $ref: './blob-store-components.yml#/components/schemas/BlobDescriptor' }
'400': { $ref: './blob-store-components.yml#/components/responses/BlobBadRequest' }
'401': { $ref: './blob-store-components.yml#/components/responses/BlobUnauthorized' }
'403': { $ref: './blob-store-components.yml#/components/responses/BlobForbidden' }
'404': { $ref: './blob-store-components.yml#/components/responses/BlobNotFound' }
'409': { $ref: './blob-store-components.yml#/components/responses/BlobConflict' }
'501': { $ref: './blob-store-components.yml#/components/responses/BlobUnsupported' }
'500': { $ref: './blob-store-components.yml#/components/responses/BlobErrorResponse' }
/blobs:move:
post:
tags: [Blobs]
operationId: moveBlob
summary: Move a blob within or across configured stores
requestBody:
required: true
content:
application/json:
schema: { $ref: './blob-store-components.yml#/components/schemas/BlobTransferRequest' }
responses:
'200':
description: Destination descriptor.
content:
application/json:
schema: { $ref: './blob-store-components.yml#/components/schemas/BlobDescriptor' }
'400': { $ref: './blob-store-components.yml#/components/responses/BlobBadRequest' }
'401': { $ref: './blob-store-components.yml#/components/responses/BlobUnauthorized' }
'403': { $ref: './blob-store-components.yml#/components/responses/BlobForbidden' }
'404': { $ref: './blob-store-components.yml#/components/responses/BlobNotFound' }
'409': { $ref: './blob-store-components.yml#/components/responses/BlobConflict' }
'501': { $ref: './blob-store-components.yml#/components/responses/BlobUnsupported' }
'500': { $ref: './blob-store-components.yml#/components/responses/BlobErrorResponse' }
/stores/{storeId}/cas:
post:
tags: [ContentAddressing]
operationId: storeContentAddressedBlob
summary: Store content by digest
parameters:
- $ref: '#/components/parameters/StoreId'
- name: algorithm
in: query
schema: { type: string, enum: [sha-256, sha-384, sha-512], default: sha-256 }
requestBody:
required: true
content:
application/octet-stream:
schema: { type: string, format: binary }
responses:
'201':
description: Content-addressed descriptor.
content:
application/json:
schema: { $ref: './blob-store-components.yml#/components/schemas/ContentAddressDescriptor' }
'400': { $ref: './blob-store-components.yml#/components/responses/BlobBadRequest' }
'401': { $ref: './blob-store-components.yml#/components/responses/BlobUnauthorized' }
'403': { $ref: './blob-store-components.yml#/components/responses/BlobForbidden' }
'500': { $ref: './blob-store-components.yml#/components/responses/BlobErrorResponse' }
/stores/{storeId}/cas/{algorithm}/{digest}:
parameters:
- $ref: '#/components/parameters/StoreId'
- $ref: '#/components/parameters/DigestAlgorithm'
- $ref: '#/components/parameters/DigestValue'
get:
tags: [ContentAddressing]
operationId: getContentAddressedBlob
summary: Stream content by digest
responses:
'200': { $ref: '#/components/responses/BlobBytes' }
'401': { $ref: './blob-store-components.yml#/components/responses/BlobUnauthorized' }
'403': { $ref: './blob-store-components.yml#/components/responses/BlobForbidden' }
'404': { $ref: './blob-store-components.yml#/components/responses/BlobNotFound' }
'500': { $ref: './blob-store-components.yml#/components/responses/BlobErrorResponse' }
head:
tags: [ContentAddressing]
operationId: verifyContentAddressedBlob
summary: Verify content exists and matches its address
responses:
'200':
description: Integrity verification result.
headers:
X-Blob-Integrity-Valid:
description: Always `true`; an integrity mismatch is an error response.
schema: { type: boolean, enum: [true] }
'401': { $ref: './blob-store-components.yml#/components/responses/BlobUnauthorized' }
'403': { $ref: './blob-store-components.yml#/components/responses/BlobForbidden' }
'404': { $ref: './blob-store-components.yml#/components/responses/BlobNotFound' }
'500': { $ref: './blob-store-components.yml#/components/responses/BlobErrorResponse' }
/stores/{storeId}/temporary-urls:
post:
tags: [TemporaryUrls]
operationId: createBlobTemporaryUrl
summary: Create a temporary provider URL
parameters:
- $ref: '#/components/parameters/StoreId'
- name: blobPath
in: query
required: true
schema: { $ref: './blob-store-components.yml#/components/schemas/BlobPath' }
requestBody:
required: true
content:
application/json:
schema: { $ref: './blob-store-components.yml#/components/schemas/TempUrlRequest' }
responses:
'201':
description: Time-bounded URL and required request headers.
content:
application/json:
schema: { $ref: './blob-store-components.yml#/components/schemas/TempUrlResult' }
'400': { $ref: './blob-store-components.yml#/components/responses/BlobBadRequest' }
'401': { $ref: './blob-store-components.yml#/components/responses/BlobUnauthorized' }
'403': { $ref: './blob-store-components.yml#/components/responses/BlobForbidden' }
'404': { $ref: './blob-store-components.yml#/components/responses/BlobNotFound' }
'501': { $ref: './blob-store-components.yml#/components/responses/BlobUnsupported' }
'500': { $ref: './blob-store-components.yml#/components/responses/BlobErrorResponse' }
components:
securitySchemes:
bearer:
$ref: './common-components.yml#/components/securitySchemes/bearer'
parameters:
StoreId:
name: storeId
in: path
required: true
schema: { type: string, minLength: 1 }
BlobPathQuery:
name: path
in: query
required: true
description: Canonical relative blob path; hierarchical `/` separators remain ordinary query data.
schema: { $ref: './blob-store-components.yml#/components/schemas/BlobPath' }
IfMatch:
name: If-Match
in: header
schema: { type: string }
IfNoneMatch:
name: If-None-Match
in: header
schema: { type: string }
ExpectedRevision:
name: X-Expected-Revision
in: header
schema: { type: integer, format: int64, minimum: 0 }
Digest:
name: Digest
in: header
description: RFC 3230-style digest, for example `sha-256=<base64>`.
schema: { type: string }
BlobMetadata:
name: X-Blob-Metadata
in: header
description: UTF-8 JSON serialization of BlobMetadata. Secrets and key material are forbidden.
schema: { type: string }
DigestAlgorithm:
name: algorithm
in: path
required: true
schema: { type: string, enum: [sha-256, sha-384, sha-512] }
DigestValue:
name: digest
in: path
required: true
schema: { type: string }
responses:
BlobBytes:
description: Streamed blob content.
headers:
ETag: { schema: { type: string } }
X-Blob-Revision: { schema: { type: integer, format: int64 } }
Digest: { schema: { type: string } }
Accept-Ranges: { schema: { type: string, example: bytes } }
content:
application/octet-stream:
schema: { type: string, format: binary }
PartialBlobBytes:
description: Requested byte range.
headers:
Content-Range: { schema: { type: string } }
ETag: { schema: { type: string } }
X-Blob-Revision: { schema: { type: integer, format: int64 } }
Digest: { schema: { type: string } }
content:
application/octet-stream:
schema: { type: string, format: binary }