ipfs / boxo

A set of reference libraries for building IPFS applications and implementations in Go.
https://github.com/ipfs/boxo#readme
Other
181 stars 83 forks source link

feat: basic support for Ipfs-Path-Affinity from IPIP-462 #592

Open lidel opened 3 months ago

lidel commented 3 months ago

This PR aims to kick-off discussion how we would support IPIP-462 in boxo/gateway.

For more info and header semantics, see https://github.com/ipfs/specs/pull/462

proposed scope

What I want to do for now is to add minimal code to start leveraging Ipfs-Path-Affinity hints within existing boxo/gateway codebase, so we cna deploy it to our gateways and allow clients like service-worker-gateway or ipfs-chromium to pass hint and retrieve content even when internal CID was not announced directly.

future scope

We may formalize this by extending IPFSBackend with explicit place to pass this hint, and then wire it up into routing system of Kubo, but it feels more involved and would like to do that in follow-up, rather than block on it here.

codecov[bot] commented 3 months ago

Codecov Report

Attention: Patch coverage is 11.11111% with 64 lines in your changes are missing coverage. Please review.

Project coverage is 59.69%. Comparing base (b101ba0) to head (39a8bd7).

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #592      +/-   ##
==========================================
- Coverage   59.78%   59.69%   -0.10%     
==========================================
  Files         232      232              
  Lines       28124    28197      +73     
==========================================
+ Hits        16815    16833      +18     
- Misses       9837     9892      +55     
  Partials     1472     1472              
Files Coverage Δ
gateway/handler.go 70.63% <11.11%> (-7.65%) :arrow_down:

... and 15 files with indirect coverage changes