Bug 1510470 - Disable OS re-auth for credit cards by default. r=timdream

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

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Matthew Noorenberghe 2018-11-28 01:08:35 +00:00
Родитель c241567f0f
Коммит f34b971aa6
6 изменённых файлов: 15 добавлений и 1 удалений

Просмотреть файл

@ -1707,6 +1707,8 @@ pref("extensions.formautofill.creditCards.enabled", true);
pref("extensions.formautofill.creditCards.used", 0);
pref("extensions.formautofill.firstTimeUse", true);
pref("extensions.formautofill.heuristics.enabled", true);
// Whether the user enabled the OS re-auth dialog.
pref("extensions.formautofill.reauth.enabled", false);
pref("extensions.formautofill.section.enabled", true);
pref("extensions.formautofill.loglevel", "Warn");

Просмотреть файл

@ -4,6 +4,7 @@ prefs =
browser.pagethumbnails.capturing_disabled=true
dom.payments.request.enabled=true
extensions.formautofill.creditCards.available=true
extensions.formautofill.reauth.enabled=true
skip-if = !e10s # Bug 1365964 - Payment Request isn't implemented for non-e10s
support-files =
blank_page.html

Просмотреть файл

@ -109,7 +109,7 @@ var OSKeyStore = {
let unlockPromise;
// Decides who should handle reauth
if (typeof reauth == "boolean" && !reauth) {
if (!this._reauthEnabledByUser || (typeof reauth == "boolean" && !reauth)) {
unlockPromise = Promise.resolve();
} else if (!AppConstants.MOZILLA_OFFICIAL && this._testReauth) {
unlockPromise = this._reauthInTests();
@ -252,3 +252,5 @@ XPCOMUtils.defineLazyGetter(this, "log", () => {
});
XPCOMUtils.defineLazyPreferenceGetter(OSKeyStore, "_testReauth", TEST_ONLY_REAUTH, "");
XPCOMUtils.defineLazyPreferenceGetter(OSKeyStore, "_reauthEnabledByUser",
"extensions.formautofill.reauth.enabled", false);

Просмотреть файл

@ -2,6 +2,7 @@
head = head.js
prefs =
extensions.formautofill.creditCards.available=true
extensions.formautofill.reauth.enabled=true
support-files =
../fixtures/autocomplete_basic.html
../fixtures/autocomplete_simple_basic.html

Просмотреть файл

@ -1,6 +1,7 @@
[DEFAULT]
prefs =
extensions.formautofill.creditCards.available=true
extensions.formautofill.reauth.enabled=true
support-files =
../../../../../toolkit/components/satchel/test/satchel_common.js
../../../../../toolkit/components/satchel/test/parent_utils.js

Просмотреть файл

@ -6,6 +6,8 @@
let OSKeyStore;
add_task(async function setup() {
Services.prefs.setBoolPref("extensions.formautofill.reauth.enabled", true);
({OSKeyStore} = ChromeUtils.import("resource://formautofill/OSKeyStore.jsm", {}));
});
@ -59,6 +61,11 @@ add_task(async function test_reauth() {
await new Promise(resolve => TestUtils.executeSoon(resolve));
Assert.equal(await OSKeyStore.ensureLoggedIn(true), true, "Reauth logged in.");
await reauthObserved;
Services.prefs.setBoolPref("extensions.formautofill.reauth.enabled", false);
Assert.equal(await OSKeyStore.ensureLoggedIn(true), true,
"Reauth disabled so logged in without prompt");
Services.prefs.setBoolPref("extensions.formautofill.reauth.enabled", true);
});
add_task(async function test_decryption_failure() {