Bug 1523810 - Add a policy for disabling captive portal support. r=Felipe,flod, a=lizzard
authorMichael Kaply <mozilla@kaply.com>
Wed, 30 Jan 2019 23:04:59 +0000
changeset 451147 7adee0d5b798062a4105927eb08f69b46748fb0c
parent 451146 2461c3f80f8d301faf0719149be63caf8bab5ae7
child 451148 3fcb4a70f5914c7d83cc1c4e6117e004c90315de
push id400
push userryanvm@gmail.com
push dateMon, 29 Apr 2019 13:42:04 +0000
treeherdermozilla-esr60@d44b551abaf9 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersFelipe, flod, lizzard
bugs1523810
milestone60.6.2
Bug 1523810 - Add a policy for disabling captive portal support. r=Felipe,flod, a=lizzard Differential Revision: https://phabricator.services.mozilla.com/D18007
browser/components/enterprisepolicies/Policies.jsm
browser/components/enterprisepolicies/schemas/policies-schema.json
browser/components/enterprisepolicies/tests/browser/browser_policies_simple_pref_policies.js
--- a/browser/components/enterprisepolicies/Policies.jsm
+++ b/browser/components/enterprisepolicies/Policies.jsm
@@ -128,16 +128,22 @@ var Policies = {
   },
 
   "Bookmarks": {
     onAllWindowsRestored(manager, param) {
       BookmarksPolicies.processBookmarks(param);
     }
   },
 
+  "CaptivePortal": {
+    onBeforeAddons(manager, param) {
+      setAndLockPref("network.captive-portal-service.enabled", param);
+    },
+  },
+
   "Certificates": {
     onBeforeAddons(manager, param) {
       if ("ImportEnterpriseRoots" in param) {
         setAndLockPref("security.enterprise_roots.enabled", true);
       }
       if ("Install" in param) {
         (async () => {
           let dirs = [];
--- a/browser/components/enterprisepolicies/schemas/policies-schema.json
+++ b/browser/components/enterprisepolicies/schemas/policies-schema.json
@@ -104,16 +104,20 @@
           "Folder": {
             "type": "string"
           }
         },
         "required": ["Title", "URL"]
       }
     },
 
+    "CaptivePortal": {
+      "type": "boolean"
+    },
+
     "Certificates": {
       "description": "Whether or not to use built in certs. This policy is Windows only at this time.",
       "first_available": "60.0",
 
       "type": "object",
       "properties": {
         "ImportEnterpriseRoots": {
           "type": "boolean"
--- a/browser/components/enterprisepolicies/tests/browser/browser_policies_simple_pref_policies.js
+++ b/browser/components/enterprisepolicies/tests/browser/browser_policies_simple_pref_policies.js
@@ -174,16 +174,26 @@ const POLICIES_TESTS = [
       "SSLVersionMax": "tls1.3",
     },
     lockedPrefs: {
       "security.tls.version.min": 3,
       "security.tls.version.max": 4,
     },
   },
 
+  // POLICY: CaptivePortal
+  {
+    policies: {
+      "CaptivePortal": false,
+    },
+    lockedPrefs: {
+      "network.captive-portal-service.enabled": false,
+    },
+  },
+
   // POLICY: NetworkPrediction
   {
     policies: {
       "NetworkPrediction": false,
     },
     lockedPrefs: {
       "network.dns.disablePrefetch": true,
       "network.dns.disablePrefetchFromHTTPS": true,