author | Mark Hammond <mhammond@skippinet.com.au> |
Wed, 10 Dec 2014 13:02:25 +1100 | |
changeset 218981 | 9acf9c028045d10821a74e268959c821f3afd95f |
parent 218980 | d90fa41d351ce1a020d61ccbb9aaece5fc44eccd |
child 218982 | a7221c06e193aa90d8164851e29cc85e8f6f0d78 |
push id | 27950 |
push user | cbook@mozilla.com |
push date | Wed, 10 Dec 2014 10:58:50 +0000 |
treeherder | autoland@5b01216f97f8 [default view] [failures only] |
perfherder | [talos] [build metrics] [platform microbench] (compared to previous push) |
reviewers | rnewman |
bugs | 1100232 |
milestone | 37.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
|
--- a/services/sync/modules/browserid_identity.js +++ b/services/sync/modules/browserid_identity.js @@ -395,16 +395,23 @@ this.BrowserIDManager.prototype = { resetSyncKey: function() { this._syncKey = null; this._syncKeyBundle = null; this._syncKeyUpdated = true; this._shouldHaveSyncKeyBundle = false; }, /** + * Return credentials hosts for this identity only. + */ + _getSyncCredentialsHosts: function() { + return Utils.getSyncCredentialsHostsFxA(); + }, + + /** * The current state of the auth credentials. * * This essentially validates that enough credentials are available to use * Sync, although it effectively ignores the state of the master-password - * if that's locked and that's the only problem we can see, say everything * is OK - unlockAndVerifyAuthState will be used to perform the unlock * and re-verification if necessary. */
--- a/services/sync/modules/identity.js +++ b/services/sync/modules/identity.js @@ -480,20 +480,27 @@ IdentityManager.prototype = { let loginInfo = new Components.Constructor( "@mozilla.org/login-manager/loginInfo;1", Ci.nsILoginInfo, "init"); let login = new loginInfo(PWDMGR_HOST, null, realm, username, password, "", ""); Services.logins.addLogin(login); }, /** + * Return credentials hosts for this identity only. + */ + _getSyncCredentialsHosts: function() { + return Utils.getSyncCredentialsHostsLegacy(); + }, + + /** * Deletes Sync credentials from the password manager. */ deleteSyncCredentials: function deleteSyncCredentials() { - for (let host of Utils.getSyncCredentialsHosts()) { + for (let host of this._getSyncCredentialsHosts()) { let logins = Services.logins.findLogins({}, host, "", ""); for each (let login in logins) { Services.logins.removeLogin(login); } } // Wait until after store is updated in case it fails. this._basicPassword = null;
--- a/services/sync/modules/util.js +++ b/services/sync/modules/util.js @@ -591,23 +591,40 @@ this.Utils = { /** * Return a set of hostnames (including the protocol) which may have * credentials for sync itself stored in the login manager. * * In general, these hosts will not have their passwords synced, will be * reset when we drop sync credentials, etc. */ getSyncCredentialsHosts: function() { + let result = new Set(this.getSyncCredentialsHostsLegacy()); + for (let host of this.getSyncCredentialsHostsFxA()) { + result.add(host); + } + return result; + }, + + /* + * Get the "legacy" identity hosts. + */ + getSyncCredentialsHostsLegacy: function() { + // the legacy sync host + return new Set([PWDMGR_HOST]); + }, + + /* + * Get the FxA identity hosts. + */ + getSyncCredentialsHostsFxA: function() { // This is somewhat expensive and the result static, so we cache the result. - if (this._syncCredentialsHosts) { - return this._syncCredentialsHosts; + if (this._syncCredentialsHostsFxA) { + return this._syncCredentialsHostsFxA; } let result = new Set(); - // the legacy sync host - result.add(PWDMGR_HOST); // the FxA host result.add(FxAccountsCommon.FXA_PWDMGR_HOST); // // The FxA hosts - these almost certainly all have the same hostname, but // better safe than sorry... for (let prefName of ["identity.fxaccounts.remote.force_auth.uri", "identity.fxaccounts.remote.signup.uri", "identity.fxaccounts.remote.signin.uri", @@ -616,17 +633,17 @@ this.Utils = { try { prefVal = Services.prefs.getCharPref(prefName); } catch (_) { continue; } let uri = Services.io.newURI(prefVal, null, null); result.add(uri.prePath); } - return this._syncCredentialsHosts = result; + return this._syncCredentialsHostsFxA = result; }, }; XPCOMUtils.defineLazyGetter(Utils, "_utf8Converter", function() { let converter = Cc["@mozilla.org/intl/scriptableunicodeconverter"] .createInstance(Ci.nsIScriptableUnicodeConverter); converter.charset = "UTF-8"; return converter;