Bug 1653584 - Rename MasterPassword policy to PrimaryPassword. r=Gijs
authorMichael Kaply <mozilla@kaply.com>
Fri, 17 Jul 2020 15:59:46 +0000
changeset 540941 34515f6320888fa910afe61a1882d8a0a215b483
parent 540940 2afec1dfd8fc6bf65f32d4efeffd7596254c03b5
child 540942 f5d8cb66e31b06054dde34d5c3d58898d2cdcad7
push id122001
push usermozilla@kaply.com
push dateFri, 17 Jul 2020 16:06:09 +0000
treeherderautoland@34515f632088 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersGijs
bugs1653584
milestone80.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 1653584 - Rename MasterPassword policy to PrimaryPassword. r=Gijs Differential Revision: https://phabricator.services.mozilla.com/D83957
browser/components/enterprisepolicies/Policies.jsm
browser/components/enterprisepolicies/content/aboutPolicies.js
browser/components/enterprisepolicies/schemas/policies-schema.json
browser/components/enterprisepolicies/tests/browser/browser_policy_masterpassword.js
browser/components/enterprisepolicies/tests/browser/browser_policy_masterpassword_aboutlogins.js
browser/components/enterprisepolicies/tests/browser/browser_policy_masterpassword_doorhanger.js
--- a/browser/components/enterprisepolicies/Policies.jsm
+++ b/browser/components/enterprisepolicies/Policies.jsm
@@ -1243,26 +1243,16 @@ var Policies = {
       );
       setAndLockPref(
         "capability.policy.localfilelinks_policy.sites",
         param.join(" ")
       );
     },
   },
 
