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
Copy file name to clipboardexpand all lines: src/routing/http-routing-v1.md
+9-6
Original file line number
Diff line number
Diff line change
@@ -119,7 +119,7 @@ server SHOULD be no more than 100 `Providers` per `application/json` response.
119
119
120
120
:::
121
121
122
-
#### `POST` Response codes
122
+
#### `POST` Response Status Codes
123
123
124
124
-`200` (OK): the server processed the full list of provider records (possibly unsuccessfully, depending on the semantics of the particular records)
125
125
-`400` (Bad Request): the server deems the request to be invalid and cannot process it
@@ -198,7 +198,7 @@ Each object in the `Peers` list is a *write peer record* entry.
198
198
199
199
Server SHOULD accept writes represented with [Announcement Schema](#announcement-schema).
200
200
201
-
#### `POST` Response codes
201
+
#### `POST` Response Status Codes
202
202
203
203
-`200` (OK): the server processed the full list of provider records (possibly unsuccessfully, depending on the semantics of the particular records)
204
204
-`400` (Bad Request): the server deems the request to be invalid and cannot process it
@@ -392,10 +392,12 @@ The `announcement` schema can be used in `POST` operations to announce content p
392
392
}
393
393
```
394
394
395
+
395
396
-`Schema`: tells the server to interpret the JSON object as announce provider
396
-
-`Payload`: is a DAG-JSON-compatible object with a subset of the below fields
397
+
-`Payload`: is a map object with a subset of the below fields.
398
+
- All keys and values in `Payload` map are strings to remove ambiguity of how `Signature` is calculated.
397
399
-`CID` is the CID being provided (`/routing/v1/providers` only).
398
-
- This field is not presend when used for `POST /routing/v1/peers`
400
+
- This field is not present when used for `POST /routing/v1/peers`
399
401
-`Scope` is an optional hint that provides semantic meaning about CID (`/routing/v1/providers` only):
400
402
-`block` announces only the individual block (this is the implicit default if `Scope` field is not present).
401
403
-`entity` announces CIDs required for enumerating entity behind the CID (e.g.: all blocks for UnixFS file or a minimum set of blocks to enumerate contents of HAMT-sharded UnixFS directory, only top level of directory tree, etc).
@@ -418,9 +420,10 @@ The `announcement` schema can be used in `POST` operations to announce content p
418
420
- ED25519 and other small public keys MUST be inlined inside of the `ID` field with the identity multihash type.
419
421
- Key types that exceed 42 bytes (e.g. RSA) SHOULD NOT be inlined, the `ID` field should only include the multihash of the key. The key itself SHOULD be obtained out-of-band (e.g. by fetching the block via IPFS) and cached.
420
422
If support for big keys is needed in the future, this spec can be updated to allow the client to provide the key and key type out-of-band by adding optional `PublicKey` fields, and if the Peer ID is a CID, then the server can verify the public key's authenticity against the CID, and then proceed with the rest of the verification scheme.
421
-
- A [400 Bad Request](https://httpwg.org/specs/rfc9110.html#status.400) response code SHOULD be returned if the `Signature` check fails.
422
423
423
-
Server SHOULD return HTTP 400 Bad Request when announcement `Payload` serizalized to DAG-CBOR is bigger than 2MiB.
424
+
A [400 Bad Request](https://httpwg.org/specs/rfc9110.html#status.400) response code SHOULD be returned if either
425
+
-`Signature` is not valid
426
+
-`Payload` serialized to DAG-CBOR is bigger than 2MiB
0 commit comments