From 1ac8ecb7f40c8e10cfba6b518419aac54ae281c0 Mon Sep 17 00:00:00 2001 From: Marcin Rataj Date: Tue, 9 May 2023 16:58:21 +0200 Subject: [PATCH] ipip-0351: final editorial fixes --- src/ipips/ipip-0351.md | 24 +++++++++++++++++++++--- 1 file changed, 21 insertions(+), 3 deletions(-) diff --git a/src/ipips/ipip-0351.md b/src/ipips/ipip-0351.md index 69e04338..77b15830 100644 --- a/src/ipips/ipip-0351.md +++ b/src/ipips/ipip-0351.md @@ -6,6 +6,9 @@ editors: - name: Henrique Dias github: hacdias url: https://hacdias.com/ + - name: Marcin Rataj + github: lidel + url: https://lidel.org/ relatedIssues: - https://github.com/ipfs/specs/issues/320 - https://github.com/ipfs/specs/pull/351 @@ -33,15 +36,29 @@ under the `/ipns` namespace. In this IPIP, we propose adding :cite[ipns-record] as a response format to the gateway under the `/ipns` namespace, allowing for trustless -retrieval of IPNS records. +retrieval of IPNS records over HTTP as [application/vnd.ipfs.ipns-record](https://www.iana.org/assignments/media-types/application/vnd.ipfs.ipns-record) content type (multicodec `0x0300`). ## Detailed design -The solution is to allow the Gateway to provide an IPNS signed record by -requesting it using either the `Accept` HTTP header or the `format` URL query. +- :cite[trustless-gateway] can now provide a signed IPNS record upon request for `/ipns/{ipns-name}` path. +- To request the IPNS record, use one of the following methods: + - Include the `Accept: application/vnd.ipfs.ipns-record` HTTP header in the request. + - Include the `format=ipns-record` query parameter in the request URL. +- The HTTP response containing the verifiable IPNS record will have the following format: + - Header: `Content-Type: application/vnd.ipfs.ipns-record` + - Body: :cite[ipns-record] serialized as the `IpnsEntry` protobuf. ## Test fixtures +This IPIP got ratified before +[gateway-conformance](https://github.com/ipfs/gateway-conformance) existed. + + +The [reference implementation in Kubo 0.19](https://github.com/ipfs/kubo/blob/master/docs/changelogs/v0.19.md#signed-ipns-record-response-format) +provides reusable [assertions](https://github.com/ipfs/kubo/blob/v0.19.2/test/sharness/t0124-gateway-ipns-record.sh). + +:::issue +Until vendor-agnostic fixtures are added to the conformance test suite ([tracking issue](https://github.com/ipfs/gateway-conformance/issues/3)), IPNS records for testing can be generated in Kubo by creating an IPNS record: ```bash @@ -53,6 +70,7 @@ Published to k51Key: /ipfs/bafyHash $ ipfs routing get /ipns/k51Key > key.pb ``` +::: ## Design rationale