diff --git a/tests/dnslink_gateway_test.go b/tests/dnslink_gateway_test.go index c6eee1d99..0a18a23b2 100644 --- a/tests/dnslink_gateway_test.go +++ b/tests/dnslink_gateway_test.go @@ -13,127 +13,6 @@ import ( "github.com/ipfs/gateway-conformance/tooling/tmpl" ) -// TODO(laurent): this were in t0114_gateway_subdomains_test.go - -func TestDNSLinkGateway(t *testing.T) { - tests := SugarTests{ - // ## ============================================================================ - // ## Test DNSLink requests with a custom PublicGateway (hostname config) - // ## (DNSLink site at http://dnslink-test.example.com) - // ## ============================================================================ - // # disable wildcard DNSLink gateway - // # and enable it on specific NSLink hostname - // ipfs config --json Gateway.NoDNSLink true && \ - // ipfs config --json Gateway.PublicGateways '{ - // "dnslink-enabled-on-fqdn.example.org": { - // "NoDNSLink": false, - // "UseSubdomains": false, - // "Paths": ["/ipfs"] - // }, - // "only-dnslink-enabled-on-fqdn.example.org": { - // "NoDNSLink": false, - // "UseSubdomains": false, - // "Paths": [] - // }, - // "dnslink-disabled-on-fqdn.example.com": { - // "NoDNSLink": true, - // "UseSubdomains": false, - // "Paths": [] - // } - // }' || exit 1 - - // # DNSLink test requires a daemon in online mode with precached /ipns/ mapping - // DNSLINK_FQDN="dnslink-enabled-on-fqdn.example.org" - // ONLY_DNSLINK_FQDN="only-dnslink-enabled-on-fqdn.example.org" - // NO_DNSLINK_FQDN="dnslink-disabled-on-fqdn.example.com" - // export IPFS_NS_MAP="$DNSLINK_FQDN:/ipfs/$CIDv1,$ONLY_DNSLINK_FQDN:/ipfs/$DIR_CID" - - // # DNSLink enabled - - // test_hostname_gateway_response_should_contain \ - // "request for http://{dnslink-fqdn}/ PublicGateway returns expected payload" \ - // "$DNSLINK_FQDN" \ - // "http://127.0.0.1:$GWAY_PORT/" \ - // "$CID_VAL" - - // test_hostname_gateway_response_should_contain \ - // "request for {dnslink-fqdn}/ipfs/{cid} returns expected payload when /ipfs is on Paths whitelist" \ - // "$DNSLINK_FQDN" \ - // "http://127.0.0.1:$GWAY_PORT/ipfs/$CIDv1" \ - // "$CID_VAL" - - // # Test for a fun edge case: DNSLink-only gateway without /ipfs/ namespace - // # mounted, and with subdirectory named "ipfs" ¯\_(ツ)_/¯ - // test_hostname_gateway_response_should_contain \ - // "request for {dnslink-fqdn}/ipfs/file.txt returns data from content root when /ipfs in not on Paths whitelist" \ - // "$ONLY_DNSLINK_FQDN" \ - // "http://127.0.0.1:$GWAY_PORT/ipfs/file.txt" \ - // "I am a txt file" - - // test_hostname_gateway_response_should_contain \ - // "request for {dnslink-fqdn}/ipns/{peerid} returns 404 when path is not whitelisted" \ - // "$DNSLINK_FQDN" \ - // "http://127.0.0.1:$GWAY_PORT/ipns/$RSA_IPNS_IDv0" \ - // "404 Not Found" - - // test_hostname_gateway_response_should_contain \ - // "request for {dnslink-fqdn}/ipns/{peerid} returns 404 when path is not whitelisted" \ - // "$DNSLINK_FQDN" \ - // "http://127.0.0.1:$GWAY_PORT/ipns/$ED25519_IPNS_IDv0" \ - // "404 Not Found" - - // # DNSLink disabled - - // test_hostname_gateway_response_should_contain \ - // "request for http://{dnslink-fqdn}/ returns 404 when NoDNSLink=true" \ - // "$NO_DNSLINK_FQDN" \ - // "http://127.0.0.1:$GWAY_PORT/" \ - // "404 Not Found" - - // test_hostname_gateway_response_should_contain \ - // "request for {dnslink-fqdn}/ipfs/{cid} returns 404 when path is not whitelisted" \ - // "$NO_DNSLINK_FQDN" \ - // "http://127.0.0.1:$GWAY_PORT/ipfs/$CIDv0" \ - // "404 Not Found" - - // ## ============================================================================ - // ## Test wildcard DNSLink (any hostname, with default config) - // ## ============================================================================ - - // test_kill_ipfs_daemon - - // # enable wildcard DNSLink gateway (any value in Host header) - // # and remove custom PublicGateways - // ipfs config --json Gateway.NoDNSLink false && \ - // ipfs config --json Gateway.PublicGateways '{}' || exit 1 - - // # DNSLink test requires a daemon in online mode with precached /ipns/ mapping - // DNSLINK_FQDN="wildcard-dnslink-not-in-config.example.com" - // export IPFS_NS_MAP="$DNSLINK_FQDN:/ipfs/$CIDv1" - - // # restart daemon to apply config changes - // test_launch_ipfs_daemon - - // # make sure test setup is valid (fail if CoreAPI is unable to resolve) - // test_expect_success "spoofed DNSLink record resolves in cli" " - // ipfs resolve /ipns/$DNSLINK_FQDN > result && - // test_should_contain \"$CIDv1\" result && - // ipfs cat /ipns/$DNSLINK_FQDN > result && - // test_should_contain \"$CID_VAL\" result - // " - - // # gateway test - // - // test_hostname_gateway_response_should_contain \ - // "request for http://{dnslink-fqdn}/ (wildcard) returns expected payload" \ - // "$DNSLINK_FQDN" \ - // "http://127.0.0.1:$GWAY_PORT/" \ - // "$CID_VAL" - } - - RunWithSpecs(t, helpers.UnwrapSubdomainTests(t, tests), specs.DNSLinkGateway) -} - func TestDNSLinkGatewayUnixFSDirectoryListing(t *testing.T) { fixture := car.MustOpenUnixfsCar("dir_listing/fixtures.car") file := fixture.MustGetNode("ą", "ę", "file-źł.txt")