Commit 3397026f authored by dalyk's avatar dalyk Committed by Commit Bot

Add fields to DohProviderEntry specifying dropdown eligibility.

This cl adds the new fields display_globally and display_countries.

Bug: 1040145
Change-Id: Ice70d5c44537950420c9aeca822c652919d6298d
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2067561Reviewed-by: default avatarEric Orth <ericorth@chromium.org>
Commit-Queue: Katharine Daly <dalyk@google.com>
Cr-Commit-Position: refs/heads/master@{#744009}
parent ad9d38f0
...@@ -14,12 +14,20 @@ DohProviderEntry::DohProviderEntry(std::string provider, ...@@ -14,12 +14,20 @@ DohProviderEntry::DohProviderEntry(std::string provider,
std::set<std::string> dns_over_tls_hostnames, std::set<std::string> dns_over_tls_hostnames,
std::string dns_over_https_template, std::string dns_over_https_template,
std::string ui_name, std::string ui_name,
std::string privacy_policy) std::string privacy_policy,
bool display_globally,
std::set<std::string> display_countries)
: provider(std::move(provider)), : provider(std::move(provider)),
dns_over_tls_hostnames(std::move(dns_over_tls_hostnames)), dns_over_tls_hostnames(std::move(dns_over_tls_hostnames)),
dns_over_https_template(std::move(dns_over_https_template)), dns_over_https_template(std::move(dns_over_https_template)),
ui_name(std::move(ui_name)), ui_name(std::move(ui_name)),
privacy_policy(std::move(privacy_policy)) { privacy_policy(std::move(privacy_policy)),
display_globally(display_globally),
display_countries(std::move(display_countries)) {
DCHECK(!display_globally || display_countries.empty());
for (const auto& display_country : display_countries) {
DCHECK_EQ(2u, display_country.size());
}
for (const std::string& ip_str : ip_strs) { for (const std::string& ip_str : ip_strs) {
IPAddress ip_address; IPAddress ip_address;
bool success = ip_address.AssignFromIPLiteral(ip_str); bool success = ip_address.AssignFromIPLiteral(ip_str);
...@@ -42,7 +50,8 @@ const std::vector<DohProviderEntry>& GetDohProviderList() { ...@@ -42,7 +50,8 @@ const std::vector<DohProviderEntry>& GetDohProviderList() {
"2a0d:2a00:2::1"}, "2a0d:2a00:2::1"},
{"adult-filter-dns.cleanbrowsing.org"} /* dot_hostnames */, {"adult-filter-dns.cleanbrowsing.org"} /* dot_hostnames */,
"https://doh.cleanbrowsing.org/doh/adult-filter{?dns}", "https://doh.cleanbrowsing.org/doh/adult-filter{?dns}",
"" /* ui_name */, "" /* privacy_policy */), "" /* ui_name */, "" /* privacy_policy */,
false /* display_globally */, {} /* display_countries */),
DohProviderEntry( DohProviderEntry(
"CleanBrowsingFamily", "CleanBrowsingFamily",
{"185.228.168.168", "185.228.169.168", {"185.228.168.168", "185.228.169.168",
...@@ -50,14 +59,16 @@ const std::vector<DohProviderEntry>& GetDohProviderList() { ...@@ -50,14 +59,16 @@ const std::vector<DohProviderEntry>& GetDohProviderList() {
{"family-filter-dns.cleanbrowsing.org"} /* dot_hostnames */, {"family-filter-dns.cleanbrowsing.org"} /* dot_hostnames */,
"https://doh.cleanbrowsing.org/doh/family-filter{?dns}", "https://doh.cleanbrowsing.org/doh/family-filter{?dns}",
"CleanBrowsing family filter" /* ui_name */, "CleanBrowsing family filter" /* ui_name */,
"https://cleanbrowsing.org/privacy" /* privacy_policy */), "https://cleanbrowsing.org/privacy" /* privacy_policy */,
true /* display_globally */, {} /* display_countries */),
DohProviderEntry( DohProviderEntry(
"CleanBrowsingSecure", "CleanBrowsingSecure",
{"185.228.168.9", "185.228.169.9", "2a0d:2a00:1::2", {"185.228.168.9", "185.228.169.9", "2a0d:2a00:1::2",
"2a0d:2a00:2::2"}, "2a0d:2a00:2::2"},
{"security-filter-dns.cleanbrowsing.org"} /* dot_hostnames */, {"security-filter-dns.cleanbrowsing.org"} /* dot_hostnames */,
"https://doh.cleanbrowsing.org/doh/security-filter{?dns}", "https://doh.cleanbrowsing.org/doh/security-filter{?dns}",
"" /* ui_name */, "" /* privacy_policy */), "" /* ui_name */, "" /* privacy_policy */,
false /* display_globally */, {} /* display_countries */),
DohProviderEntry( DohProviderEntry(
"Cloudflare", "Cloudflare",
{"1.1.1.1", "1.0.0.1", "2606:4700:4700::1111", {"1.1.1.1", "1.0.0.1", "2606:4700:4700::1111",
...@@ -67,20 +78,23 @@ const std::vector<DohProviderEntry>& GetDohProviderList() { ...@@ -67,20 +78,23 @@ const std::vector<DohProviderEntry>& GetDohProviderList() {
"https://chrome.cloudflare-dns.com/dns-query", "https://chrome.cloudflare-dns.com/dns-query",
"Cloudflare" /* ui_name */, "Cloudflare" /* ui_name */,
"https://developers.cloudflare.com/1.1.1.1/commitment-to-privacy/" "https://developers.cloudflare.com/1.1.1.1/commitment-to-privacy/"
"privacy-policy/privacy-policy/" /* privacy_policy */), "privacy-policy/privacy-policy/" /* privacy_policy */,
true /* display_globally */, {} /* display_countries */),
DohProviderEntry("Comcast", DohProviderEntry("Comcast",
{"75.75.75.75", "75.75.76.76", "2001:558:feed::1", {"75.75.75.75", "75.75.76.76", "2001:558:feed::1",
"2001:558:feed::2"}, "2001:558:feed::2"},
{"dot.xfinity.com"} /* dns_over_tls_hostnames */, {"dot.xfinity.com"} /* dns_over_tls_hostnames */,
"https://doh.xfinity.com/dns-query{?dns}", "https://doh.xfinity.com/dns-query{?dns}",
"" /* ui_name */, "" /* privacy_policy */), "" /* ui_name */, "" /* privacy_policy */,
false /* display_globally */,
{} /* display_countries */),
DohProviderEntry( DohProviderEntry(
"Dnssb", {"185.222.222.222", "185.184.222.222", "2a09::", "2a09::1"}, "Dnssb", {"185.222.222.222", "185.184.222.222", "2a09::", "2a09::1"},
{"dns.sb"} /* dns_over_tls_hostnames */, {"dns.sb"} /* dns_over_tls_hostnames */,
{"https://doh.dns.sb/dns-query?no_ecs=true{&dns}", {"https://doh.dns.sb/dns-query?no_ecs=true{&dns}",
false /* use_post */}, false /* use_post */},
"DNS.SB" /* ui_name */, "DNS.SB" /* ui_name */, "https://dns.sb/privacy" /* privacy_policy */,
"https://dns.sb/privacy" /* privacy_policy */), false /* display_globally */, {"DE", "EE"} /* display_countries */),
DohProviderEntry("Google", DohProviderEntry("Google",
{"8.8.8.8", "8.8.4.4", "2001:4860:4860::8888", {"8.8.8.8", "8.8.4.4", "2001:4860:4860::8888",
"2001:4860:4860::8844"}, "2001:4860:4860::8844"},
...@@ -89,7 +103,8 @@ const std::vector<DohProviderEntry>& GetDohProviderList() { ...@@ -89,7 +103,8 @@ const std::vector<DohProviderEntry>& GetDohProviderList() {
"https://dns.google/dns-query{?dns}", "https://dns.google/dns-query{?dns}",
"Google" /* ui_name */, "Google" /* ui_name */,
"https://developers.google.com/speed/public-dns/" "https://developers.google.com/speed/public-dns/"
"privacy" /* privacy_policy */), "privacy" /* privacy_policy */,
true /* display_globally */, {} /* display_countries */),
DohProviderEntry("OpenDNS", DohProviderEntry("OpenDNS",
{"208.67.222.222", "208.67.220.220", "2620:119:35::35", {"208.67.222.222", "208.67.220.220", "2620:119:35::35",
"2620:119:53::53"}, "2620:119:53::53"},
...@@ -97,32 +112,38 @@ const std::vector<DohProviderEntry>& GetDohProviderList() { ...@@ -97,32 +112,38 @@ const std::vector<DohProviderEntry>& GetDohProviderList() {
"https://doh.opendns.com/dns-query{?dns}", "https://doh.opendns.com/dns-query{?dns}",
"OpenDNS" /* ui_name */, "OpenDNS" /* ui_name */,
"https://www.cisco.com/c/en/us/about/legal/" "https://www.cisco.com/c/en/us/about/legal/"
"privacy-full.html" /* privacy_policy */), "privacy-full.html" /* privacy_policy */,
true /* display_globally */, {} /* display_countries */),
DohProviderEntry("OpenDNSFamily", DohProviderEntry("OpenDNSFamily",
{"208.67.222.123", "208.67.220.123", "2620:119:35::123", {"208.67.222.123", "208.67.220.123", "2620:119:35::123",
"2620:119:53::123"}, "2620:119:53::123"},
{""} /* dns_over_tls_hostnames */, {""} /* dns_over_tls_hostnames */,
"https://doh.familyshield.opendns.com/" "https://doh.familyshield.opendns.com/"
"dns-query{?dns}", "dns-query{?dns}",
"" /* ui_name */, "" /* privacy_policy */), "" /* ui_name */, "" /* privacy_policy */,
false /* display_globally */,
{} /* display_countries */),
DohProviderEntry( DohProviderEntry(
"Quad9Cdn", "Quad9Cdn",
{"9.9.9.11", "149.112.112.11", "2620:fe::11", "2620:fe::fe:11"}, {"9.9.9.11", "149.112.112.11", "2620:fe::11", "2620:fe::fe:11"},
{"dns11.quad9.net"} /* dns_over_tls_hostnames */, {"dns11.quad9.net"} /* dns_over_tls_hostnames */,
"https://dns11.quad9.net/dns-query", "" /* ui_name */, "https://dns11.quad9.net/dns-query", "" /* ui_name */,
"" /* privacy_policy */), "" /* privacy_policy */, false /* display_globally */,
{} /* display_countries */),
DohProviderEntry( DohProviderEntry(
"Quad9Insecure", "Quad9Insecure",
{"9.9.9.10", "149.112.112.10", "2620:fe::10", "2620:fe::fe:10"}, {"9.9.9.10", "149.112.112.10", "2620:fe::10", "2620:fe::fe:10"},
{"dns10.quad9.net"} /* dns_over_tls_hostnames */, {"dns10.quad9.net"} /* dns_over_tls_hostnames */,
"https://dns10.quad9.net/dns-query", "" /* ui_name */, "https://dns10.quad9.net/dns-query", "" /* ui_name */,
"" /* privacy_policy */), "" /* privacy_policy */, false /* display_globally */,
{} /* display_countries */),
DohProviderEntry( DohProviderEntry(
"Quad9Secure", "Quad9Secure",
{"9.9.9.9", "149.112.112.112", "2620:fe::fe", "2620:fe::9"}, {"9.9.9.9", "149.112.112.112", "2620:fe::fe", "2620:fe::9"},
{"dns.quad9.net", "dns9.quad9.net"} /* dns_over_tls_hostnames */, {"dns.quad9.net", "dns9.quad9.net"} /* dns_over_tls_hostnames */,
"https://dns.quad9.net/dns-query", "Quad9" /* ui_name */, "https://dns.quad9.net/dns-query", "Quad9" /* ui_name */,
"https://www.quad9.net/home/privacy/" /* privacy_policy */), "https://www.quad9.net/home/privacy/" /* privacy_policy */,
true /* display_globally */, {} /* display_countries */),
}}; }};
return *providers; return *providers;
} }
......
...@@ -20,14 +20,20 @@ namespace net { ...@@ -20,14 +20,20 @@ namespace net {
// menu for secure mode. To be eligible for auto-upgrade, entries must have a // menu for secure mode. To be eligible for auto-upgrade, entries must have a
// non-empty |ip_strs| or non-empty |dns_over_tls_hostnames|. To be eligible for // non-empty |ip_strs| or non-empty |dns_over_tls_hostnames|. To be eligible for
// the dropdown menu, entries must have non-empty |ui_name| and // the dropdown menu, entries must have non-empty |ui_name| and
// |privacy_policy|. // |privacy_policy|. If |display_globally| is true, the entry is eligible for
// being displayed globally in the dropdown menu. If |display_globally| is
// false, |display_countries| should contain the two-letter ISO 3166-1 country
// codes, if any, where the entry is eligible for being displayed in the
// dropdown menu.
struct NET_EXPORT DohProviderEntry { struct NET_EXPORT DohProviderEntry {
DohProviderEntry(std::string provider, DohProviderEntry(std::string provider,
std::set<std::string> ip_strs, std::set<std::string> ip_strs,
std::set<std::string> dns_over_tls_hostnames, std::set<std::string> dns_over_tls_hostnames,
std::string dns_over_https_template, std::string dns_over_https_template,
std::string ui_name, std::string ui_name,
std::string privacy_policy); std::string privacy_policy,
bool display_globally,
std::set<std::string> display_countries);
DohProviderEntry(const DohProviderEntry& other); DohProviderEntry(const DohProviderEntry& other);
~DohProviderEntry(); ~DohProviderEntry();
...@@ -37,6 +43,8 @@ struct NET_EXPORT DohProviderEntry { ...@@ -37,6 +43,8 @@ struct NET_EXPORT DohProviderEntry {
const std::string dns_over_https_template; const std::string dns_over_https_template;
const std::string ui_name; const std::string ui_name;
const std::string privacy_policy; const std::string privacy_policy;
bool display_globally;
std::set<std::string> display_countries;
}; };
// Returns the full list of DoH providers. A subset of this list may be used // Returns the full list of DoH providers. A subset of this list may be used
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment