Bug 1577149 - Additional preferences managed by policy requested by users. r=mconley, a=lizzard
authorMichael Kaply <mozilla@kaply.com>
Thu, 10 Oct 2019 08:13:39 -0500
changeset 552363 5d88242a100d287b7559b420ea0fe5952c7be425
parent 552362 2697830a6ab4c65617539ee8ef78154ada3a2194
child 552364 27a820b8753a1320bb724b7fd164fe487a3f1729
push id12155
push userjcristau@mozilla.com
push dateThu, 10 Oct 2019 14:13:03 +0000
treeherdermozilla-beta@2ce58a99cbfd [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmconley, lizzard
bugs1577149
milestone70.0
Bug 1577149 - Additional preferences managed by policy requested by users. r=mconley, a=lizzard
browser/components/enterprisepolicies/Policies.jsm
browser/components/enterprisepolicies/schemas/policies-schema.json
browser/components/enterprisepolicies/tests/xpcshell/test_simple_pref_policies.js
--- a/browser/components/enterprisepolicies/Policies.jsm
+++ b/browser/components/enterprisepolicies/Policies.jsm
@@ -99,29 +99,43 @@ var Policies = {
       }
       if ("NTLM" in param) {
         setAndLockPref(
           "network.automatic-ntlm-auth.trusted-uris",
           param.NTLM.join(", ")
         );
       }
       if ("AllowNonFQDN" in param) {
-        if (param.AllowNonFQDN.NTLM) {
+        if ("NTLM" in param.AllowNonFQDN) {
           setAndLockPref(
             "network.automatic-ntlm-auth.allow-non-fqdn",
             param.AllowNonFQDN.NTLM
           );
         }
-        if (param.AllowNonFQDN.SPNEGO) {
+        if ("SPNEGO" in param.AllowNonFQDN) {
           setAndLockPref(
             "network.negotiate-auth.allow-non-fqdn",
             param.AllowNonFQDN.SPNEGO
           );
         }
       }
+      if ("AllowProxies" in param) {
+        if ("NTLM" in param.AllowProxies) {
+          setAndLockPref(
+            "network.automatic-ntlm-auth.allow-proxies",
+            param.AllowProxies.NTLM
+          );
+        }
+        if ("SPNEGO" in param.AllowProxies) {
+          setAndLockPref(
+            "network.negotiate-auth.allow-proxies",
+            param.AllowProxies.SPNEGO
+          );
+        }
+      }
     },
   },
 
   BlockAboutAddons: {
     onBeforeUIStartup(manager, param) {
       if (param) {
         blockAboutPage(manager, "about:addons", true);
       }
--- a/browser/components/enterprisepolicies/schemas/policies-schema.json
+++ b/browser/components/enterprisepolicies/schemas/policies-schema.json
@@ -48,16 +48,28 @@
             "SPNEGO": {
               "type": "boolean"
             },
 
             "NTLM": {
               "type": "boolean"
             }
           }
+        },
+        "AllowProxies": {
+          "type": "object",
+          "properties": {
+            "SPNEGO": {
+              "type": "boolean"
+            },
+
+            "NTLM": {
+              "type": "boolean"
+            }
+          }
         }
       }
     },
 
     "BlockAboutAddons": {
       "type": "boolean"
     },
 
