ipfs / helia-http-gateway

Run Helia NodeJS in a Docker Container.
Other
9 stars 6 forks source link

feat: enable gateway-conformance tests #30

Open SgtPooki opened 8 months ago

SgtPooki commented 8 months ago

similar to https://github.com/ipfs/bifrost-gateway/blob/70f10e7b9688cd504f881d57ff3fa71215813e16/.github/workflows/gateway-conformance.yml

Currently passing tests on https://github.com/ipfs/helia-http-gateway/pull/57 (last updated 2023-12-04):

`subdomain-ipns-gateway` ``` PASS: TestMetadata (0.00s) PASS: TestGatewaySubdomainAndIPNS/request_for_%7BCIDv1-libp2p-key%7D.ipns.%7Bgateway%7D_returns_expected_payload_%28direct_HTTP%29/Status_code (0.00s) PASS: TestGatewaySubdomainAndIPNS/request_for_%7BCIDv1-libp2p-key%7D.ipns.%7Bgateway%7D_returns_expected_payload_%28HTTP_proxy%29/Status_code (0.00s) PASS: TestGatewaySubdomainAndIPNS/request_for_%7BCIDv1-libp2p-key%7D.ipns.%7Bgateway%7D_returns_expected_payload_%28direct_HTTP%29#01/Status_code (0.00s) PASS: TestGatewaySubdomainAndIPNS/request_for_%7BCIDv1-libp2p-key%7D.ipns.%7Bgateway%7D_returns_expected_payload_%28HTTP_proxy%29#01/Status_code (0.00s) PASS: TestGatewaySubdomainAndIPNS/request_for_%7BCIDv1-libp2p-key%7D.ipns.%7Bgateway%7D_returns_expected_payload_%28direct_HTTP%29#02/Status_code (0.00s) PASS: TestGatewaySubdomainAndIPNS/request_for_%7BCIDv1-libp2p-key%7D.ipns.%7Bgateway%7D_returns_expected_payload_%28HTTP_proxy%29#02/Status_code (0.00s) PASS: TestGatewaySubdomainAndIPNS/request_for_%7BCIDv1-libp2p-key%7D.ipns.%7Bgateway%7D_returns_expected_payload_%28direct_HTTP%29#03/Status_code (0.00s) PASS: TestGatewaySubdomainAndIPNS/request_for_%7BCIDv1-libp2p-key%7D.ipns.%7Bgateway%7D_returns_expected_payload_%28HTTP_proxy%29#03/Status_code (0.00s) ```
`subdomain-ipfs-gateway` ``` PASS: TestMetadata (0.00s) PASS: TestGatewaySubdomains/request_for_%7BCID%7D.ipfs.example.com_should_return_expected_payload_%28direct_HTTP%29/Status_code (0.00s) PASS: TestGatewaySubdomains/request_for_%7BCID%7D.ipfs.example.com_should_return_expected_payload_%28direct_HTTP%29/Body (0.00s) PASS: TestGatewaySubdomains/request_for_%7BCID%7D.ipfs.example.com_should_return_expected_payload_%28direct_HTTP%29 (0.99s) PASS: TestGatewaySubdomains/request_for_%7BCID%7D.ipfs.example.com_should_return_expected_payload_%28HTTP_proxy%29/Status_code (0.00s) PASS: TestGatewaySubdomains/valid_file_and_subdirectory_paths_in_directory_listing_at_%7Bcid%7D.ipfs.example.com_%28direct_HTTP%29/Status_code (0.00s) PASS: TestGatewaySubdomains/valid_file_and_subdirectory_paths_in_directory_listing_at_%7Bcid%7D.ipfs.example.com_%28HTTP_proxy%29/Status_code (0.00s) PASS: TestGatewaySubdomains/request_for_%7BCID%7D.ipfs.example.com_should_return_expected_payload_%28direct_HTTP%29#01/Status_code (0.00s) PASS: TestGatewaySubdomains/request_for_%7BCID%7D.ipfs.example.com_should_return_expected_payload_%28direct_HTTP%29#01/Body (0.00s) PASS: TestGatewaySubdomains/request_for_%7BCID%7D.ipfs.example.com_should_return_expected_payload_%28direct_HTTP%29#01 (0.00s) PASS: TestGatewaySubdomains/request_for_%7BCID%7D.ipfs.example.com_should_return_expected_payload_%28HTTP_proxy%29#01/Status_code (0.00s) PASS: TestGatewaySubdomains/valid_file_and_subdirectory_paths_in_directory_listing_at_%7Bcid%7D.ipfs.example.com_%28direct_HTTP%29#01/Status_code (0.00s) PASS: TestGatewaySubdomains/valid_file_and_subdirectory_paths_in_directory_listing_at_%7Bcid%7D.ipfs.example.com_%28HTTP_proxy%29#01/Status_code (0.00s) ```
### Tasks
- [x] Figure out how to load fixtures (need to do via new api-endpoint if we're using in-memory block/data stores)
- [ ] Address failure for `http://localhost:8090/ipns/?uri=ipns%3A%2F%2Fdnslink-subdomain-gw-test.example.org` requests
- [ ] fix `http://localhost:8090/ipns/dnslink-subdomain-gw-test.example.org/wiki`
- [ ] fix `http://k51qzi5uqu5dk3v4rmjber23h16xnr23bsggmqqil9z2gduiis5se8dht36dam.ipns.localhost:8090
- [ ] fix `http://localhost:8090/ipns/QmVujd5Vb7moysJj8itnGufN7MEtPRCNHkKpNuA4onsRa3`
- [ ] fix IPNS resolution using IPNS fixtures loaded in kubo
lidel commented 8 months ago

There is more recent prior art in https://github.com/ipfs/rainbow/pull/34 where rainbow gateway is peered to a kubo node and the fixtures are loaded into kubo. then rainbow is able to find them thanks to being connected to kubo. Something similar could be done in this repo.

SgtPooki commented 8 months ago

There is more recent prior art in https://github.com/ipfs/rainbow/pull/34 where rainbow gateway is peered to a kubo node and the fixtures are loaded into kubo. then rainbow is able to find them thanks to being connected to kubo. Something similar could be done in this repo.

That's a great idea, thanks