routing/http!: support for IPIP-378 (delegated content and peer providing)
This is the client and server implementation for the delegated PUTs for peers and providers. See the specification on https://github.com/ipfs/specs/pull/378. There are breaking changes. Check the changelog to know more about them.
Since the specification is not yet finished and set in stone, there are quite a few questions that I need answered in order to finish the code. They are written as TODO comments in line and I left them also in the specs PR.
- [x] Solve in-code
TODO, which are mostly related to specifications - [x] Client tests for
Provide(also test server) - [x] Client tests for
ProvidePeer(also test server) - [x] Simple server tests for
Provideoutput - [x] Simple server tests for
ProvidePeeroutput - [x] Changelog
Not needed to merge this:
- [ ]
someguy: https://github.com/ipfs/someguy/pull/40 - [ ]
kubo: https://github.com/ipfs/kubo/pull/10420- Only dependency update, no support for POST per se
- [ ]
ipni: https://github.com/ipni/index-provider/pull/441
Codecov Report
Attention: Patch coverage is 57.47126% with 222 lines in your changes are missing coverage. Please review.
Project coverage is 59.69%. Comparing base (
0f223aa) to head (abf64fc).
@@ Coverage Diff @@
## main #539 +/- ##
==========================================
+ Coverage 59.66% 59.69% +0.02%
==========================================
Files 238 237 -1
Lines 29883 30071 +188
==========================================
+ Hits 17831 17951 +120
- Misses 10433 10485 +52
- Partials 1619 1635 +16
| Files | Coverage Δ | |
|---|---|---|
| routing/http/types/ipfs.go | 50.00% <ø> (-2.00%) |
:arrow_down: |
| routing/http/types/iter/iter.go | 89.28% <100.00%> (ø) |
|
| routing/http/contentrouter/contentrouter.go | 51.55% <88.88%> (+2.41%) |
:arrow_up: |
| routing/http/types/iter/filter.go | 76.19% <76.19%> (ø) |
|
| routing/http/types/json/responses.go | 41.86% <10.00%> (-8.96%) |
:arrow_down: |
| routing/http/types/ndjson/records.go | 38.18% <42.85%> (-16.93%) |
:arrow_down: |
| routing/http/server/server.go | 68.22% <63.33%> (-3.84%) |
:arrow_down: |
| routing/http/client/client.go | 66.91% <59.15%> (-6.10%) |
:arrow_down: |
| routing/http/types/record_announcement.go | 54.75% <54.75%> (ø) |
There's still a few tests added, but I'm opening this as ready for review @lidel. It would be useful to go through the code and checking the TODOs that I added inline.