Bug 1484843 - Add policy for disabling DNS over HTTPS r=flod,Felipe,jkt

Differential Revision: https://phabricator.services.mozilla.com/D7743

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Michael Kaply 2018-10-09 19:06:57 +00:00
parent 24dfa1120c
commit c0604754c9
4 changed files with 66 additions and 0 deletions

View File

@ -198,6 +198,26 @@ var Policies = {
},
},
"DNSOverHTTPS": {
onBeforeAddons(manager, param) {
if ("Enabled" in param) {
let mode = param.Enabled ? 2 : 5;
if (param.Locked) {
setAndLockPref("network.trr.mode", mode);
} else {
setDefaultPref("network.trr.mode", mode);
}
}
if (param.ProviderURL) {
if (param.Locked) {
setAndLockPref("network.trr.uri", param.ProviderURL.href);
} else {
setDefaultPref("network.trr.uri", param.ProviderURL.href);
}
}
},
},
"DisableAppUpdate": {
onBeforeAddons(manager, param) {
if (param) {

View File

@ -141,6 +141,21 @@
}
},
"DNSOverHTTPS": {
"type": "object",
"properties": {
"Enabled": {
"type": "boolean"
},
"ProviderURL": {
"type": "URLorEmpty"
},
"Locked": {
"type": "boolean"
}
}
},
"DisableAppUpdate": {
"machine_only": true,

View File

@ -154,6 +154,35 @@ const POLICIES_TESTS = [
"privacy.clearOnShutdown.offlineApps": true,
},
},
// POLICY: DNSOverHTTPS Locked
{
policies: {
"DNSOverHTTPS": {
"Enabled": true,
"ProviderURL": "http://example.com/provider",
"Locked": true,
},
},
lockedPrefs: {
"network.trr.mode": 2,
"network.trr.uri": "http://example.com/provider",
},
},
// POLICY: DNSOverHTTPS Unlocked
{
policies: {
"DNSOverHTTPS": {
"Enabled": false,
"ProviderURL": "http://example.com/provider",
},
},
unlockedPrefs: {
"network.trr.mode": 5,
"network.trr.uri": "http://example.com/provider",
},
},
];
add_task(async function test_policy_remember_passwords() {

View File

@ -70,6 +70,8 @@ policy-DisplayBookmarksToolbar = Display the Bookmarks Toolbar by default.
policy-DisplayMenuBar = Display the Menu Bar by default.
policy-DNSOverHTTPS = Configure DNS over HTTPS.
policy-DontCheckDefaultBrowser = Disable check for default browser on startup.
# “lock” means that the user wont be able to change this setting