Bug 1471651 - Allow Non FQDN to be specified in policy. r=Felipe
authorMichael Kaply <mozilla@kaply.com>
Wed, 27 Jun 2018 12:11:49 -0500
changeset 479437 a9c85d545b473bd6f1439d7389f53b4e8c7c250c
parent 479436 988ea9310c365adf88f5076b509cd5ab6139ef50
child 479438 803ff4b978c45629e313b4277b575a12c86c75ea
push id9719
push userffxbld-merge
push dateFri, 24 Aug 2018 17:49:46 +0000
treeherdermozilla-beta@719ec98fba77 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersFelipe
bugs1471651
milestone63.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1471651 - Allow Non FQDN to be specified in policy. r=Felipe MozReview-Commit-ID: 4mVbOfTGIak
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
@@ -67,16 +67,24 @@ var Policies = {
         setAndLockPref("network.negotiate-auth.trusted-uris", param.SPNEGO.join(", "));
       }
       if ("Delegated" in param) {
         setAndLockPref("network.negotiate-auth.delegation-uris", param.Delegated.join(", "));
       }
       if ("NTLM" in param) {
         setAndLockPref("network.automatic-ntlm-auth.trusted-uris", param.NTLM.join(", "));
       }
+      if ("AllowNonFQDN" in param) {
+        if (param.AllowNonFQDN.NTLM) {
+          setAndLockPref("network.automatic-ntlm-auth.allow-non-fqdn", param.AllowNonFQDN.NTLM);
+        }
+        if (param.AllowNonFQDN.SPNEGO) {
+          setAndLockPref("network.negotiate-auth.allow-non-fqdn", param.AllowNonFQDN.SPNEGO);
+        }
+      }
     }
   },
 
   "BlockAboutAddons": {
     onBeforeUIStartup(manager, param) {
       if (param) {
         manager.disallowFeature("about:addons", true);
       }
--- a/browser/components/enterprisepolicies/schemas/policies-schema.json
+++ b/browser/components/enterprisepolicies/schemas/policies-schema.json
@@ -20,16 +20,28 @@
             "type": "string"
           }
         },
         "NTLM" : {
           "type": "array",
           "items": {
             "type": "string"
           }
+        },
+        "AllowNonFQDN": {
+          "type": "object",
+          "properties": {
+            "SPNEGO": {
+              "type": "boolean"
+            },
+
+            "NTLM": {
+              "type": "boolean"
+            }
+          }
         }
       }
     },
 
     "BlockAboutAddons": {
       "description": "Block access to the Add-ons Mananger (about:addons).",
 
       "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
@@ -93,22 +93,28 @@ const POLICIES_TESTS = [
 
   // POLICY: Authentication
   {
     policies: {
       "Authentication": {
         "SPNEGO": ["a.com", "b.com"],
         "Delegated": ["a.com", "b.com"],
         "NTLM": ["a.com", "b.com"],
+        "AllowNonFQDN": {
+          "SPNEGO": true,
+          "NTLM": true,
+        },
       }
     },
     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,
     }
   },
 
   // POLICY: Certificates
   {
     policies: {
       "Certificates": {
         "ImportEnterpriseRoots": true,