kubo/test/cli
Hector Sanjuan b5d73695ba
feat: opt-in http retrieval client (#10772)
* Feat: http retrieval as experimental feature

This introduces the http-retrieval capability as an experimental feature.

It can be enabled in the configuration `Experimental.HTTPRetrieval.Enabled = true`.

Documentation and changelog to be added later.

* refactor: HTTPRetrieval.Enabled as Flag

* docs(config): HTTPRetrieval section

* refactor: reusable MockHTTPContentRouter

* feat: HTTPRetrieval.TLSInsecureSkipVerify

allows self-signed certificates in tests

* feat(config): HTTPRetrieval.MaxBlockSize

* test: end-to-end HTTPRetrieval.Enabled

this spawns two http services on localhost:
1. HTTP router that returns HTTP provider when /routing/v1/providers/cid  i queried
2. HTTP provider that returns a block when /ipfs/cid is queried
3. Configures Kubo to use (1) instead of cid.contact

this seems to work (running test with DEBUG=true shows (1) was queried
for the test CID and returned multiaddr of (2), but Kubo never requested
test CID block from (2) – needs investigation

* fix: enable /routing/v1/peers for non-cid.contact

we artificially limited every delegated routing endpoint because of
cid.contact being limited to one endpoint

* feat: Routing.DelegatedRouters

make it easy to override the hardcoded implicit HTTP routeur URL
without having to set the entire custom Router.Routers and
Router.Methods

(http_retrieval_client_test.go still needs to be fixed in future commit)

* test: flag remaining work

* docs: review feedback

* refactor: providerQueryMgr with bitswapNetworks

this fixes two regressions:

(1) introduced in https://github.com/ipfs/kubo/issues/10717
    where we only used bitswapLib2p query manager
    (this is why E2E did not act on http provider)

(2) introduced in https://github.com/ipfs/kubo/pull/10765
    where it was not possible to set binary peerID in IgnoreProviders
    (we changed to []string)

* refactor: Bitswap.Libp2pEnabled

replaces Bitswap.Enabled with Bitswap.Libp2pEnabled
adds tests that confirm it is possible to disable libp2p bitswap fully
and only keep http in client mode

also, removes the need for passing empty blockstore in client-only mode

* docs: changelog

---------

Co-authored-by: Marcin Rataj <lidel@lidel.org>
2025-05-06 19:06:40 +02:00
..
fixtures feat(ipns): records with V2-only signatures (#9932) 2023-06-20 14:24:31 +02:00
harness feat(config): ipfs add and Import options for controling UnixFS DAG Width (#10774) 2025-04-15 22:56:38 +02:00
testutils feat: opt-in http retrieval client (#10772) 2025-05-06 19:06:40 +02:00
add_test.go feat(config): ipfs add and Import options for controling UnixFS DAG Width (#10774) 2025-04-15 22:56:38 +02:00
backup_bootstrap_test.go feat(bootstrap): save connected peers as backup bootstrap peers (#8856) 2023-05-25 14:39:49 +02:00
basic_commands_test.go Upgrade to go1.24 (#10726) 2025-02-24 14:46:20 -08:00
bitswap_config_test.go feat: opt-in http retrieval client (#10772) 2025-05-06 19:06:40 +02:00
cli_https_test.go fix(cli): support HTTPS in ipfs --api (#10659) 2025-01-10 22:34:56 +01:00
completion_test.go feat: add zsh completions (#10040) 2023-08-17 16:43:27 +02:00
content_blocking_test.go test: cleanup content blocking tests (#10360) 2024-03-01 09:58:10 +01:00
content_routing_http_test.go feat: opt-in http retrieval client (#10772) 2025-05-06 19:06:40 +02:00
daemon_test.go fix: allow daemon to start correctly if the API is null (#10062) 2023-12-11 11:45:08 +01:00
dag_test.go docs: fix some typos (#10377) 2024-03-25 09:59:47 +01:00
delegated_routing_v1_http_client_test.go feat(gateway): expose /routing/v1 server (opt-in) (#9877) 2023-08-25 17:30:04 +02:00
delegated_routing_v1_http_proxy_test.go feat: Better self-service commands for DHT providing (#10677) 2025-01-31 16:33:11 +01:00
delegated_routing_v1_http_server_test.go feat: Better self-service commands for DHT providing (#10677) 2025-01-31 16:33:11 +01:00
dht_autoclient_test.go test: fix autoclient flakiness (#9769) 2023-03-29 11:56:25 -04:00
dht_opt_prov_test.go core: deprecate CoreAPI.Dht, introduce CoreAPI.Routing 2024-02-07 10:47:30 +01:00
files_test.go Nonfunctional (#10753) 2025-03-11 14:04:16 -07:00
gateway_range_test.go feat(gateway): update gateway api, no multi-range support 2023-10-02 16:43:52 +02:00
gateway_test.go chore: update dependencies (#10462)(#10466) 2024-07-30 16:42:18 +02:00
http_gateway_over_libp2p_test.go chore: update dependencies (#10462)(#10466) 2024-07-30 16:42:18 +02:00
http_retrieval_client_test.go feat: opt-in http retrieval client (#10772) 2025-05-06 19:06:40 +02:00
init_test.go style: gofumpt and godot [skip changelog] (#10081) 2023-08-17 14:02:08 +02:00
must.go test: port remote pinning tests to Go (#9720) 2023-03-30 07:46:35 -04:00
name_test.go docs(cli): name inspect --verify (#10308) 2024-01-17 14:59:02 +00:00
peering_test.go feat: add identify option to swarm peers command 2023-03-30 04:34:57 +00:00
ping_test.go chore: update go-libp2p-kad-dht 2023-09-21 20:14:21 +02:00
pinning_remote_test.go test: port remote pinning tests to Go (#9720) 2023-03-30 07:46:35 -04:00
pins_test.go fix(cli): unify --name param in ls and add (#10439) 2024-06-06 22:19:23 +02:00
provider_test.go feat: Better self-service commands for DHT providing (#10677) 2025-01-31 16:33:11 +01:00
rcmgr_test.go fix: future proof with > rcmgr.DefaultLimit for new enum rcmgr values 2023-03-16 13:41:24 +01:00
routing_dht_test.go feat: Better self-service commands for DHT providing (#10677) 2025-01-31 16:33:11 +01:00
rpc_auth_test.go feat(rpc): Opt-in HTTP RPC API Authorization (#10218) 2023-11-17 01:29:29 +01:00
rpc_unixsocket_test.go Cleanup commented imports 2024-08-19 19:55:11 -07:00
stats_test.go fix: stats dht command when Routing.Type=auto (#9538) 2023-01-13 00:38:38 +01:00
swarm_test.go style: gofumpt and godot [skip changelog] (#10081) 2023-08-17 14:02:08 +02:00
tracing_test.go style: gofumpt and godot [skip changelog] (#10081) 2023-08-17 14:02:08 +02:00
transports_test.go feat(AutoTLS): enabled by default with 1h RegistrationDelay (#10724) 2025-02-25 22:25:58 +01:00