ipfs / helia

An implementation of IPFS in JavaScript
https://helia.io
Other
809 stars 81 forks source link

Provide a way to use delegatedHTTPRouting only for IPNS resolution #558

Open 2color opened 2 weeks ago

2color commented 2 weeks ago

Currently

Using delegatedHTTPRouting with a delegated routing endpoint is all or nothing: either used for both resolving ipns names and finding providers, or neither.

Suggestion

As suggested in https://github.com/ipfs/service-worker-gateway/issues/288, it'd be nice if there was a way to use delegatedHTTPRouting only for verified IPNS resolution.

In theory, this could also be implemented by adding IPNS resolution to https://github.com/ipfs/helia/blob/main/packages/routers/src/http-gateway-routing.ts since it's also part of the trustless gateway spec.

achingbrain commented 1 week ago

I guess you could have a Routing implementation that just does IPNS-over-HTTP things and configure that instead of delegatedHTTPRouting?

Basically just the put/get methods from DelegatedHTTPRouter.

Alternatively you could create an IPNS Routing that just does HTTP things and use it directly with the @helia/ipns module, no helia or @helia/http instance needed?