@@ -265,16 +277,28 @@
       "type": "object",
       "properties": {
         "Enabled": {
           "type": "boolean"
         },
         "ProviderURL": {
           "type": "URLorEmpty"
         },
+        "AllowProxies": {
+          "type": "object",
+          "properties": {
+            "SPNEGO": {
+              "type": "boolean"
+            },
+
+            "NTLM": {
+              "type": "boolean"
+            }
+          }
+        },
         "Locked": {
           "type": "boolean"
         }
       }
     },
 
     "DontCheckDefaultBrowser": {
       "type": "boolean"
@@ -657,44 +681,75 @@
           "type": "boolean"
         }
       }
     },
 
     "Preferences": {
       "type": "object",
       "properties": {
+        "accessibility.force_disabled": {
+          "type": "number",
+          "enum": [-1, 0, 1]
+        },
         "app.update.auto": {
           "type": "boolean"
         },
+        "browser.bookmarks.autoExportHTML": {
+          "type": "boolean"
+        },
+        "browser.bookmarks.file": {
+          "type": "string"
+        },
+        "browser.places.importBookmarksHTML": {
+          "type": "boolean"
+        },
+        "browser.bookmarks.restore_default_bookmarks": {
+          "type": "boolean"
+        },
         "browser.cache.disk.enable": {
           "type": "boolean"
         },
         "browser.fixup.dns_first_for_single_words": {
           "type": "boolean"
         },
+        "browser.safebrowsing.phishing.enabled": {
+          "type": "boolean"
+        },
+        "browser.safebrowsing.malware.enabled": {
+          "type": "boolean"
+        },
         "browser.search.update": {
           "type": "boolean"
         },
         "browser.tabs.warnOnClose": {
           "type": "boolean"
         },
         "browser.cache.disk.parent_directory": {
           "type": "string"
         },
+        "browser.slowStartup.notificationDisabled": {
+          "type": "boolean"
+        },
+        "browser.taskbar.previews.enable": {
+          "type": "boolean"
+        },
+        "browser.urlbar.suggest.bookmark": {
+          "type": "boolean"
+        },
         "browser.urlbar.suggest.openpage": {
           "type": "boolean"
         },
         "browser.urlbar.suggest.history": {
           "type": "boolean"
         },
         "datareporting.policy.dataSubmissionPolicyBypassNotification": {
           "type": "boolean"
         },
-        "browser.urlbar.suggest.bookmark": {
+        "dom.allow_scripts_to_close_windows": {
           "type": "boolean"
         },
         "dom.disable_window_flip": {
           "type": "boolean"
         },
         "dom.disable_window_move_resize": {
           "type": "boolean"
         },
@@ -702,43 +757,61 @@
           "type": "boolean"
         },
         "dom.keyboardevent.keypress.hack.dispatch_non_printable_keys.addl": {
           "type": "string"
         },
         "dom.keyboardevent.keypress.hack.use_legacy_keycode_and_charcode.addl": {
           "type": "string"
         },
+        "extensions.blocklist.enabled": {
+          "type": "boolean"
+        },
         "extensions.getAddons.showPane": {
           "type": "boolean"
         },
+        "geo.enabled": {
+          "type": "boolean"
+        },
+        "intl.accept_languages": {
+          "type": "string"
+        },
+        "media.eme.enabled": {
+          "type": "boolean"
+        },
         "media.gmp-gmpopenh264.enabled": {
           "type": "boolean"
         },
         "media.gmp-widevinecdm.enabled": {
           "type": "boolean"
         },
         "network.dns.disableIPv6": {
           "type": "boolean"
         },
         "network.IDN_show_punycode": {
           "type": "boolean"
         },
         "places.history.enabled": {
           "type": "boolean"
         },
+        "print.save_print_settings": {
+          "type": "boolean"
+        },
         "privacy.file_unique_origin": {
           "type": "boolean"
         },
         "security.default_personal_cert": {
           "type": "string"
         },
         "security.ssl.errorReporting.enabled": {
           "type": "boolean"
         },
+        "security.mixed_content.block_active_content": {
+          "type": "boolean"
+        },
         "ui.key.menuAccessKeyFocuses": {
           "type": "boolean"
         }
       }
     },
 
     "PromptForDownloadLocation": {
       "type": "boolean"
--- a/browser/components/enterprisepolicies/tests/xpcshell/test_simple_pref_policies.js
+++ b/browser/components/enterprisepolicies/tests/xpcshell/test_simple_pref_policies.js
@@ -116,24 +116,30 @@ const POLICIES_TESTS = [
       Authentication: {
         SPNEGO: ["a.com", "b.com"],
         Delegated: ["a.com", "b.com"],
         NTLM: ["a.com", "b.com"],
         AllowNonFQDN: {
           SPNEGO: true,
           NTLM: true,
         },
+        AllowProxies: {
+          SPNEGO: false,
+          NTLM: false,
+        },
       },
     },
     lockedPrefs: {
       "network.negotiate-auth.trusted-uris": "a.com, b.com",
       "network.negotiate-auth.delegation-uris": "a.com, b.com",
       "network.automatic-ntlm-auth.trusted-uris": "a.com, b.com",
       "network.automatic-ntlm-auth.allow-non-fqdn": true,
       "network.negotiate-auth.allow-non-fqdn": true,
+      "network.automatic-ntlm-auth.allow-proxies": false,
+      "network.negotiate-auth.allow-proxies": false,
     },
   },
 
   // POLICY: Certificates (true)
   {
     policies: {
       Certificates: {
         ImportEnterpriseRoots: true,