From 1153850acaebec194b6b8974ff739cdbb5ffaad3 Mon Sep 17 00:00:00 2001 From: Simone Basso Date: Fri, 2 Sep 2022 14:44:23 +0200 Subject: [PATCH] cleanup: doh.powerdns.org is not working anymore (#924) While there, `.../internal/sessionresolver` => `.../sessionresolver` See https://github.com/ooni/probe/issues/2255 --- internal/engine/netx/dnstransport.go | 4 +--- internal/engine/netx/dnstransport_test.go | 16 ---------------- internal/engine/session.go | 2 +- .../engine/{internal => }/sessionresolver/doc.go | 0 .../{internal => }/sessionresolver/errwrapper.go | 0 .../sessionresolver/errwrapper_test.go | 0 .../sessionresolver/integration_test.go | 2 +- .../{internal => }/sessionresolver/jsoncodec.go | 0 .../sessionresolver/jsoncodec_test.go | 0 .../{internal => }/sessionresolver/lookup.go | 0 .../sessionresolver/lookup_test.go | 0 .../{internal => }/sessionresolver/resolver.go | 0 .../sessionresolver/resolver_test.go | 0 .../sessionresolver/resolvermaker.go | 2 -- .../sessionresolver/resolvermaker_test.go | 0 .../{internal => }/sessionresolver/state.go | 0 .../{internal => }/sessionresolver/state_test.go | 0 17 files changed, 3 insertions(+), 23 deletions(-) rename internal/engine/{internal => }/sessionresolver/doc.go (100%) rename internal/engine/{internal => }/sessionresolver/errwrapper.go (100%) rename internal/engine/{internal => }/sessionresolver/errwrapper_test.go (100%) rename internal/engine/{internal => }/sessionresolver/integration_test.go (89%) rename internal/engine/{internal => }/sessionresolver/jsoncodec.go (100%) rename internal/engine/{internal => }/sessionresolver/jsoncodec_test.go (100%) rename internal/engine/{internal => }/sessionresolver/lookup.go (100%) rename internal/engine/{internal => }/sessionresolver/lookup_test.go (100%) rename internal/engine/{internal => }/sessionresolver/resolver.go (100%) rename internal/engine/{internal => }/sessionresolver/resolver_test.go (100%) rename internal/engine/{internal => }/sessionresolver/resolvermaker.go (98%) rename internal/engine/{internal => }/sessionresolver/resolvermaker_test.go (100%) rename internal/engine/{internal => }/sessionresolver/state.go (100%) rename internal/engine/{internal => }/sessionresolver/state_test.go (100%) diff --git a/internal/engine/netx/dnstransport.go b/internal/engine/netx/dnstransport.go index f2b2814..a19f1ff 100644 --- a/internal/engine/netx/dnstransport.go +++ b/internal/engine/netx/dnstransport.go @@ -24,7 +24,7 @@ import ( // create the underlying Dialer and/or HTTP transport, if needed. The URL // argument describes the kind of client that we want to make: // -// - if the URL is `doh://powerdns`, `doh://google` or `doh://cloudflare` or the URL +// - if the URL is `doh://google` or `doh://cloudflare` or the URL // starts with `https://`, then we create a DoH client. // // - if the URL is `` or `system:///`, then we create a system client, @@ -49,8 +49,6 @@ func NewDNSClientWithOverrides(config Config, URL, hostOverride, SNIOverride, // We should split this function in smaller and testable units // TODO(https://github.com/ooni/probe/issues/2121#issuecomment-1147424810) switch URL { - case "doh://powerdns": - URL = "https://doh.powerdns.org/" case "doh://google": URL = "https://dns.google/dns-query" case "doh://cloudflare": diff --git a/internal/engine/netx/dnstransport_test.go b/internal/engine/netx/dnstransport_test.go index 69ba038..6743256 100644 --- a/internal/engine/netx/dnstransport_test.go +++ b/internal/engine/netx/dnstransport_test.go @@ -29,22 +29,6 @@ func TestNewDNSClientUnsupportedScheme(t *testing.T) { } } -func TestNewDNSClientPowerdnsDoH(t *testing.T) { - dnsclient, err := NewDNSClient( - Config{}, "doh://powerdns") - if err != nil { - t.Fatal(err) - } - r, ok := dnsclient.(*netxlite.SerialResolver) - if !ok { - t.Fatal("not the resolver we expected") - } - if _, ok := r.Transport().(*netxlite.DNSOverHTTPSTransport); !ok { - t.Fatal("not the transport we expected") - } - dnsclient.CloseIdleConnections() -} - func TestNewDNSClientGoogleDoH(t *testing.T) { dnsclient, err := NewDNSClient( Config{}, "doh://google") diff --git a/internal/engine/session.go b/internal/engine/session.go index f71843b..15acbfb 100644 --- a/internal/engine/session.go +++ b/internal/engine/session.go @@ -13,8 +13,8 @@ import ( "github.com/ooni/probe-cli/v3/internal/atomicx" "github.com/ooni/probe-cli/v3/internal/bytecounter" "github.com/ooni/probe-cli/v3/internal/engine/geolocate" - "github.com/ooni/probe-cli/v3/internal/engine/internal/sessionresolver" "github.com/ooni/probe-cli/v3/internal/engine/probeservices" + "github.com/ooni/probe-cli/v3/internal/engine/sessionresolver" "github.com/ooni/probe-cli/v3/internal/kvstore" "github.com/ooni/probe-cli/v3/internal/model" "github.com/ooni/probe-cli/v3/internal/netxlite" diff --git a/internal/engine/internal/sessionresolver/doc.go b/internal/engine/sessionresolver/doc.go similarity index 100% rename from internal/engine/internal/sessionresolver/doc.go rename to internal/engine/sessionresolver/doc.go diff --git a/internal/engine/internal/sessionresolver/errwrapper.go b/internal/engine/sessionresolver/errwrapper.go similarity index 100% rename from internal/engine/internal/sessionresolver/errwrapper.go rename to internal/engine/sessionresolver/errwrapper.go diff --git a/internal/engine/internal/sessionresolver/errwrapper_test.go b/internal/engine/sessionresolver/errwrapper_test.go similarity index 100% rename from internal/engine/internal/sessionresolver/errwrapper_test.go rename to internal/engine/sessionresolver/errwrapper_test.go diff --git a/internal/engine/internal/sessionresolver/integration_test.go b/internal/engine/sessionresolver/integration_test.go similarity index 89% rename from internal/engine/internal/sessionresolver/integration_test.go rename to internal/engine/sessionresolver/integration_test.go index d9c729a..4872678 100644 --- a/internal/engine/internal/sessionresolver/integration_test.go +++ b/internal/engine/sessionresolver/integration_test.go @@ -4,7 +4,7 @@ import ( "context" "testing" - "github.com/ooni/probe-cli/v3/internal/engine/internal/sessionresolver" + "github.com/ooni/probe-cli/v3/internal/engine/sessionresolver" "github.com/ooni/probe-cli/v3/internal/kvstore" ) diff --git a/internal/engine/internal/sessionresolver/jsoncodec.go b/internal/engine/sessionresolver/jsoncodec.go similarity index 100% rename from internal/engine/internal/sessionresolver/jsoncodec.go rename to internal/engine/sessionresolver/jsoncodec.go diff --git a/internal/engine/internal/sessionresolver/jsoncodec_test.go b/internal/engine/sessionresolver/jsoncodec_test.go similarity index 100% rename from internal/engine/internal/sessionresolver/jsoncodec_test.go rename to internal/engine/sessionresolver/jsoncodec_test.go diff --git a/internal/engine/internal/sessionresolver/lookup.go b/internal/engine/sessionresolver/lookup.go similarity index 100% rename from internal/engine/internal/sessionresolver/lookup.go rename to internal/engine/sessionresolver/lookup.go diff --git a/internal/engine/internal/sessionresolver/lookup_test.go b/internal/engine/sessionresolver/lookup_test.go similarity index 100% rename from internal/engine/internal/sessionresolver/lookup_test.go rename to internal/engine/sessionresolver/lookup_test.go diff --git a/internal/engine/internal/sessionresolver/resolver.go b/internal/engine/sessionresolver/resolver.go similarity index 100% rename from internal/engine/internal/sessionresolver/resolver.go rename to internal/engine/sessionresolver/resolver.go diff --git a/internal/engine/internal/sessionresolver/resolver_test.go b/internal/engine/sessionresolver/resolver_test.go similarity index 100% rename from internal/engine/internal/sessionresolver/resolver_test.go rename to internal/engine/sessionresolver/resolver_test.go diff --git a/internal/engine/internal/sessionresolver/resolvermaker.go b/internal/engine/sessionresolver/resolvermaker.go similarity index 98% rename from internal/engine/internal/sessionresolver/resolvermaker.go rename to internal/engine/sessionresolver/resolvermaker.go index 2040afd..303c107 100644 --- a/internal/engine/internal/sessionresolver/resolvermaker.go +++ b/internal/engine/sessionresolver/resolvermaker.go @@ -35,8 +35,6 @@ var allmakers = []*resolvermaker{{ url: "http3://dns.google/dns-query", }, { url: "https://dns.quad9.net/dns-query", -}, { - url: "https://doh.powerdns.org/", }, { url: systemResolverURL, }, { diff --git a/internal/engine/internal/sessionresolver/resolvermaker_test.go b/internal/engine/sessionresolver/resolvermaker_test.go similarity index 100% rename from internal/engine/internal/sessionresolver/resolvermaker_test.go rename to internal/engine/sessionresolver/resolvermaker_test.go diff --git a/internal/engine/internal/sessionresolver/state.go b/internal/engine/sessionresolver/state.go similarity index 100% rename from internal/engine/internal/sessionresolver/state.go rename to internal/engine/sessionresolver/state.go diff --git a/internal/engine/internal/sessionresolver/state_test.go b/internal/engine/sessionresolver/state_test.go similarity index 100% rename from internal/engine/internal/sessionresolver/state_test.go rename to internal/engine/sessionresolver/state_test.go