This commit is contained in:
jonathandicarlo@jonathan-dicarlos-macbook-pro.local 2008-06-26 17:01:12 -07:00
commit 448ef4478e
27 changed files with 952 additions and 238 deletions

View File

@ -50,6 +50,12 @@
#include "keyhi.h"
#include "nss.h"
/*
* In a number of places we use stack buffers to hold smallish temporary data.
* 4K is plenty big for the exptected uses, and avoids poking holes in the
* heap for small allocations. (Yes, we still check for overflow.)
*/
#define STACK_BUFFER_SIZE 4096
NS_IMPL_ISUPPORTS1(WeaveCrypto, IWeaveCrypto)
@ -273,9 +279,9 @@ WeaveCrypto::CommonCrypt(const char *input, PRUint32 inputSize,
SECItem *ivParam = nsnull;
PRUint32 maxOutputSize;
char keyData[aSymmetricKey.Length()];
char keyData[STACK_BUFFER_SIZE];
PRUint32 keyDataSize = sizeof(keyData);
char ivData[aIV.Length()];
char ivData[STACK_BUFFER_SIZE];
PRUint32 ivDataSize = sizeof(ivData);
rv = DecodeBase64(aSymmetricKey, keyData, &keyDataSize);
@ -468,8 +474,8 @@ WeaveCrypto::DeriveKeyFromPassphrase(const nsACString& aPassphrase,
PromiseFlatCString fPass(aPassphrase);
SECItem passphrase = {siBuffer, (unsigned char *)fPass.get(), fPass.Length()};
char saltBytes[aSalt.Length()];
PRUint32 saltBytesLength = aSalt.Length();
char saltBytes[STACK_BUFFER_SIZE];
PRUint32 saltBytesLength = sizeof(saltBytes);
rv = DecodeBase64(aSalt, saltBytes, &saltBytesLength);
NS_ENSURE_SUCCESS(rv, rv);
SECItem salt = {siBuffer, (unsigned char*)saltBytes, saltBytesLength};
@ -531,7 +537,7 @@ WeaveCrypto::WrapPrivateKey(SECKEYPrivateKey *aPrivateKey,
rv = DeriveKeyFromPassphrase(aPassphrase, aSalt, &pbeKey);
NS_ENSURE_SUCCESS(rv, rv);
char ivData[aIV.Length()];
char ivData[STACK_BUFFER_SIZE];
PRUint32 ivDataSize = sizeof(ivData);
rv = DecodeBase64(aIV, ivData, &ivDataSize);
NS_ENSURE_SUCCESS(rv, rv);
@ -554,7 +560,7 @@ WeaveCrypto::WrapPrivateKey(SECKEYPrivateKey *aPrivateKey,
// Use a stack buffer to hold the wrapped key. NSS says about 1200 bytes for
// a 2048-bit RSA key, so our 4096 byte buffer should be plenty.
unsigned char stackBuffer[4096];
unsigned char stackBuffer[STACK_BUFFER_SIZE];
SECItem wrappedKey = {siBuffer, stackBuffer, sizeof(stackBuffer)};
s = PK11_WrapPrivKey(aPrivateKey->pkcs11Slot,
@ -608,7 +614,10 @@ WeaveCrypto::GenerateRandomBytes(PRUint32 aByteCount,
nsACString& aEncodedBytes)
{
nsresult rv;
char random[aByteCount];
char random[STACK_BUFFER_SIZE];
if (aByteCount > STACK_BUFFER_SIZE)
return NS_ERROR_OUT_OF_MEMORY;
rv = PK11_GenerateRandom((unsigned char *)random, aByteCount);
NS_ENSURE_SUCCESS(rv, rv);
@ -631,7 +640,10 @@ WeaveCrypto::GenerateRandomIV(nsACString& aEncodedBytes)
CK_MECHANISM_TYPE mech = PK11_AlgtagToMechanism(mAlgorithm);
PRUint32 size = PK11_GetIVLength(mech);
char random[size];
char random[STACK_BUFFER_SIZE];
if (size > STACK_BUFFER_SIZE)
return NS_ERROR_OUT_OF_MEMORY;
rv = PK11_GenerateRandom((unsigned char *)random, size);
NS_ENSURE_SUCCESS(rv, rv);
@ -742,19 +754,19 @@ WeaveCrypto::WrapSymmetricKey(const nsACString& aSymmetricKey,
// Step 1. Get rid of the base64 encoding on the inputs.
char publicKeyBuffer[aPublicKey.Length()];
PRUint32 publicKeyBufferSize = aPublicKey.Length();
char publicKeyBuffer[STACK_BUFFER_SIZE];
PRUint32 publicKeyBufferSize = sizeof(publicKeyBuffer);
rv = DecodeBase64(aPublicKey, publicKeyBuffer, &publicKeyBufferSize);
NS_ENSURE_SUCCESS(rv, rv);
SECItem pubKeyData = {siBuffer, (unsigned char *)publicKeyBuffer, publicKeyBufferSize};
char symKeyBuffer[aSymmetricKey.Length()];
PRUint32 symKeyBufferSize = aSymmetricKey.Length();
char symKeyBuffer[STACK_BUFFER_SIZE];
PRUint32 symKeyBufferSize = sizeof(symKeyBuffer);
rv = DecodeBase64(aSymmetricKey, symKeyBuffer, &symKeyBufferSize);
NS_ENSURE_SUCCESS(rv, rv);
SECItem symKeyData = {siBuffer, (unsigned char *)symKeyBuffer, symKeyBufferSize};
char wrappedBuffer[4096];
char wrappedBuffer[STACK_BUFFER_SIZE];
SECItem wrappedKey = {siBuffer, (unsigned char *)wrappedBuffer, sizeof(wrappedBuffer)};
@ -869,14 +881,14 @@ WeaveCrypto::UnwrapSymmetricKey(const nsACString& aWrappedSymmetricKey,
// Step 1. Get rid of the base64 encoding on the inputs.
char privateKeyBuffer[aWrappedPrivateKey.Length()];
PRUint32 privateKeyBufferSize = aWrappedPrivateKey.Length();
char privateKeyBuffer[STACK_BUFFER_SIZE];
PRUint32 privateKeyBufferSize = sizeof(privateKeyBuffer);
rv = DecodeBase64(aWrappedPrivateKey, privateKeyBuffer, &privateKeyBufferSize);
NS_ENSURE_SUCCESS(rv, rv);
SECItem wrappedPrivKey = {siBuffer, (unsigned char *)privateKeyBuffer, privateKeyBufferSize};
char wrappedKeyBuffer[aWrappedSymmetricKey.Length()];
PRUint32 wrappedKeyBufferSize = aWrappedSymmetricKey.Length();
char wrappedKeyBuffer[STACK_BUFFER_SIZE];
PRUint32 wrappedKeyBufferSize = sizeof(wrappedKeyBuffer);
rv = DecodeBase64(aWrappedSymmetricKey, wrappedKeyBuffer, &wrappedKeyBufferSize);
NS_ENSURE_SUCCESS(rv, rv);
SECItem wrappedSymKey = {siBuffer, (unsigned char *)wrappedKeyBuffer, wrappedKeyBufferSize};
@ -886,7 +898,7 @@ WeaveCrypto::UnwrapSymmetricKey(const nsACString& aWrappedSymmetricKey,
rv = DeriveKeyFromPassphrase(aPassphrase, aSalt, &pbeKey);
NS_ENSURE_SUCCESS(rv, rv);
char ivData[aIV.Length()];
char ivData[STACK_BUFFER_SIZE];
PRUint32 ivDataSize = sizeof(ivData);
rv = DecodeBase64(aIV, ivData, &ivDataSize);
NS_ENSURE_SUCCESS(rv, rv);

View File

@ -1,89 +1,99 @@
<!ENTITY serverError1.description "Server Error: ">
<!ENTITY serverError2.description ", ">
<!ENTITY wizard.title "Weave Setup">
<!ENTITY intro.title "Welcome to Weave">
<!ENTITY intro.description "[description of Weave]">
<!ENTITY intro-more.label "Learn more">
<!ENTITY intro-more.link "http://labs.mozilla.com">
<!ENTITY welcome.title "Installation Type">
<!ENTITY curUser-title.label "Sign In">
<!ENTITY curUser.description "Sign into your existing account to set up Weave on this computer.">
<!ENTITY newUser-title.label "Get Started">
<!ENTITY newUser.description "Create a new account.">
<!ENTITY verify.title "Account Verification (Step 1 of 3)">
<!ENTITY username.label "User name:">
<!ENTITY password.label "Password:">
<!ENTITY passphrase.label "Passphrase:">
<!ENTITY reminder.label "Forgot your password? ">
<!ENTITY unverified.label "Unverified">
<!ENTITY recovery.link "https://sm-labs01.mozilla.org:81/client/forgot.php">
<!ENTITY create.title "Create Account (Step 1 of 5)">
<!ENTITY createUsername.label "Desired login name:">
<!ENTITY createUsernameHint.label "Examples: Maria, Maria.Emerson">
<!ENTITY createPassword.label "Choose a password:">
<!ENTITY createPasswordHint.label "Minimum of 5 characters in length.">
<!ENTITY createReenterPassword.label "Re-enter password:">
<!ENTITY createEmail.label "Current email address:">
<!ENTITY createEmailHint.label "e.g. yourname@domain.com">
<!ENTITY create2.title "Create Account (Step 2 of 5)">
<!ENTITY passphrase.description "You must also now choose an encryption passphrase that is different from your password. This will be used to protect your data on the server.">
<!ENTITY passphrase-more.label "Learn More">
<!ENTITY passphrase-more.link "http://labs.mozilla.com">
<!ENTITY reenterPassphrase.label "Re-enter passphrase:">
<!ENTITY moreInfo.label "More information on choosing a phrase.">
<!ENTITY create3.title "Create Account (Step 3 of 5)">
<!ENTITY instanceName.description "Name this device... explain why... ">
<!ENTITY instanceName.label "Device name:">
<!ENTITY examples.label "Examples: &quot;Home computer&quot;, &quot;Mobile phone&quot;, &quot;Work laptop&quot;">
<!ENTITY data.description "Choose the data that you would like Weave to store for you.">
<!ENTITY bookmarks.label "Bookmarks">
<!ENTITY history.label "Browsing History">
<!ENTITY cookies.label "Cookies">
<!ENTITY passwords.label "Saved Passwords">
<!ENTITY tabs.label "Tabs">
<!ENTITY formdata.label "Saved Form Data">
<!ENTITY captcha.label "Type the characters you see in the image below:">
<!ENTITY captchaDirections.label "">
<!ENTITY reloadCaptcha.text "Reload">
<!ENTITY captchaHint.label "Letters are not case-sensitive.">
<!ENTITY terms.label "Terms of Service">
<!ENTITY acceptTerms.label "I have read and accept the Terms of Service.">
<!ENTITY final.description "Your account will be created with the following preferences [this screen in progress]">
<!ENTITY initialLogin.label "Signing you in.">
<!ENTITY initialPrefs.label "Setting your preferences.">
<!ENTITY initialReset.label "Clearing your default bookmarks.">
<!ENTITY initialSync.label "Synchronizing your data.">
<!ENTITY finalStep1Finished.label "Signed in.">
<!ENTITY finalStep2.label "Synchronizing data...">
<!ENTITY finalStep3Finished.label "Data synchronized.">
<!ENTITY wizard.title "Weave Setup">
<!ENTITY intro.title "Welcome to Weave">
<!ENTITY intro-weave.description "Weave is an experimental prototype from Mozilla Labs that integrates online services with Firefox. ">
<!ENTITY intro-more.label "Learn more about the Weave project">
<!ENTITY intro-more.link "http://labs.mozilla.com">
<!ENTITY intro-warning.description "Warning: Use at your own risk! Backup Firefox data before continuing with installation.">
<!ENTITY eula.title "Software License Agreement">
<!ENTITY eula.description "Terms and conditions for using this software.">
<!ENTITY eula.accept "I accept the terms of the License Agreement">
<!ENTITY eula.decline "I do NOT accept the terms of the License Agreement">
<!ENTITY welcome.title "Installation Type">
<!ENTITY curUser-title.label "Sign In">
<!ENTITY curUser.description "Sign into your existing account to set up Weave on this computer.">
<!ENTITY newUser-title.label "Get Started">
<!ENTITY newUser.description "Create a new account and upload your Weave data to the server.">
<!ENTITY verify.title "Account Verification (Step 1 of 3)">
<!ENTITY username.label "User name:">
<!ENTITY password.label "Password:">
<!ENTITY passphrase.label "Passphrase:">
<!ENTITY reminder.label "Forgot your password? ">
<!ENTITY unverified.label "Unverified">
<!ENTITY recovery.link "https://sm-labs01.mozilla.org:81/client/forgot.php">
<!ENTITY create.title "Create Account (Step 1 of 5)">
<!ENTITY createUsername.label "Desired login name:">
<!ENTITY createUsernameHint.label "Examples: Maria, Maria.Emerson">
<!ENTITY createPassword.label "Choose a password:">
<!ENTITY createPasswordHint.label "Minimum of 5 characters in length.">
<!ENTITY createReenterPassword.label "Re-enter password:">
<!ENTITY createEmail.label "Current email address:">
<!ENTITY createEmailHint.label "e.g. yourname@domain.com">
<!ENTITY create2.title "Create Account (Step 2 of 5)">
<!ENTITY passphrase.description "You must also now choose an encryption passphrase that is different from your password. This will be used to protect your data on the server.">
<!ENTITY passphrase-more.label "Learn More">
<!ENTITY passphrase-more.link "http://labs.mozilla.com">
<!ENTITY reenterPassphrase.label "Re-enter passphrase:">
<!ENTITY moreInfo.label "More information on choosing a phrase.">
<!ENTITY create3.title "Create Account (Step 3 of 5)">
<!ENTITY instanceName.description "Choose a name for this device for Weave">
<!ENTITY instanceName.label "Device name:">
<!ENTITY examples.label "Examples: &quot;Home computer&quot;, &quot;Mobile phone&quot;, &quot;Work laptop&quot;">
<!ENTITY data.description "Choose the data that you would like Weave to store for you.">
<!ENTITY bookmarks.label "Bookmarks">
<!ENTITY history.label "Browsing History">
<!ENTITY cookies.label "Cookies">
<!ENTITY passwords.label "Saved Passwords">
<!ENTITY tabs.label "Tabs">
<!ENTITY formdata.label "Saved Form Data">
<!ENTITY captcha.label "Type the characters you see in the image below:">
<!ENTITY captchaDirections.label "">
<!ENTITY reloadCaptcha.text "Reload">
<!ENTITY captchaHint.label "Letters are not case-sensitive.">
<!ENTITY terms.label "Terms of Service">
<!ENTITY acceptTerms.label "I have read and accept the Terms of Service.">
<!ENTITY final.description "Weave perform an initial synchronization with the following settings. Continue to the next wizard page to accept.">
<!ENTITY initialLogin.label "Signing you in.">
<!ENTITY initialPrefs.label "Setting your preferences.">
<!ENTITY initialReset.label "Clearing your default bookmarks.">
<!ENTITY initialSync.label "Synchronizing your data.">
<!ENTITY finalStep1Finished.label "Signed in.">
<!ENTITY finalStep2.label "Synchronizing data...">
<!ENTITY finalStep3Finished.label "Data synchronized.">
<!ENTITY thankyou.title "Thank you!">
<!ENTITY thankyou.description "You successfully installed Weave. etc... ">
<!ENTITY thankyou.description "Weave has been installed on this device and your data has been synchronized. To change your Weave preferences, use the Weave tab of your browser preferences. ">
<!ENTITY final-pref-title.description "Preferences"> <!ENTITY final-account-title.description "Account"> <!ENTITY final-sync-title.description "Initial Synchronization">
<!ENTITY userCheckFailed1.description "Our server is having problems and we couldn't check that username. ">
<!ENTITY userCheckFailed2.description " to try again, or click &quot;Done&quot; to exit the setup wizard and try again later.">
<!ENTITY finished.description "Good job. You installed Weave. You can change preferences in the Weave tab...">
<!ENTITY initialLoginFailed1.description "Our server is having problems and we couldn't log you in. ">
<!ENTITY initialLoginFailed2.description " to try again, or click &quot;Done&quot; to exit the setup wizard and try again later.">
<!ENTITY initialSyncFailed1.description "Our server is having problems and we couldn't synchronize your data. ">
<!ENTITY initialSyncFailed2.description " to try again, or click &quot;Done&quot; to exit the setup wizard and try again later.">
<!ENTITY clickHere.text "Click here">
<!ENTITY tryAgain.text "Try again">
<!ENTITY final-pref-title.description "Preferences">
<!ENTITY final-account-title.description "Account">
<!ENTITY final-sync-title.description "Initial Synchronization">
<!ENTITY userCheckFailed1.description "Our server is having problems and we couldn't check that username. ">
<!ENTITY userCheckFailed2.description " to try again, or click &quot;Done&quot; to exit the setup wizard and try again later.">
<!ENTITY finished.description "Good job. You installed Weave. You can change preferences in the Weave tab...">
<!ENTITY initialLoginFailed1.description "Our server is having problems and we couldn't log you in. ">
<!ENTITY initialLoginFailed2.description " to try again, or click &quot;Done&quot; to exit the setup wizard and try again later.">
<!ENTITY initialSyncFailed1.description "Our server is having problems and we couldn't synchronize your data. ">
<!ENTITY initialSyncFailed2.description " to try again, or click &quot;Done&quot; to exit the setup wizard and try again later.">
<!ENTITY clickHere.text "Click here">
<!ENTITY tryAgain.text "Try again">
<!ENTITY serverError1.description "Server Error: ">
<!ENTITY serverError2.description ", ">

View File

@ -40,7 +40,7 @@ create-success.label = Account for %S created.
final-pref-value.label = %S
final-account-value.label = Username: %S
final-sync-value.label = [Explain that a sync will happen]
final-sync-value.label = Weave will upload your data to the server.
final-success.label = Weave was successfully installed.
default-name.label = %S's Firefox

View File

@ -192,6 +192,8 @@ Generator.prototype = {
this._exception = e;
} else if (e.message && e.message == 'Cannot acquire lock (internal lock)') {
this._log.warn("Exception: " + Utils.exceptionStr(e));
} else {
this._log.error("Exception: " + Utils.exceptionStr(e));
this._log.debug("Stack trace:\n" + Utils.stackTrace(e));

View File

@ -252,9 +252,6 @@ DAVCollection.prototype = {
},
LOCK: function DC_LOCK(path, data, onComplete) {
if (!this._lockAllowed)
throw "Cannot acquire lock (internal lock)";
let headers = {'Content-type': 'text/xml; charset="utf-8"',
'Depth': 'infinity',
'Timeout': 'Second-600'};
@ -319,14 +316,7 @@ DAVCollection.prototype = {
let resp = yield;
this._log.debug("checkLogin got response status " + resp.status);
// XXX would be nice if 404 == invalid username, 401 == invalid password.
let retmsg = "";
if (resp.status == 401)
retmsg = "invalid username or password";
else if (resp.status < 200 || resp.status >= 300)
retmsg = "server error";
self.done(retmsg);
self.done(resp.status);
},
// Locking
@ -364,9 +354,13 @@ DAVCollection.prototype = {
let self = yield;
this._log.trace("Acquiring lock");
if (!this._lockAllowed)
throw {message: "Cannot acquire lock (internal lock)"};
this._lockAllowed = false;
if (DAVLocks['default']) {
this._log.debug("Lock called, but we already hold a token");
this._lockAllowed = true;
self.done();
return;
}
@ -379,8 +373,10 @@ DAVCollection.prototype = {
"</D:lockinfo>", self.cb);
let resp = yield;
if (resp.status < 200 || resp.status >= 300)
if (resp.status < 200 || resp.status >= 300) {
this._lockAllowed = true;
return;
}
let tokens = Utils.xpath(resp.responseXML, '//D:locktoken/D:href');
let token = tokens.iterateNext();
@ -393,11 +389,14 @@ DAVCollection.prototype = {
if (!DAVLocks['default']) {
this._log.warn("Could not acquire lock");
this._lockAllowed = true;
self.done();
return;
}
this._log.trace("Lock acquired");
this._lockAllowed = true;
self.done(DAVLocks['default']);
},

View File

@ -1,3 +1,39 @@
/* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Mozilla Public License Version
* 1.1 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
* http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is Bookmarks Sync.
*
* The Initial Developer of the Original Code is Mozilla.
* Portions created by the Initial Developer are Copyright (C) 2008
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
* Jono DiCarlo <jdicarlo@mozilla.org>
*
* Alternatively, the contents of this file may be used under the terms of
* either the GNU General Public License Version 2 or later (the "GPL"), or
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
* in which case the provisions of the GPL or the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of either the GPL or the LGPL, and not to allow others to
* use your version of this file under the terms of the MPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the MPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
const EXPORTED_SYMBOLS = ['CookieEngine', 'CookieTracker', 'CookieStore'];
const Cc = Components.classes;

View File

@ -1,3 +1,39 @@
/* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Mozilla Public License Version
* 1.1 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
* http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is Bookmarks Sync.
*
* The Initial Developer of the Original Code is Mozilla.
* Portions created by the Initial Developer are Copyright (C) 2008
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
* Anant Narayanan <anant@kix.in>
*
* Alternatively, the contents of this file may be used under the terms of
* either the GNU General Public License Version 2 or later (the "GPL"), or
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
* in which case the provisions of the GPL or the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of either the GPL or the LGPL, and not to allow others to
* use your version of this file under the terms of the MPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the MPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
const EXPORTED_SYMBOLS = ['FormEngine'];
const Cc = Components.classes;
@ -11,6 +47,58 @@ Cu.import("resource://weave/syncCores.js");
Cu.import("resource://weave/stores.js");
Cu.import("resource://weave/trackers.js");
/*
* Generate GUID from a name,value pair.
* If the concatenated length is less than 40, we just Base64 the JSON.
* Otherwise, we Base64 the JSON of the name and SHA1 of the value.
* The first character of the key determines which method we used:
* '0' for full Base64, '1' for SHA-1'ed val.
*/
function _generateFormGUID(nam, val) {
var key;
var con = nam + val;
var jso = Cc["@mozilla.org/dom/json;1"].
createInstance(Ci.nsIJSON);
if (con.length <= 40) {
key = '0' + btoa(jso.encode([nam, val]));
} else {
val = Utils.sha1(val);
key = '1' + btoa(jso.encode([nam, val]));
}
return key;
}
/*
* Unwrap a name,value pair from a GUID.
* Return an array [sha1ed, name, value]
* sha1ed is a boolean determining if the value is SHA-1'ed or not.
*/
function _unwrapFormGUID(guid) {
var jso = Cc["@mozilla.org/dom/json;1"].
createInstance(Ci.nsIJSON);
var ret;
var dec = atob(guid.slice(1));
var obj = jso.decode(dec);
switch (guid[0]) {
case '0':
ret = [false, obj[0], obj[1]];
break;
case '1':
ret = [true, obj[0], obj[1]];
break;
default:
this._log.warn("Unexpected GUID header: " + guid[0] + ", aborting!");
return false;
}
return ret;
}
function FormEngine(pbeId) {
this._init(pbeId);
}
@ -71,7 +159,7 @@ FormSyncCore.prototype = {
while (stmnt.executeStep()) {
var nam = stmnt.getUTF8String(1);
var val = stmnt.getUTF8String(2);
var key = Utils.sha1(nam + val);
var key = _generateFormGUID(nam, val);
if (key == GUID)
found = true;
@ -115,18 +203,50 @@ FormStore.prototype = {
return this.__formHistory;
},
_getValueFromSHA1: function FormStore__getValueFromSHA1(name, sha) {
var query = "SELECT value FROM moz_formhistory WHERE fieldname = '" + name + "'";
var stmnt = this._formDB.createStatement(query);
var found = false;
while (stmnt.executeStep()) {
var val = stmnt.getUTF8String(0);
if (Utils.sha1(val) == sha) {
found = val;
break;
}
}
return found;
},
_createCommand: function FormStore__createCommand(command) {
this._log.info("FormStore got createCommand: " + command );
this._log.info("FormStore got createCommand: " + command);
this._formHistory.addEntry(command.data.name, command.data.value);
},
_removeCommand: function FormStore__removeCommand(command) {
this._log.info("FormStore got removeCommand: " + command );
this._formHistory.removeEntry(command.data.name, command.data.value);
this._log.info("FormStore got removeCommand: " + command);
var data = _unwrapFormGUID(command.GUID);
if (!data) {
this._log.warn("Invalid GUID found, ignoring remove request.");
return;
}
var nam = data[1];
var val = data[2];
if (data[0]) {
val = this._getValueFromSHA1(nam, val);
}
if (val) {
this._formHistory.removeEntry(nam, val);
} else {
this._log.warn("Form value not found from GUID, ignoring remove request.");
}
},
_editCommand: function FormStore__editCommand(command) {
this._log.info("FormStore got editCommand: " + command );
this._log.info("FormStore got editCommand: " + command);
this._log.warn("Form syncs are expected to only be create/remove!");
},
@ -137,7 +257,7 @@ FormStore.prototype = {
while (stmnt.executeStep()) {
var nam = stmnt.getUTF8String(1);
var val = stmnt.getUTF8String(2);
var key = Utils.sha1(nam + val);
var key = _generateFormGUID(nam, val);
items[key] = { name: nam, value: val };
}

View File

@ -1,3 +1,39 @@
/* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Mozilla Public License Version
* 1.1 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
* http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is Bookmarks Sync.
*
* The Initial Developer of the Original Code is Mozilla.
* Portions created by the Initial Developer are Copyright (C) 2008
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
* Dan Mills <thunder@mozilla.com>
*
* Alternatively, the contents of this file may be used under the terms of
* either the GNU General Public License Version 2 or later (the "GPL"), or
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
* in which case the provisions of the GPL or the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of either the GPL or the LGPL, and not to allow others to
* use your version of this file under the terms of the MPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the MPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
const EXPORTED_SYMBOLS = ['HistoryEngine'];
const Cc = Components.classes;

View File

@ -1,3 +1,39 @@
/* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Mozilla Public License Version
* 1.1 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
* http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is Bookmarks Sync.
*
* The Initial Developer of the Original Code is Mozilla.
* Portions created by the Initial Developer are Copyright (C) 2008
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
* Justin Dolske <dolske@mozilla.com>
*
* Alternatively, the contents of this file may be used under the terms of
* either the GNU General Public License Version 2 or later (the "GPL"), or
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
* in which case the provisions of the GPL or the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of either the GPL or the LGPL, and not to allow others to
* use your version of this file under the terms of the MPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the MPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
const EXPORTED_SYMBOLS = ['PasswordEngine'];
const Cu = Components.utils;

View File

@ -1,3 +1,39 @@
/* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Mozilla Public License Version
* 1.1 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
* http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is Bookmarks Sync.
*
* The Initial Developer of the Original Code is Mozilla.
* Portions created by the Initial Developer are Copyright (C) 2008
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
* Myk Melez <myk@mozilla.org>
*
* Alternatively, the contents of this file may be used under the terms of
* either the GNU General Public License Version 2 or later (the "GPL"), or
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
* in which case the provisions of the GPL or the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of either the GPL or the LGPL, and not to allow others to
* use your version of this file under the terms of the MPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the MPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
const EXPORTED_SYMBOLS = ['TabEngine'];
const Cc = Components.classes;
@ -77,11 +113,11 @@ TabSyncCore.prototype = {
// XXX Should we convert both to nsIURIs and then use nsIURI::equals
// to compare them?
if (GUID in tabs) {
this._log.debug("_itemExists: " + GUID + " exists");
this._log.trace("_itemExists: " + GUID + " exists");
return true;
}
this._log.debug("_itemExists: " + GUID + " doesn't exist");
this._log.trace("_itemExists: " + GUID + " doesn't exist");
return false;
},
@ -333,7 +369,7 @@ TabStore.prototype = {
// (f.e. in the "selectedWindow" and each tab's "index" properties), so we
// convert them to and from JavaScript's zero-based indexes as needed.
let windowID = i + 1;
this._log.debug("_wrapRealTabs: window " + windowID);
this._log.trace("_wrapRealTabs: window " + windowID);
for (let j = 0; j < window.tabs.length; j++) {
let tab = window.tabs[j];
@ -348,7 +384,7 @@ TabStore.prototype = {
}
let tabID = currentEntry.url;
this._log.debug("_wrapRealTabs: tab " + tabID);
this._log.trace("_wrapRealTabs: tab " + tabID);
// The ID property of each entry in the tab, which I think contains
// nsISHEntry::ID, changes every time session store restores the tab,

View File

@ -1,3 +1,39 @@
/* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Mozilla Public License Version
* 1.1 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
* http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is Bookmarks Sync.
*
* The Initial Developer of the Original Code is Mozilla.
* Portions created by the Initial Developer are Copyright (C) 2008
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
* Atul Varma <varmaa@toolness.com>
*
* Alternatively, the contents of this file may be used under the terms of
* either the GNU General Public License Version 2 or later (the "GPL"), or
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
* in which case the provisions of the GPL or the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of either the GPL or the LGPL, and not to allow others to
* use your version of this file under the terms of the MPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the MPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
const Cu = Components.utils;
Cu.import("resource://weave/log4moz.js");

View File

@ -260,8 +260,12 @@ WeaveSvc.prototype = {
_onSchedule: function WeaveSync__onSchedule() {
if (this.enabled) {
this._log.info("Running scheduled sync");
this._notify("syncAsNeeded", this._lock(this._syncAsNeeded)).async(this);
if (!DAV.allowLock) {
this._log.info("Skipping scheduled sync; local operation in progress")
} else {
this._log.info("Running scheduled sync");
this._notify("syncAsNeeded", this._lock(this._syncAsNeeded)).async(this);
}
}
},
@ -509,16 +513,16 @@ WeaveSvc.prototype = {
DAV.baseURL = Utils.prefs.getCharPref("serverURL");
DAV.defaultPrefix = "user/" + username;
DAV.checkLogin.async(DAV, self.cb, username, password);
let resultMsg = yield;
this._log.info("Using server URL: " + DAV.baseURL + DAV.defaultPrefix);
// If we got an error message, throw it. [need to throw to cause the
// _notify() wrapper to generate an error notification for observers].
if (resultMsg) {
this._log.debug("Login verification: " + resultMsg);
throw resultMsg;
let status = yield DAV.checkLogin.async(DAV, self.cb, username, password);
if (status == 404) {
// create user directory (for self-hosted webdav shares)
// XXX do this in login?
yield this._checkUserDir.async(this, self.cb);
status = yield DAV.checkLogin.async(DAV, self.cb, username, password);
}
Utils.ensureStatus(status, "Login verification failed");
},
login: function WeaveSync_login(onComplete) {
@ -539,15 +543,12 @@ WeaveSvc.prototype = {
this._log.info("Using server URL: " + DAV.baseURL + DAV.defaultPrefix);
this._versionCheck.async(this, self.cb);
yield;
this._getKeypair.async(this, self.cb);
yield;
this._loggedIn = true;
yield this._versionCheck.async(this, self.cb);
yield this._getKeypair.async(this, self.cb);
this._setSchedule(this.schedule);
this._loggedIn = true;
self.done(true);
},

View File

@ -1,3 +1,39 @@
/* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Mozilla Public License Version
* 1.1 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
* http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is Bookmarks Sync.
*
* The Initial Developer of the Original Code is Mozilla.
* Portions created by the Initial Developer are Copyright (C) 2008
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
* Atul Varma <varmaa@toolness.com>
*
* Alternatively, the contents of this file may be used under the terms of
* either the GNU General Public License Version 2 or later (the "GPL"), or
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
* in which case the provisions of the GPL or the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of either the GPL or the LGPL, and not to allow others to
* use your version of this file under the terms of the MPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the MPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
EXPORTED_SYMBOLS = ["Sharing"];
const Cc = Components.classes;

View File

@ -168,7 +168,8 @@ SnapshotStore.prototype = {
delete this._data[oldGUID];
for (let GUID in this._data) {
if (this._data[GUID].parentGUID == oldGUID)
if (("parentGUID" in this._data[GUID]) &&
(this._data[GUID].parentGUID == oldGUID))
this._data[GUID].parentGUID = newGUID;
}
}

View File

@ -14,7 +14,7 @@
* The Original Code is Bookmarks Sync.
*
* The Initial Developer of the Original Code is Mozilla.
* Portions created by the Initial Developer are Copyright (C) 2007
* Portions created by the Initial Developer are Copyright (C) 2008
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):

View File

@ -203,7 +203,7 @@ let Utils = {
},
exceptionStr: function Weave_exceptionStr(e) {
let message = e.message? e.message : e;
let message = e.message ? e.message : e;
let location = "";
if (e.location)
@ -307,31 +307,6 @@ let Utils = {
Ci.nsIDOMXPathResult.ANY_TYPE, null);
},
runCmd: function Weave_runCmd() {
var binary;
var args = [];
for (let i = 0; i < arguments.length; ++i) {
args.push(arguments[i]);
}
if (args[0] instanceof Ci.nsIFile) {
binary = args.shift();
} else {
binary = Cc["@mozilla.org/file/local;1"].createInstance(Ci.nsILocalFile);
binary.initWithPath(args.shift());
}
var p = Cc["@mozilla.org/process/util;1"].createInstance(Ci.nsIProcess);
p.init(binary);
let log = Log4Moz.Service.getLogger("Service.Util");
log.debug("Running command: " + binary.path + " " + args.join(" "));
p.run(true, args, args.length);
return p.exitValue;
},
getTmp: function Weave_getTmp(name) {
let ds = Cc["@mozilla.org/file/directory_service;1"].
getService(Ci.nsIProperties);

View File

@ -1,3 +1,39 @@
/* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Mozilla Public License Version
* 1.1 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
* http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is Bookmarks Sync.
*
* The Initial Developer of the Original Code is Mozilla.
* Portions created by the Initial Developer are Copyright (C) 2008
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
* Jono DiCarlo <jdicarlo@mozilla.org>
*
* Alternatively, the contents of this file may be used under the terms of
* either the GNU General Public License Version 2 or later (the "GPL"), or
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
* in which case the provisions of the GPL or the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of either the GPL or the LGPL, and not to allow others to
* use your version of this file under the terms of the MPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the MPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
const EXPORTED_SYMBOLS = [ "PlainAuthenticator", "Md5DigestAuthenticator" ];
var Cc = Components.classes;

View File

@ -1,3 +1,39 @@
/* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Mozilla Public License Version
* 1.1 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
* http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is Bookmarks Sync.
*
* The Initial Developer of the Original Code is Mozilla.
* Portions created by the Initial Developer are Copyright (C) 2008
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
* Jono DiCarlo <jdicarlo@mozilla.org>
*
* Alternatively, the contents of this file may be used under the terms of
* either the GNU General Public License Version 2 or later (the "GPL"), or
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
* in which case the provisions of the GPL or the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of either the GPL or the LGPL, and not to allow others to
* use your version of this file under the terms of the MPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the MPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
const EXPORTED_SYMBOLS = ['HTTPPollingTransport'];
var Cc = Components.classes;

View File

@ -1,3 +1,39 @@
/* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Mozilla Public License Version
* 1.1 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
* http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is Bookmarks Sync.
*
* The Initial Developer of the Original Code is Mozilla.
* Portions created by the Initial Developer are Copyright (C) 2008
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
* Jono DiCarlo <jdicarlo@mozilla.org>
*
* Alternatively, the contents of this file may be used under the terms of
* either the GNU General Public License Version 2 or later (the "GPL"), or
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
* in which case the provisions of the GPL or the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of either the GPL or the LGPL, and not to allow others to
* use your version of this file under the terms of the MPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the MPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
const EXPORTED_SYMBOLS = ['XmppClient', 'HTTPPollingTransport', 'PlainAuthenticator', 'Md5DigestAuthenticator'];
// See www.xulplanet.com/tutorials/mozsdk/sockets.php

View File

@ -1,4 +1,4 @@
pref("extensions.weave.serverURL", "https://sm-labs01.mozilla.org:81/");
pref("extensions.weave.serverURL", "https://services.mozilla.com/0.2/");
pref("extensions.weave.username", "nobody");
pref("extensions.weave.encryption", "aes-256-cbc");
@ -18,7 +18,7 @@ pref("extensions.weave.syncOnQuit.enabled", true);
pref("extensions.weave.engine.bookmarks", true);
pref("extensions.weave.engine.history", true);
pref("extensions.weave.engine.cookies", true );
pref("extensions.weave.engine.passwords", true );
pref("extensions.weave.engine.passwords", false);
pref("extensions.weave.engine.forms", true );
pref("extensions.weave.engine.tabs", true);

View File

@ -1 +0,0 @@
../harness/Makefile

View File

@ -0,0 +1,2 @@
all:
${MAKE} -f ../harness/Makefile

View File

@ -27,6 +27,7 @@ function FakeLoginManager(fakeLogins) {
Utils.getLoginManager = function fake_getLoginManager() {
// Return a fake nsILoginManager object.
return {
removeAllLogins: function() { self.fakeLogins = []; },
getAllLogins: function() { return self.fakeLogins; },
addLogin: function(login) {
getTestLogger().info("nsILoginManager.addLogin() called " +

View File

@ -274,7 +274,7 @@ function FakeGUIDService() {
};
}
function SyncTestingInfrastructure() {
function SyncTestingInfrastructure(engineFactory) {
let __fakePasswords = {
'Mozilla Services Password': {foo: "bar"},
'Mozilla Services Encryption Passphrase': {foo: "passphrase"}
@ -289,6 +289,7 @@ function SyncTestingInfrastructure() {
};
Cu.import("resource://weave/identity.js");
Cu.import("resource://weave/util.js");
ID.set('WeaveID',
new Identity('Mozilla Services Encryption Passphrase', 'foo'));
@ -301,6 +302,51 @@ function SyncTestingInfrastructure() {
this.fakeFilesystem = new FakeFilesystemService({});
this.fakeGUIDService = new FakeGUIDService();
this._logger = getTestLogger();
this._engineFactory = engineFactory;
this._clientStates = [];
this.saveClientState = function pushClientState(label) {
let state = Utils.deepCopy(this.fakeFilesystem.fakeContents);
let currContents = this.fakeFilesystem.fakeContents;
this.fakeFilesystem.fakeContents = [];
let engine = this._engineFactory();
let snapshot = Utils.deepCopy(engine._store.wrap());
this._clientStates[label] = {state: state, snapshot: snapshot};
this.fakeFilesystem.fakeContents = currContents;
};
this.restoreClientState = function restoreClientState(label) {
let state = this._clientStates[label].state;
let snapshot = this._clientStates[label].snapshot;
function _restoreState() {
let self = yield;
this.fakeFilesystem.fakeContents = [];
let engine = this._engineFactory();
engine._store.wipe();
let originalSnapshot = Utils.deepCopy(engine._store.wrap());
engine._core.detectUpdates(self.cb, originalSnapshot, snapshot);
let commands = yield;
engine._store.applyCommands.async(engine._store, self.cb, commands);
yield;
this.fakeFilesystem.fakeContents = Utils.deepCopy(state);
}
let self = this;
function restoreState(cb) {
_restoreState.async(self, cb);
}
this.runAsyncFunc("restore client state of " + label,
restoreState);
};
this.__makeCallback = function __makeCallback() {
this.__callbackCalled = false;
let self = this;
@ -309,8 +355,19 @@ function SyncTestingInfrastructure() {
};
};
this.doSync = function doSync(name) {
let self = this;
function freshEngineSync(cb) {
let engine = self._engineFactory();
engine.sync(cb);
}
this.runAsyncFunc(name, freshEngineSync);
};
this.runAsyncFunc = function runAsyncFunc(name, func) {
let logger = getTestLogger();
let logger = this._logger;
logger.info("-----------------------------------------");
logger.info("Step '" + name + "' starting.");
@ -324,4 +381,10 @@ function SyncTestingInfrastructure() {
do_check_eq(Async.outstandingGenerators.length, 0);
logger.info("Step '" + name + "' succeeded.");
};
this.resetClientState = function resetClientState() {
this.fakeFilesystem.fakeContents = {};
let engine = this._engineFactory();
engine._store.wipe();
};
}

View File

@ -1,4 +1,8 @@
Cu.import("resource://weave/engines/bookmarks.js");
Cu.import("resource://weave/util.js");
Cu.import("resource://weave/async.js");
Function.prototype.async = Async.sugar;
load("bookmark_setup.js");
@ -10,37 +14,37 @@ function FakeMicrosummaryService() {
return {hasMicrosummary: function() { return false; }};
}
function makeBookmarksEngine() {
let engine = new BookmarksEngine();
engine._store.__ms = new FakeMicrosummaryService();
return engine;
}
function run_test() {
var syncTesting = new SyncTestingInfrastructure();
// -----
// Setup
// -----
function freshEngineSync(cb) {
let engine = new BookmarksEngine();
engine._store.__ms = new FakeMicrosummaryService();
engine.sync(cb);
};
function resetProfile() {
// Simulate going to another computer by removing stuff from our
// objects.
syncTesting.fakeFilesystem.fakeContents = {};
bms.removeItem(boogleBm);
bms.removeItem(yoogleBm);
}
var syncTesting = new SyncTestingInfrastructure(makeBookmarksEngine);
let bms = Cc["@mozilla.org/browser/nav-bookmarks-service;1"].
getService(Ci.nsINavBookmarksService);
cleanUp();
// -----------
// Test Proper
// -----------
let boogleBm = bms.insertBookmark(bms.bookmarksMenuFolder,
uri("http://www.boogle.com"),
-1,
"Boogle");
bms.setItemGUID(boogleBm, "boogle-bookmark-guid");
syncTesting.runAsyncFunc("initial sync w/ one bookmark", freshEngineSync);
syncTesting.doSync("initial sync w/ one bookmark");
syncTesting.runAsyncFunc("trivial re-sync", freshEngineSync);
syncTesting.doSync("trivial re-sync");
let yoogleBm = bms.insertBookmark(bms.bookmarksMenuFolder,
uri("http://www.yoogle.com"),
@ -48,18 +52,59 @@ function run_test() {
"Yoogle");
bms.setItemGUID(yoogleBm, "yoogle-bookmark-guid");
syncTesting.runAsyncFunc("add bookmark and re-sync", freshEngineSync);
syncTesting.doSync("add bookmark and re-sync");
bms.moveItem(yoogleBm,
bms.bookmarksMenuFolder,
0);
syncTesting.runAsyncFunc("swap bookmark order and re-sync",
freshEngineSync);
syncTesting.doSync("swap bookmark order and re-sync");
resetProfile();
syncTesting.saveClientState("first computer");
syncTesting.runAsyncFunc("re-sync on second computer", freshEngineSync);
syncTesting.resetClientState();
syncTesting.doSync("re-sync on second computer");
let zoogleBm = bms.insertBookmark(bms.bookmarksMenuFolder,
uri("http://www.zoogle.com"),
-1,
"Zoogle");
bms.setItemGUID(zoogleBm, "zoogle-bookmark-guid");
syncTesting.doSync("add bookmark on second computer and resync");
syncTesting.saveClientState("second computer");
syncTesting.restoreClientState("first computer");
syncTesting.doSync("re-sync on first computer");
let binkBm1 = bms.insertBookmark(bms.bookmarksMenuFolder,
uri("http://www.bink.com"),
-1,
"Bink");
bms.setItemGUID(binkBm1, "bink-bookmark-guid-1");
syncTesting.doSync("add bookmark 'bink' on first computer and resync");
syncTesting.restoreClientState("second computer");
let binkBm2 = bms.insertBookmark(bms.bookmarksMenuFolder,
uri("http://www.bink.com"),
-1,
"Bink");
bms.setItemGUID(binkBm2, "bink-bookmark-guid-2");
syncTesting.doSync("Manually add same bookmark 'bink', but with " +
"different GUID, to second computer and resync");
binkBm2 = bms.getBookmarkIdsForURI(uri("http://www.bink.com"), {})[0];
do_check_eq(bms.getItemGUID(binkBm2), "bink-bookmark-guid-1");
// --------
// Teardown
// --------
cleanUp();
}

View File

@ -175,6 +175,183 @@ Service.BmkEngine INFO Actual changes for server: 0
Service.BmkEngine DEBUG Actual changes for server: []
Service.BmkEngine INFO Sync complete
Testing INFO Step 're-sync on second computer' succeeded.
Testing INFO -----------------------------------------
Testing INFO Step 'add bookmark on second computer and resync' starting.
Testing INFO -----------------------------------------
Testing INFO Opening 'weave/snapshots/bookmarks.json' for reading.
Testing INFO Reading from stream.
Service.SnapStore INFO Read saved snapshot from disk
Service.BmkEngine INFO Beginning sync
Testing INFO HTTP MKCOL on user-data/bookmarks/deltas
Service.RemoteStore DEBUG Downloading status file
Testing INFO HTTP GET from user-data/bookmarks/status.json, returning status 200
Service.Resource DEBUG GET request successful
Service.JsonFilter DEBUG Decoding JSON data
Service.RemoteStore DEBUG Downloading status file... done
Service.BmkEngine INFO Local snapshot version: 2
Service.BmkEngine INFO Server maxVersion: 2
Service.RemoteStore DEBUG Using last sync snapshot as server snapshot (snap version == max version)
Service.RemoteStore TRACE Local snapshot version == server maxVersion
Service.BmkEngine INFO Reconciling client/server updates
Service.BMSync DEBUG Reconciling 1 against 0 commands
Service.BmkEngine INFO Changes for client: 0
Service.BmkEngine INFO Predicted changes for server: 1
Service.BmkEngine INFO Client conflicts: 0
Service.BmkEngine INFO Server conflicts: 0
Service.BmkEngine INFO Actual changes for server: 1
Service.BmkEngine DEBUG Actual changes for server: [{"action":"create","GUID":"zoogle-bookmark-guid","depth":1,"parents":["menu"],"data":{"parentGUID":"menu","index":2,"type":"bookmark","title":"Zoogle","URI":"http://www.zoogle.com/","tags":[],"keyword":null}}]
Service.BmkEngine INFO Uploading changes to server
Service.JsonFilter DEBUG Encoding data as JSON
Service.CryptoFilter DEBUG Encrypting data
Service.Crypto DEBUG NOT encrypting data
Testing INFO HTTP PUT to user-data/bookmarks/deltas/3 with data: [{"action":"create","GUID":"zoogle-bookmark-guid","depth":1,"parents":["menu"],"data":{"parentGUID":"menu","index":2,"type":"bookmark","title":"Zoogle","URI":"http://www.zoogle.com/","tags":[],"keyword":null}}]
Service.ResourceSet DEBUG PUT request successful
Service.JsonFilter DEBUG Encoding data as JSON
Testing INFO HTTP PUT to user-data/bookmarks/status.json with data: {"GUID":"fake-guid-0","formatVersion":2,"snapVersion":0,"maxVersion":3,"snapEncryption":"none","deltasEncryption":"none","itemCount":6}
Service.Resource DEBUG PUT request successful
Service.BmkEngine INFO Successfully updated deltas and status on server
Service.SnapStore INFO Saving snapshot to disk
Testing INFO Opening 'weave/snapshots/bookmarks.json' for writing.
Testing INFO Writing data to local file 'weave/snapshots/bookmarks.json': {"version":3,"GUID":"fake-guid-0","snapshot":{"yoogle-bookmark-guid":{"parentGUID":"menu","index":0,"type":"bookmark","title":"Yoogle","URI":"http://www.yoogle.com/","tags":[],"keyword":null},"boogle-bookmark-guid":{"parentGUID":"menu","index":1,"type":"bookmark","title":"Boogle","URI":"http://www.boogle.com/","tags":[],"keyword":null},"zoogle-bookmark-guid":{"parentGUID":"menu","index":2,"type":"bookmark","title":"Zoogle","URI":"http://www.zoogle.com/","tags":[],"keyword":null},"menu":{"type":"folder"},"toolbar":{"type":"folder"},"unfiled":{"type":"folder"}}}
Service.BmkEngine INFO Sync complete
Testing INFO Step 'add bookmark on second computer and resync' succeeded.
Testing INFO -----------------------------------------
Testing INFO Step 'restore client state of first computer' starting.
Testing INFO -----------------------------------------
Service.BStore TRACE Processing command: {"action":"create","GUID":"yoogle-bookmark-guid","depth":1,"parents":["menu"],"data":{"parentGUID":"menu","index":0,"type":"bookmark","title":"Yoogle","URI":"http://www.yoogle.com/","tags":[],"keyword":null}}
Service.BStore DEBUG -> creating bookmark "Yoogle"
Service.BStore TRACE Processing command: {"action":"create","GUID":"boogle-bookmark-guid","depth":1,"parents":["menu"],"data":{"parentGUID":"menu","index":1,"type":"bookmark","title":"Boogle","URI":"http://www.boogle.com/","tags":[],"keyword":null}}
Service.BStore DEBUG -> creating bookmark "Boogle"
Testing INFO Step 'restore client state of first computer' succeeded.
Testing INFO -----------------------------------------
Testing INFO Step 're-sync on first computer' starting.
Testing INFO -----------------------------------------
Testing INFO Opening 'weave/snapshots/bookmarks.json' for reading.
Testing INFO Reading from stream.
Service.SnapStore INFO Read saved snapshot from disk
Service.BmkEngine INFO Beginning sync
Testing INFO HTTP MKCOL on user-data/bookmarks/deltas
Service.RemoteStore DEBUG Downloading status file
Testing INFO HTTP GET from user-data/bookmarks/status.json, returning status 200
Service.Resource DEBUG GET request successful
Service.JsonFilter DEBUG Decoding JSON data
Service.RemoteStore DEBUG Downloading status file... done
Service.BmkEngine INFO Local snapshot version: 2
Service.BmkEngine INFO Server maxVersion: 3
Service.RemoteStore DEBUG Using last sync snapshot as starting point for server snapshot
Service.RemoteStore INFO Downloading server deltas
Testing INFO HTTP GET from user-data/bookmarks/deltas/3, returning status 200
Service.ResourceSet DEBUG GET request successful
Service.CryptoFilter DEBUG Decrypting data
Service.Crypto DEBUG NOT decrypting data
Service.JsonFilter DEBUG Decoding JSON data
Service.SnapStore TRACE Processing command: {"action":"create","GUID":"zoogle-bookmark-guid","depth":1,"parents":["menu"],"data":{"parentGUID":"menu","index":2,"type":"bookmark","title":"Zoogle","URI":"http://www.zoogle.com/","tags":[],"keyword":null}}
Service.BmkEngine INFO Reconciling client/server updates
Service.BMSync DEBUG Reconciling 0 against 1 commands
Service.BmkEngine INFO Changes for client: 1
Service.BmkEngine INFO Predicted changes for server: 0
Service.BmkEngine INFO Client conflicts: 0
Service.BmkEngine INFO Server conflicts: 0
Service.BmkEngine INFO Applying changes locally
Service.SnapStore TRACE Processing command: {"action":"create","GUID":"zoogle-bookmark-guid","depth":1,"parents":["menu"],"data":{"parentGUID":"menu","index":2,"type":"bookmark","title":"Zoogle","URI":"http://www.zoogle.com/","tags":[],"keyword":null}}
Service.BStore TRACE Processing command: {"action":"create","GUID":"zoogle-bookmark-guid","depth":1,"parents":["menu"],"data":{"parentGUID":"menu","index":2,"type":"bookmark","title":"Zoogle","URI":"http://www.zoogle.com/","tags":[],"keyword":null}}
Service.BStore DEBUG -> creating bookmark "Zoogle"
Service.SnapStore INFO Saving snapshot to disk
Testing INFO Opening 'weave/snapshots/bookmarks.json' for writing.
Testing INFO Writing data to local file 'weave/snapshots/bookmarks.json': {"version":3,"GUID":"fake-guid-0","snapshot":{"yoogle-bookmark-guid":{"parentGUID":"menu","index":0,"type":"bookmark","title":"Yoogle","URI":"http://www.yoogle.com/","tags":[],"keyword":null},"boogle-bookmark-guid":{"parentGUID":"menu","index":1,"type":"bookmark","title":"Boogle","URI":"http://www.boogle.com/","tags":[],"keyword":null},"menu":{"type":"folder"},"toolbar":{"type":"folder"},"unfiled":{"type":"folder"},"zoogle-bookmark-guid":{"parentGUID":"menu","index":2,"type":"bookmark","title":"Zoogle","URI":"http://www.zoogle.com/","tags":[],"keyword":null}}}
Service.BmkEngine INFO Actual changes for server: 0
Service.BmkEngine DEBUG Actual changes for server: []
Service.BmkEngine INFO Sync complete
Testing INFO Step 're-sync on first computer' succeeded.
Testing INFO -----------------------------------------
Testing INFO Step 'add bookmark 'bink' on first computer and resync' starting.
Testing INFO -----------------------------------------
Testing INFO Opening 'weave/snapshots/bookmarks.json' for reading.
Testing INFO Reading from stream.
Service.SnapStore INFO Read saved snapshot from disk
Service.BmkEngine INFO Beginning sync
Testing INFO HTTP MKCOL on user-data/bookmarks/deltas
Service.RemoteStore DEBUG Downloading status file
Testing INFO HTTP GET from user-data/bookmarks/status.json, returning status 200
Service.Resource DEBUG GET request successful
Service.JsonFilter DEBUG Decoding JSON data
Service.RemoteStore DEBUG Downloading status file... done
Service.BmkEngine INFO Local snapshot version: 3
Service.BmkEngine INFO Server maxVersion: 3
Service.RemoteStore DEBUG Using last sync snapshot as server snapshot (snap version == max version)
Service.RemoteStore TRACE Local snapshot version == server maxVersion
Service.BmkEngine INFO Reconciling client/server updates
Service.BMSync DEBUG Reconciling 1 against 0 commands
Service.BmkEngine INFO Changes for client: 0
Service.BmkEngine INFO Predicted changes for server: 1
Service.BmkEngine INFO Client conflicts: 0
Service.BmkEngine INFO Server conflicts: 0
Service.BmkEngine INFO Actual changes for server: 1
Service.BmkEngine DEBUG Actual changes for server: [{"action":"create","GUID":"bink-bookmark-guid-1","depth":1,"parents":["menu"],"data":{"parentGUID":"menu","index":3,"type":"bookmark","title":"Bink","URI":"http://www.bink.com/","tags":[],"keyword":null}}]
Service.BmkEngine INFO Uploading changes to server
Service.JsonFilter DEBUG Encoding data as JSON
Service.CryptoFilter DEBUG Encrypting data
Service.Crypto DEBUG NOT encrypting data
Testing INFO HTTP PUT to user-data/bookmarks/deltas/4 with data: [{"action":"create","GUID":"bink-bookmark-guid-1","depth":1,"parents":["menu"],"data":{"parentGUID":"menu","index":3,"type":"bookmark","title":"Bink","URI":"http://www.bink.com/","tags":[],"keyword":null}}]
Service.ResourceSet DEBUG PUT request successful
Service.JsonFilter DEBUG Encoding data as JSON
Testing INFO HTTP PUT to user-data/bookmarks/status.json with data: {"GUID":"fake-guid-0","formatVersion":2,"snapVersion":0,"maxVersion":4,"snapEncryption":"none","deltasEncryption":"none","itemCount":7}
Service.Resource DEBUG PUT request successful
Service.BmkEngine INFO Successfully updated deltas and status on server
Service.SnapStore INFO Saving snapshot to disk
Testing INFO Opening 'weave/snapshots/bookmarks.json' for writing.
Testing INFO Writing data to local file 'weave/snapshots/bookmarks.json': {"version":4,"GUID":"fake-guid-0","snapshot":{"yoogle-bookmark-guid":{"parentGUID":"menu","index":0,"type":"bookmark","title":"Yoogle","URI":"http://www.yoogle.com/","tags":[],"keyword":null},"boogle-bookmark-guid":{"parentGUID":"menu","index":1,"type":"bookmark","title":"Boogle","URI":"http://www.boogle.com/","tags":[],"keyword":null},"zoogle-bookmark-guid":{"parentGUID":"menu","index":2,"type":"bookmark","title":"Zoogle","URI":"http://www.zoogle.com/","tags":[],"keyword":null},"bink-bookmark-guid-1":{"parentGUID":"menu","index":3,"type":"bookmark","title":"Bink","URI":"http://www.bink.com/","tags":[],"keyword":null},"menu":{"type":"folder"},"toolbar":{"type":"folder"},"unfiled":{"type":"folder"}}}
Service.BmkEngine INFO Sync complete
Testing INFO Step 'add bookmark 'bink' on first computer and resync' succeeded.
Testing INFO -----------------------------------------
Testing INFO Step 'restore client state of second computer' starting.
Testing INFO -----------------------------------------
Service.BStore TRACE Processing command: {"action":"create","GUID":"yoogle-bookmark-guid","depth":1,"parents":["menu"],"data":{"parentGUID":"menu","index":0,"type":"bookmark","title":"Yoogle","URI":"http://www.yoogle.com/","tags":[],"keyword":null}}
Service.BStore DEBUG -> creating bookmark "Yoogle"
Service.BStore TRACE Processing command: {"action":"create","GUID":"boogle-bookmark-guid","depth":1,"parents":["menu"],"data":{"parentGUID":"menu","index":1,"type":"bookmark","title":"Boogle","URI":"http://www.boogle.com/","tags":[],"keyword":null}}
Service.BStore DEBUG -> creating bookmark "Boogle"
Service.BStore TRACE Processing command: {"action":"create","GUID":"zoogle-bookmark-guid","depth":1,"parents":["menu"],"data":{"parentGUID":"menu","index":2,"type":"bookmark","title":"Zoogle","URI":"http://www.zoogle.com/","tags":[],"keyword":null}}
Service.BStore DEBUG -> creating bookmark "Zoogle"
Testing INFO Step 'restore client state of second computer' succeeded.
Testing INFO -----------------------------------------
Testing INFO Step 'Manually add same bookmark 'bink', but with different GUID, to second computer and resync' starting.
Testing INFO -----------------------------------------
Testing INFO Opening 'weave/snapshots/bookmarks.json' for reading.
Testing INFO Reading from stream.
Service.SnapStore INFO Read saved snapshot from disk
Service.BmkEngine INFO Beginning sync
Testing INFO HTTP MKCOL on user-data/bookmarks/deltas
Service.RemoteStore DEBUG Downloading status file
Testing INFO HTTP GET from user-data/bookmarks/status.json, returning status 200
Service.Resource DEBUG GET request successful
Service.JsonFilter DEBUG Decoding JSON data
Service.RemoteStore DEBUG Downloading status file... done
Service.BmkEngine INFO Local snapshot version: 3
Service.BmkEngine INFO Server maxVersion: 4
Service.RemoteStore DEBUG Using last sync snapshot as starting point for server snapshot
Service.RemoteStore INFO Downloading server deltas
Testing INFO HTTP GET from user-data/bookmarks/deltas/4, returning status 200
Service.ResourceSet DEBUG GET request successful
Service.CryptoFilter DEBUG Decrypting data
Service.Crypto DEBUG NOT decrypting data
Service.JsonFilter DEBUG Decoding JSON data
Service.SnapStore TRACE Processing command: {"action":"create","GUID":"bink-bookmark-guid-1","depth":1,"parents":["menu"],"data":{"parentGUID":"menu","index":3,"type":"bookmark","title":"Bink","URI":"http://www.bink.com/","tags":[],"keyword":null}}
Service.BmkEngine INFO Reconciling client/server updates
Service.BMSync DEBUG Reconciling 1 against 1 commands
Service.BmkEngine INFO Changes for client: 1
Service.BmkEngine INFO Predicted changes for server: 0
Service.BmkEngine INFO Client conflicts: 0
Service.BmkEngine INFO Server conflicts: 0
Service.BmkEngine INFO Applying changes locally
Service.SnapStore TRACE Processing command: {"action":"edit","GUID":"bink-bookmark-guid-2","data":{"GUID":"bink-bookmark-guid-1"}}
Service.BStore TRACE Processing command: {"action":"edit","GUID":"bink-bookmark-guid-2","data":{"GUID":"bink-bookmark-guid-1"}}
Service.SnapStore INFO Saving snapshot to disk
Testing INFO Opening 'weave/snapshots/bookmarks.json' for writing.
Testing INFO Writing data to local file 'weave/snapshots/bookmarks.json': {"version":4,"GUID":"fake-guid-0","snapshot":{"yoogle-bookmark-guid":{"parentGUID":"menu","index":0,"type":"bookmark","title":"Yoogle","URI":"http://www.yoogle.com/","tags":[],"keyword":null},"boogle-bookmark-guid":{"parentGUID":"menu","index":1,"type":"bookmark","title":"Boogle","URI":"http://www.boogle.com/","tags":[],"keyword":null},"zoogle-bookmark-guid":{"parentGUID":"menu","index":2,"type":"bookmark","title":"Zoogle","URI":"http://www.zoogle.com/","tags":[],"keyword":null},"menu":{"type":"folder"},"toolbar":{"type":"folder"},"unfiled":{"type":"folder"},"bink-bookmark-guid-1":{"parentGUID":"menu","index":3,"type":"bookmark","title":"Bink","URI":"http://www.bink.com/","tags":[],"keyword":null}}}
Service.BmkEngine INFO Actual changes for server: 0
Service.BmkEngine DEBUG Actual changes for server: []
Service.BmkEngine INFO Sync complete
Testing INFO Step 'Manually add same bookmark 'bink', but with different GUID, to second computer and resync' succeeded.
*** test finished
*** exiting
*** PASS ***

View File

@ -7,17 +7,13 @@ load("fake_login_manager.js");
// ----------------------------------------
function run_test() {
var syncTesting = new SyncTestingInfrastructure();
function passwdFactory() { return new PasswordEngine(); }
var syncTesting = new SyncTestingInfrastructure(passwdFactory);
var fakeLoginManager = new FakeLoginManager(fakeSampleLogins);
function freshEngineSync(cb) {
let engine = new PasswordEngine();
engine.sync(cb);
};
syncTesting.doSync("initial sync");
syncTesting.runAsyncFunc("initial sync", freshEngineSync);
syncTesting.runAsyncFunc("trivial re-sync", freshEngineSync);
syncTesting.doSync("trivial re-sync");
fakeLoginManager.fakeLogins.push(
{hostname: "www.yoogle.com",
@ -29,14 +25,13 @@ function run_test() {
passwordField: "test_password2"}
);
syncTesting.runAsyncFunc("add user and re-sync", freshEngineSync);
syncTesting.doSync("add user and re-sync");
fakeLoginManager.fakeLogins.pop();
syncTesting.runAsyncFunc("remove user and re-sync", freshEngineSync);
syncTesting.doSync("remove user and re-sync");
syncTesting.fakeFilesystem.fakeContents = {};
fakeLoginManager.fakeLogins = [];
syncTesting.resetClientState();
syncTesting.runAsyncFunc("resync on second computer", freshEngineSync);
syncTesting.doSync("resync on second computer");
}

View File

@ -3,7 +3,7 @@ Testing INFO -----------------------------------------
Testing INFO Step 'initial sync' starting.
Testing INFO -----------------------------------------
Service.PasswordEngine INFO Beginning sync
Testing INFO HTTP MKCOL on user-data/passwords/
Testing INFO HTTP MKCOL on user-data/passwords/deltas
Service.RemoteStore DEBUG Downloading status file
Testing INFO HTTP GET from user-data/passwords/status.json, returning status 404
Service.PasswordEngine INFO Initial upload to server
@ -16,11 +16,6 @@ Service.Crypto DEBUG NOT encrypting data
Testing INFO HTTP PUT to user-data/passwords/snapshot.json with data: {"805ec58eb8dcded602999967e139be21acd0f194":{"hostname":"www.boogle.com","formSubmitURL":"http://www.boogle.com/search","httpRealm":"","username":"","password":"","usernameField":"test_person","passwordField":"test_password"}}
Service.Resource DEBUG PUT request successful
Service.JsonFilter DEBUG Encoding data as JSON
Service.CryptoFilter DEBUG Encrypting data
Service.Crypto DEBUG NOT encrypting data
Testing INFO HTTP PUT to user-data/passwords/deltas.json with data: []
Service.Resource DEBUG PUT request successful
Service.JsonFilter DEBUG Encoding data as JSON
Testing INFO HTTP PUT to user-data/passwords/status.json with data: {"GUID":"fake-guid-0","formatVersion":2,"snapVersion":0,"maxVersion":0,"snapEncryption":"none","deltasEncryption":"none","itemCount":1}
Service.Resource DEBUG PUT request successful
Service.RemoteStore INFO Full upload to server successful
@ -35,7 +30,7 @@ Testing INFO Opening 'weave/snapshots/passwords.json' for reading.
Testing INFO Reading from stream.
Service.SnapStore INFO Read saved snapshot from disk
Service.PasswordEngine INFO Beginning sync
Testing INFO HTTP MKCOL on user-data/passwords/
Testing INFO HTTP MKCOL on user-data/passwords/deltas
Service.RemoteStore DEBUG Downloading status file
Testing INFO HTTP GET from user-data/passwords/status.json, returning status 200
Service.Resource DEBUG GET request successful
@ -54,7 +49,7 @@ Testing INFO Opening 'weave/snapshots/passwords.json' for reading.
Testing INFO Reading from stream.
Service.SnapStore INFO Read saved snapshot from disk
Service.PasswordEngine INFO Beginning sync
Testing INFO HTTP MKCOL on user-data/passwords/
Testing INFO HTTP MKCOL on user-data/passwords/deltas
Service.RemoteStore DEBUG Downloading status file
Testing INFO HTTP GET from user-data/passwords/status.json, returning status 200
Service.Resource DEBUG GET request successful
@ -73,16 +68,11 @@ Service.PasswordEngine INFO Server conflicts: 0
Service.PasswordEngine INFO Actual changes for server: 1
Service.PasswordEngine DEBUG Actual changes for server: [{"action":"create","GUID":"1b3869fc36234b39cd354f661ed1d7d148394ca3","depth":0,"parents":[],"data":{"hostname":"www.yoogle.com","formSubmitURL":"http://www.yoogle.com/search","httpRealm":"","username":"","password":"","usernameField":"test_person2","passwordField":"test_password2"}}]
Service.PasswordEngine INFO Uploading changes to server
Testing INFO HTTP GET from user-data/passwords/deltas.json, returning status 200
Service.Resource DEBUG GET request successful
Service.CryptoFilter DEBUG Decrypting data
Service.Crypto DEBUG NOT decrypting data
Service.JsonFilter DEBUG Decoding JSON data
Service.JsonFilter DEBUG Encoding data as JSON
Service.CryptoFilter DEBUG Encrypting data
Service.Crypto DEBUG NOT encrypting data
Testing INFO HTTP PUT to user-data/passwords/deltas.json with data: [[{"action":"create","GUID":"1b3869fc36234b39cd354f661ed1d7d148394ca3","depth":0,"parents":[],"data":{"hostname":"www.yoogle.com","formSubmitURL":"http://www.yoogle.com/search","httpRealm":"","username":"","password":"","usernameField":"test_person2","passwordField":"test_password2"}}]]
Service.Resource DEBUG PUT request successful
Testing INFO HTTP PUT to user-data/passwords/deltas/1 with data: [{"action":"create","GUID":"1b3869fc36234b39cd354f661ed1d7d148394ca3","depth":0,"parents":[],"data":{"hostname":"www.yoogle.com","formSubmitURL":"http://www.yoogle.com/search","httpRealm":"","username":"","password":"","usernameField":"test_person2","passwordField":"test_password2"}}]
Service.ResourceSet DEBUG PUT request successful
Service.JsonFilter DEBUG Encoding data as JSON
Testing INFO HTTP PUT to user-data/passwords/status.json with data: {"GUID":"fake-guid-0","formatVersion":2,"snapVersion":0,"maxVersion":1,"snapEncryption":"none","deltasEncryption":"none","itemCount":2}
Service.Resource DEBUG PUT request successful
@ -99,7 +89,7 @@ Testing INFO Opening 'weave/snapshots/passwords.json' for reading.
Testing INFO Reading from stream.
Service.SnapStore INFO Read saved snapshot from disk
Service.PasswordEngine INFO Beginning sync
Testing INFO HTTP MKCOL on user-data/passwords/
Testing INFO HTTP MKCOL on user-data/passwords/deltas
Service.RemoteStore DEBUG Downloading status file
Testing INFO HTTP GET from user-data/passwords/status.json, returning status 200
Service.Resource DEBUG GET request successful
@ -118,16 +108,11 @@ Service.PasswordEngine INFO Server conflicts: 0
Service.PasswordEngine INFO Actual changes for server: 1
Service.PasswordEngine DEBUG Actual changes for server: [{"action":"remove","GUID":"1b3869fc36234b39cd354f661ed1d7d148394ca3","depth":0,"parents":[]}]
Service.PasswordEngine INFO Uploading changes to server
Testing INFO HTTP GET from user-data/passwords/deltas.json, returning status 200
Service.Resource DEBUG GET request successful
Service.CryptoFilter DEBUG Decrypting data
Service.Crypto DEBUG NOT decrypting data
Service.JsonFilter DEBUG Decoding JSON data
Service.JsonFilter DEBUG Encoding data as JSON
Service.CryptoFilter DEBUG Encrypting data
Service.Crypto DEBUG NOT encrypting data
Testing INFO HTTP PUT to user-data/passwords/deltas.json with data: [[{"action":"create","GUID":"1b3869fc36234b39cd354f661ed1d7d148394ca3","depth":0,"parents":[],"data":{"hostname":"www.yoogle.com","formSubmitURL":"http://www.yoogle.com/search","httpRealm":"","username":"","password":"","usernameField":"test_person2","passwordField":"test_password2"}}],[{"action":"remove","GUID":"1b3869fc36234b39cd354f661ed1d7d148394ca3","depth":0,"parents":[]}]]
Service.Resource DEBUG PUT request successful
Testing INFO HTTP PUT to user-data/passwords/deltas/2 with data: [{"action":"remove","GUID":"1b3869fc36234b39cd354f661ed1d7d148394ca3","depth":0,"parents":[]}]
Service.ResourceSet DEBUG PUT request successful
Service.JsonFilter DEBUG Encoding data as JSON
Testing INFO HTTP PUT to user-data/passwords/status.json with data: {"GUID":"fake-guid-0","formatVersion":2,"snapVersion":0,"maxVersion":2,"snapEncryption":"none","deltasEncryption":"none","itemCount":1}
Service.Resource DEBUG PUT request successful
@ -141,7 +126,7 @@ Testing INFO -----------------------------------------
Testing INFO Step 'resync on second computer' starting.
Testing INFO -----------------------------------------
Service.PasswordEngine INFO Beginning sync
Testing INFO HTTP MKCOL on user-data/passwords/
Testing INFO HTTP MKCOL on user-data/passwords/deltas
Service.RemoteStore DEBUG Downloading status file
Testing INFO HTTP GET from user-data/passwords/status.json, returning status 200
Service.Resource DEBUG GET request successful
@ -152,19 +137,22 @@ Service.PasswordEngine INFO Local snapshot version: -1
Service.PasswordEngine INFO Server maxVersion: 2
Service.RemoteStore TRACE Getting latest from snap --> scratch
Service.RemoteStore INFO Downloading all server data from scratch
Service.RemoteStore DEBUG Downloading server snapshot
Testing INFO HTTP GET from user-data/passwords/snapshot.json, returning status 200
Service.Resource DEBUG GET request successful
Service.CryptoFilter DEBUG Decrypting data
Service.Crypto DEBUG NOT decrypting data
Service.JsonFilter DEBUG Decoding JSON data
Service.RemoteStore DEBUG Downloading server deltas
Testing INFO HTTP GET from user-data/passwords/deltas.json, returning status 200
Service.Resource DEBUG GET request successful
Testing INFO HTTP GET from user-data/passwords/deltas/1, returning status 200
Service.ResourceSet DEBUG GET request successful
Service.CryptoFilter DEBUG Decrypting data
Service.Crypto DEBUG NOT decrypting data
Service.JsonFilter DEBUG Decoding JSON data
Service.SnapStore TRACE Processing command: {"action":"create","GUID":"1b3869fc36234b39cd354f661ed1d7d148394ca3","depth":0,"parents":[],"data":{"hostname":"www.yoogle.com","formSubmitURL":"http://www.yoogle.com/search","httpRealm":"","username":"","password":"","usernameField":"test_person2","passwordField":"test_password2"}}
Testing INFO HTTP GET from user-data/passwords/deltas/2, returning status 200
Service.ResourceSet DEBUG GET request successful
Service.CryptoFilter DEBUG Decrypting data
Service.Crypto DEBUG NOT decrypting data
Service.JsonFilter DEBUG Decoding JSON data
Service.SnapStore TRACE Processing command: {"action":"remove","GUID":"1b3869fc36234b39cd354f661ed1d7d148394ca3","depth":0,"parents":[]}
Service.PasswordEngine INFO Reconciling client/server updates
Service.PasswordSync DEBUG Reconciling 0 against 1 commands