-  MasterPassword: {
-    onAllWindowsRestored(manager, param) {
-      if (param) {
-        manager.disallowFeature("removeMasterPassword");
-      } else {
-        manager.disallowFeature("createMasterPassword");
-      }
-    },
-  },
-
   NetworkPrediction: {
     onBeforeAddons(manager, param) {
       setAndLockPref("network.dns.disablePrefetch", !param);
       setAndLockPref("network.dns.disablePrefetchFromHTTPS", !param);
     },
   },
 
   NewTabPage: {
@@ -1434,16 +1424,26 @@ var Policies = {
   Preferences: {
     onBeforeAddons(manager, param) {
       for (let preference in param) {
         setAndLockPref(preference, param[preference]);
       }
     },
   },
 
+  PrimaryPassword: {
+    onAllWindowsRestored(manager, param) {
+      if (param) {
+        manager.disallowFeature("removeMasterPassword");
+      } else {
+        manager.disallowFeature("createMasterPassword");
+      }
+    },
+  },
+
   PromptForDownloadLocation: {
     onBeforeAddons(manager, param) {
       setAndLockPref("browser.download.useDownloadDir", !param);
     },
   },
 
   Proxy: {
     onBeforeAddons(manager, param) {
--- a/browser/components/enterprisepolicies/content/aboutPolicies.js
+++ b/browser/components/enterprisepolicies/content/aboutPolicies.js
@@ -285,16 +285,17 @@ function generateDocumentation() {
 
   // map specific policies to a different string ID, to allow updates to
   // existing descriptions
   let string_mapping = {
     DisableSetDesktopBackground: "DisableSetAsDesktopBackground",
     Certificates: "CertificatesDescription",
     SanitizeOnShutdown: "SanitizeOnShutdown2",
     Permissions: "Permissions2",
+    PrimaryPassword: "MasterPassword",
   };
 
   for (let policyName in schema.properties) {
     let main_tbody = document.createElement("tbody");
     main_tbody.classList.add("collapsible");
     main_tbody.addEventListener("click", function() {
       let content = this.nextElementSibling;
       content.classList.toggle("content");
--- a/browser/components/enterprisepolicies/schemas/policies-schema.json
+++ b/browser/components/enterprisepolicies/schemas/policies-schema.json
@@ -640,20 +640,16 @@
 
     "LocalFileLinks": {
       "type": "array",
       "items": {
         "type": "string"
       }
     },
 
-    "MasterPassword": {
-      "type": "boolean"
-    },
-
     "NetworkPrediction": {
       "type": "boolean"
     },
 
     "NewTabPage": {
       "type": "boolean"
     },
 
@@ -1024,16 +1020,20 @@
           "type": "boolean"
         },
         "widget.content.gtk-theme-override": {
           "type": "string"
         }
       }
     },
 
+    "PrimaryPassword": {
+      "type": "boolean"
+    },
+
     "PromptForDownloadLocation": {
       "type": "boolean"
     },
 
     "Proxy": {
       "type": "object",
       "properties": {
         "Mode": {
--- a/browser/components/enterprisepolicies/tests/browser/browser_policy_masterpassword.js
+++ b/browser/components/enterprisepolicies/tests/browser/browser_policy_masterpassword.js
@@ -6,17 +6,17 @@
 let { LoginTestUtils } = ChromeUtils.import(
   "resource://testing-common/LoginTestUtils.jsm"
 );
 
 // Test that once a password is set, you can't unset it
 add_task(async function test_policy_masterpassword_set() {
   await setupPolicyEngineWithJson({
     policies: {
-      MasterPassword: true,
+      PrimaryPassword: true,
     },
   });
 
   LoginTestUtils.masterPassword.enable();
 
   await BrowserTestUtils.withNewTab(
     "about:preferences#privacy",
     async browser => {
@@ -30,17 +30,17 @@ add_task(async function test_policy_mast
 
   LoginTestUtils.masterPassword.disable();
 });
 
 // Test that password can't be removed in changemp.xhtml
 add_task(async function test_policy_nochangemp() {
   await setupPolicyEngineWithJson({
     policies: {
-      MasterPassword: true,
+      PrimaryPassword: true,
     },
   });
 
   LoginTestUtils.masterPassword.enable();
 
   let changeMPWindow = window.openDialog(
     "chrome://mozapps/content/preferences/changemp.xhtml",
     "",
@@ -68,17 +68,17 @@ add_task(async function test_policy_noch
 
   LoginTestUtils.masterPassword.disable();
 });
 
 // Test that admin message shows
 add_task(async function test_policy_admin() {
   await setupPolicyEngineWithJson({
     policies: {
-      MasterPassword: true,
+      PrimaryPassword: true,
     },
   });
 
   let changeMPWindow = window.openDialog(
     "chrome://mozapps/content/preferences/changemp.xhtml",
     "",
     ""
   );
--- a/browser/components/enterprisepolicies/tests/browser/browser_policy_masterpassword_aboutlogins.js
+++ b/browser/components/enterprisepolicies/tests/browser/browser_policy_masterpassword_aboutlogins.js
@@ -12,17 +12,17 @@ ChromeUtils.defineModuleGetter(
   "TestUtils",
   "resource://testing-common/TestUtils.jsm"
 );
 
 // Test that create in about:logins asks for master password
 add_task(async function test_policy_admin() {
   await setupPolicyEngineWithJson({
     policies: {
-      MasterPassword: true,
+      PrimaryPassword: true,
     },
   });
 
   let aboutLoginsTab = await BrowserTestUtils.openNewForegroundTab({
     gBrowser,
     url: "about:logins",
   });
 
--- a/browser/components/enterprisepolicies/tests/browser/browser_policy_masterpassword_doorhanger.js
+++ b/browser/components/enterprisepolicies/tests/browser/browser_policy_masterpassword_doorhanger.js
@@ -8,17 +8,17 @@
 Services.scriptloader.loadSubScript(
   "chrome://mochitests/content/browser/toolkit/components/passwordmgr/test/browser/head.js",
   this
 );
 
 add_task(async function test_policy_masterpassword_doorhanger() {
   await setupPolicyEngineWithJson({
     policies: {
-      MasterPassword: true,
+      PrimaryPassword: true,
     },
   });
 
   let username = "username";
   let password = "password";
 
   await BrowserTestUtils.withNewTab(
     {