diff --git a/src/ipips/ipip-0484.md b/src/ipips/ipip-0484.md index 9812942e..bd368b34 100644 --- a/src/ipips/ipip-0484.md +++ b/src/ipips/ipip-0484.md @@ -60,12 +60,13 @@ The proposed change is to add a `?filter-addrs` parameter to the `GET /routing/v The proposed change is to add a `?filter-protocols` parameter to the `GET /routing/v1/providers/{cid}` endpoint of :cite[http-routing-v1]: -- Add a `?filter-protocols=` optional parameter to `GET /routing/v1/providers/{CID}` that indicates which transfer protocols to return by filtering the `Protocol` field of the [Peer schema] (logical OR). +- Add a `?filter-protocols=` optional parameter to `GET /routing/v1/providers/{CID}` to filter providers based on the `Protocol` field of the [Peer schema] . - The `filter-protocols` parameter is a comma-separated list of transfer protocol names, e.g. `?filter-protocols=transport-bitswap`. - Transfer protocols names should be treated as opaque strings and have a max length of 63 characters. A non-exhaustive list of transfer protocols are defined per convention in the [multicodec registry](https://github.com/multiformats/multicodec/blob/3b7b52deb31481790bc4bae984d8675bda4e0c82/table.csv#L149-L151). Implementations should not break when encountering unknown transfer protocol names. - `unknown` can be be passed to include providers whose transfer protocol is unknown, e.g. `?filter-protocols=unknown`. This allows filtering providers returned from the DHT that do not contain explicit transfer protocol information. -- Providers are filtered by checking if the transfer protocol name appears in the `Protocols` array. +- Providers are filtered by checking if the transfer protocol name appears in the `Protocols` array (logical OR). - If the provider doesn't match any of the passed transfer protocols, the provider is omitted from the response. +- If a provider passes the filter, it is returned unchanged, i.e. the full set of protocols is returned including protocols that not included in the filter. (note that this is different from `filter-addrs` where only the multiaddrs that pass the filter are returned) - Negative filtering is done by prefixing the protocol name with `!`, e.g. `?transport=!transport-graphsync-filecoinv1`. - Filtering is case-insensitive. - If no parameter is passed, the default behavior is to not filter by transfer protocol.