Skip to content

Commit f6f0d9b

Browse files
committed
1 parent fbefb1b commit f6f0d9b

File tree

2 files changed

+9
-17
lines changed

2 files changed

+9
-17
lines changed

src/ipips/ipip-0378.md

+2-4
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,6 @@ HTTP APIs.
7070

7171
##### DHT
7272

73-
7473
Records published through HTTP delegated routing will not benefit from implicit
7574
PeerID identity and libp2p handshake, and must be explicitly signed.
7675

@@ -79,10 +78,10 @@ explicit signature. That is why the `POST` APIs proposed here introduce a new
7978
DAG-CBOR data format for specifying provider records, and mechanism for signing
8079
them.
8180

82-
8381
##### Reframe
8482

85-
This API was superseded by `/routing/v1`. See [IPIP-337/Backwards Compatibility](https://specs.ipfs.tech/ipips/ipip-0337/#backwards-compatibility).
83+
The Reframe API was superseded by `/routing/v1`.
84+
See [IPIP-337/Backwards Compatibility](https://specs.ipfs.tech/ipips/ipip-0337/#backwards-compatibility).
8685

8786
#### Forwards Compatibility
8887

@@ -94,7 +93,6 @@ support for delegated announcement to Amino DHT, where client sends
9493
announcement to HTTP API, and then API backend takes care of sending it
9594
to 20 peers.
9695

97-
9896
### Security
9997

10098
This IPIP reuses semantics of IPNS Record signatures but with a different prefix, to avoid signature reuse attacks.

src/routing/http-routing-v1.md

+7-13
Original file line numberDiff line numberDiff line change
@@ -114,9 +114,8 @@ Server SHOULD accept representing writes is [Announcement Schema](#announcement
114114

115115
:::warn
116116

117-
TODO: is below a sensible limit?
118-
119-
There SHOULD be no more than 100 `Providers` per request.
117+
Since non-streaming results have to be buffered before sending,
118+
server SHOULD be no more than 100 `Providers` per `application/json` response.
120119

121120
:::
122121

@@ -195,10 +194,9 @@ Each object in the `Peers` list is a record conforming to the [Peer Schema](#pee
195194
}
196195
```
197196

198-
Each object in the `Providers` list is a *write provider record* entry.
197+
Each object in the `Peers` list is a *write peer record* entry.
199198

200-
Server SHOULD accept writes represented with [Announcement Schema](#announcement-schema)
201-
objects with `CID` list.
199+
Server SHOULD accept writes represented with [Announcement Schema](#announcement-schema).
202200

203201
#### `POST` Response codes
204202

@@ -396,9 +394,9 @@ The `announcement` schema can be used in `POST` operations to announce content p
396394

397395
- `Schema`: tells the server to interpret the JSON object as announce provider
398396
- `Payload`: is a DAG-JSON-compatible object with a subset of the below fields
399-
- `CID` is the CID being provided.
397+
- `CID` is the CID being provided (`/routing/v1/providers` only).
400398
- This field is not presend when used for `POST /routing/v1/peers`
401-
- `Scope` is an optional hint that provides semantic meaning about announced identifies:
399+
- `Scope` is an optional hint that provides semantic meaning about CID (`/routing/v1/providers` only):
402400
- `block` announces only the individual block (this is the implicit default if `Scope` field is not present).
403401
- `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).
404402
- `recursive` announces entire DAGs behind the CIDs (e.g.: entire DAG-CBOR DAG, or everything in UnixFS directory, including all files in all subdirectories).
@@ -422,11 +420,7 @@ The `announcement` schema can be used in `POST` operations to announce content p
422420
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.
423421
- A [400 Bad Request](https://httpwg.org/specs/rfc9110.html#status.400) response code SHOULD be returned if the `Signature` check fails.
424422

425-
:::warn
426-
427-
TODO: what should be the limits? Max number of CIDs per `announcement` ?
428-
429-
:::
423+
Server SHOULD return HTTP 400 Bad Request when announcement `Payload` serizalized to DAG-CBOR is bigger than 2MiB.
430424

431425
#### Use in POST responses
432426

0 commit comments

Comments
 (0)