boxo icon indicating copy to clipboard operation
boxo copied to clipboard

feat(routing/http): IPIP-518: HTTP(S) URLs in Routing V1 API

Open lidel opened this issue 3 months ago • 2 comments

This PR implements IPIP-518 which extends /routing/v1 with schema-agnostic support for URIs alongside multiaddrs.

Key changes:

  • Add new Address type that accepts both multiaddrs (starting with /) and URIs
  • Update PeerRecord and BitswapRecord to use Addresses type instead of []Multiaddr
  • Implement defensive programming: unsupported addresses are skipped, not errors
  • Sensible UX:
    • protocol filtering for http/https/tls matching real-world user intent (we expect https:// to be used more and more across the stack)
    • in places where only Multiaddr is returned, we turn https:// urls into /https multiaddrs
  • Backward compatibility with multiaddr-only implementations which currently depend on /https multiaddrs

The implementation is not limited to https://, is schema-agnostic, accepting any valid URI scheme for future extensibility. URLs are preserved as-is without lossy conversion to multiaddrs, avoiding historical conversion issues documented in the IPIP.

IPIP:

  • https://github.com/ipfs/specs/pull/518

TODO

  • [ ] no objections in https://github.com/ipfs/specs/pull/518
  • [ ] PR in someguy that uses this PR and tests there pass green

lidel avatar Oct 13 '25 19:10 lidel

Codecov Report

:x: Patch coverage is 79.83871% with 50 lines in your changes missing coverage. Please review. :white_check_mark: Project coverage is 60.85%. Comparing base (0f1ebac) to head (c9ac579). :warning: Report is 18 commits behind head on main.

Files with missing lines Patch % Lines
routing/http/types/address.go 81.59% 31 Missing and 6 partials :warning:
routing/http/contentrouter/contentrouter.go 33.33% 8 Missing :warning:
routing/http/filters/filters.go 81.48% 4 Missing and 1 partial :warning:

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #1051      +/-   ##
==========================================
+ Coverage   60.75%   60.85%   +0.09%     
==========================================
  Files         268      269       +1     
  Lines       33593    33805     +212     
==========================================
+ Hits        20411    20572     +161     
- Misses      11510    11554      +44     
- Partials     1672     1679       +7     
Files with missing lines Coverage Δ
routing/http/client/client.go 74.82% <100.00%> (+0.05%) :arrow_up:
routing/http/server/server.go 74.22% <100.00%> (+0.05%) :arrow_up:
routing/http/types/record_bitswap.go 40.69% <ø> (ø)
routing/http/types/record_peer.go 83.63% <100.00%> (ø)
routing/http/filters/filters.go 79.59% <81.48%> (-3.05%) :arrow_down:
routing/http/contentrouter/contentrouter.go 50.00% <33.33%> (-0.57%) :arrow_down:
routing/http/types/address.go 81.59% <81.59%> (ø)

... and 9 files with indirect coverage changes

:rocket: New features to boost your workflow:
  • :snowflake: Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

codecov[bot] avatar Oct 13 '25 20:10 codecov[bot]

Triage: Consider updating IPIP to suggest different peer schema. Blocked waiting for more progress in buoy to determine what is needed here.

Note: Should not assume trustless gateway when HTTP URI with no metadata

gammazero avatar Nov 04 '25 16:11 gammazero