You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
These capabilities are intended for checking inclusion, or getting the
additional properties we store. This will allow clients to verify all
the shards for an upload have been removed before removing an upload.
## `store/get` delegation
```js
{
can: "store/get",
with: "did:key:abc...",
nb: {
link: "bag...",
}
}
```
### Response
Error if `link` shard cid is not in space or...
```ts
interface StoreListItem {
/** CID of the stored CAR. */
link: string
/** Size in bytes of the stored CAR */
size: number
/** Link to a related CAR, used for sharded uploads */
origin?: string,
/** ISO-8601 timestamp when CAR was added to the space */
insertedAt: string,
}
```
## `upload/get` delegation
```js
{
can: "upload/get",
with: "did:key:abc...",
nb: {
root: "bafyabc..."
}
}
```
### Response
`Error` if root is not in uploads for space or...
```ts
interface UploadListItem {
/** Root CID of the uploaded data item. */
root: string
/** CIDs of CARs that contain the complete DAG for the uploaded data item. */
shards: string[]
/** ISO-8601 timestamp when the upload was added to the space. */
insertedAt: string,
/** ISO-8601 timestamp when the upload entry was last modified. */
updatedAt: string,
}
```
---
see also: storacha/w3up#942
License: MIT
---------
Signed-off-by: Oli Evans <[email protected]>
Copy file name to clipboardexpand all lines: w3-store.md
+124
Original file line number
Diff line number
Diff line change
@@ -22,11 +22,13 @@ The protocol is modeled as a set of capabilities which can be fulfilled by a [pr
22
22
-[`store/` namespace](#store-namespace)
23
23
-[`store/*`](#store)
24
24
-[`store/add`](#storeadd)
25
+
-[`store/get`](#storeget)
25
26
-[`store/remove`](#storeremove)
26
27
-[`store/list`](#storelist)
27
28
-[`upload/` namespace](#upload-namespace)
28
29
-[`upload/*`](#upload)
29
30
-[`upload/add`](#uploadadd)
31
+
-[`upload/get`](#uploadget)
30
32
-[`upload/remove`](#uploadremove)
31
33
-[`upload/list`](#uploadlist)
32
34
@@ -143,6 +145,66 @@ If `status == 'upload'`, the response will include additional fields containing
143
145
144
146
The client should then make an HTTP `PUT` request to the `url` specified in the response, attaching all the included `headers`. The body of the request MUST be CAR data, whose size exactly equals the size specified in the `store/add` invocation's `size` caveat. Additionally, the CID of the uploaded CAR must match the invocation's `link` caveat. In other words, attempting to upload any data other than that authorized by the `store/add` invocation will fail.
145
147
148
+
### `store/get`
149
+
150
+
> Get metadata about a CAR shard from a space
151
+
152
+
The `store/get` capability can be invoked to get metadata about a CAR from a [space](#spaces).
153
+
154
+
This may be used to check for inclusion, or to get the `size` and `origin` properties for a shard.
155
+
156
+
#### Derivations
157
+
158
+
`store/get` can be derived from a [`store/*`](#store) or [`*`][ucan-spec-top] capability with a matching `with` field.
159
+
160
+
#### Caveats
161
+
162
+
When invoking `store/get`, the `link` caveat must be set to the CID of the CAR file to get metadata for.
163
+
164
+
If a delegation contains a `link` caveat, an invocation derived from it must have the same CAR CID in its `link` field. A delegation without a `link` caveat may be invoked with any `link` value.
0 commit comments