Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
72 changes: 69 additions & 3 deletions spec.md
Original file line number Diff line number Diff line change
Expand Up @@ -416,7 +416,6 @@ Example error response (missing `controller` property):
```http
HTTP/1.1 400 Bad Request
Content-type: application/problem+json
Content-Language: en

{
"type": "https://wallet.storage/spec#create-space-errors",
Expand All @@ -435,7 +434,6 @@ Example error response (missing Proof of Possession signature):
```http
HTTP/1.1 401 Unauthorized
Content-type: application/problem+json
Content-Language: en

{
"type": "https://wallet.storage/spec#create-space-errors",
Expand All @@ -454,7 +452,6 @@ header does not match the DID specified in the `controller`):
```http
HTTP/1.1 403 Forbidden
Content-type: application/problem+json
Content-Language: en

{
"type": "https://wallet.storage/spec#create-space-errors",
Expand All @@ -481,6 +478,9 @@ Example error response (a space with the specified `id` already exists):

#### (HTTP API) GET `/space/{space_id}`

Returns the properties of a given space, _without_ the contents of the default
(`/`) collection. Note the lack of a trailing `/` in the GET url.

Example request:

```http
Expand All @@ -505,12 +505,78 @@ Content-type: application/json
}
```

#### Read Space Errors

Example error response (missing or insufficient authorization):

A server MUST return the same error response in the case of missing or insufficient
authorization as it would for a missing/not found space.

```http
HTTP/1.1 404 Not Found
```

Example error response (space id not found):

```http
HTTP/1.1 404 Not Found
```

### List Contents of the Default `/` Space Collection

This lists the items in the space's default `/` collection. Note the trailing
slash.

Example request:

```http
GET /space/81246131-69a4-45ab-9bff-9c946b59cf2e/ HTTP/1.1
Host: example.com
Accept: application/json
Authorization: Signature keyId="did:key:z6MkpBMbMaRSv5nsgifRAwEKvHHoiKDMhiAHShTFNmkJNdVW#z6MkpBMbMaRSv5nsgifRAwEKvHHoiKDMhiAHShTFNmkJNdVW" ...
```

Example success response (the collection is empty of contents):

```http
HTTP/1.1 200 OK
Content-type: application/json

{
"type": ["Collection"],
"controller": "did:key:z6MkpBMbMaRSv5nsgifRAwEKvHHoiKDMhiAHShTFNmkJNdVW",
"linkset": "/space/81246131-69a4-45ab-9bff-9c946b59cf2e/linkset",
"totalItems": 0
}
```

Example success response (resources have been added to the space):

* Contents listed in a format inspired by [ActivityStreams 2](https://www.w3.org/TR/activitystreams-core/#collections)
Collections
* No pagination used

```http
HTTP/1.1 200 OK
Content-type: application/json

{
"type": ["Collection"],
"name": "Example space #1",
"controller": "did:key:z6MkpBMbMaRSv5nsgifRAwEKvHHoiKDMhiAHShTFNmkJNdVW",
"linkset": "/space/81246131-69a4-45ab-9bff-9c946b59cf2e/linkset",
"totalItems": 2,
"items": [
{ "id": "https://example.com/space/81246131-69a4-45ab-9bff-9c946b59cf2e/10f6672d-7a24-486b-9622-691007ded846" },
{ "id": "https://example.com/space/81246131-69a4-45ab-9bff-9c946b59cf2e/b42ec4d8-6ead-486d-b70a-c25d2ce4dfc7" }
]
}
```

### List Spaces Operation

Lists spaces for in a given server.

* Requires appropriate authorization (root zcap invoked by the controller of one
or more spaces, or a zcap granting permission to read a one or more spaces)

Expand Down