2011-01-31 23:19:04 -08:00
|
|
|
#filter substitution
|
2012-05-21 04:12:37 -07:00
|
|
|
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
2007-12-10 21:38:53 -08:00
|
|
|
|
2009-09-15 19:07:23 -07:00
|
|
|
// Process each item in the "constants hash" to add to "global" and give a name
|
2012-11-26 08:54:17 -08:00
|
|
|
this.EXPORTED_SYMBOLS = [((this[key] = val), key) for ([key, val] in Iterator({
|
2007-12-10 21:38:53 -08:00
|
|
|
|
2009-09-15 19:07:23 -07:00
|
|
|
WEAVE_VERSION: "@weave_version@",
|
2009-02-11 23:52:44 -08:00
|
|
|
|
2011-04-08 14:52:08 -07:00
|
|
|
// Sync Server API version that the client supports.
|
|
|
|
SYNC_API_VERSION: "1.1",
|
|
|
|
USER_API_VERSION: "1.0",
|
|
|
|
MISC_API_VERSION: "1.0",
|
|
|
|
|
2010-03-16 16:31:55 -07:00
|
|
|
// Version of the data format this client supports. The data format describes
|
|
|
|
// how records are packaged; this is separate from the Server API version and
|
|
|
|
// the per-engine cleartext formats.
|
2010-12-09 12:14:17 -08:00
|
|
|
STORAGE_VERSION: 5,
|
2010-06-16 14:30:13 -07:00
|
|
|
PREFS_BRANCH: "services.sync.",
|
2007-12-20 14:46:12 -08:00
|
|
|
|
2009-09-03 21:11:32 -07:00
|
|
|
// Host "key" to access Weave Identity in the password manager
|
2009-09-15 19:07:23 -07:00
|
|
|
PWDMGR_HOST: "chrome://weave",
|
2010-06-16 20:12:38 -07:00
|
|
|
PWDMGR_PASSWORD_REALM: "Mozilla Services Password",
|
|
|
|
PWDMGR_PASSPHRASE_REALM: "Mozilla Services Encryption Passphrase",
|
2010-11-29 16:41:17 -08:00
|
|
|
PWDMGR_KEYBUNDLE_REALM: "Mozilla Services Key Bundles",
|
|
|
|
|
|
|
|
// Put in [] because those aren't allowed in a collection name.
|
|
|
|
DEFAULT_KEYBUNDLE_NAME: "[default]",
|
|
|
|
|
|
|
|
// Our extra input to SHA256-HMAC in generateEntry.
|
|
|
|
// This includes the full crypto spec; change this when our algo changes.
|
|
|
|
HMAC_INPUT: "Sync-AES_256_CBC-HMAC256",
|
|
|
|
|
|
|
|
// Key dimensions.
|
|
|
|
SYNC_KEY_ENCODED_LENGTH: 26,
|
|
|
|
SYNC_KEY_DECODED_LENGTH: 16,
|
|
|
|
SYNC_KEY_HYPHENATED_LENGTH: 31, // 26 chars, 5 hyphens.
|
2009-09-03 21:11:32 -07:00
|
|
|
|
2011-06-27 06:22:49 -07:00
|
|
|
NO_SYNC_NODE_INTERVAL: 10 * 60 * 1000, // 10 minutes
|
|
|
|
|
2011-02-03 10:23:39 -08:00
|
|
|
MAX_ERROR_COUNT_BEFORE_BACKOFF: 3,
|
|
|
|
MAX_IGNORE_ERROR_COUNT: 5,
|
|
|
|
|
2011-06-27 06:22:49 -07:00
|
|
|
// Backoff intervals
|
|
|
|
MINIMUM_BACKOFF_INTERVAL: 15 * 60 * 1000, // 15 minutes
|
|
|
|
MAXIMUM_BACKOFF_INTERVAL: 8 * 60 * 60 * 1000, // 8 hours
|
|
|
|
|
2010-12-09 23:06:44 -08:00
|
|
|
// HMAC event handling timeout.
|
|
|
|
// 10 minutes: a compromise between the multi-desktop sync interval
|
|
|
|
// and the mobile sync interval.
|
|
|
|
HMAC_EVENT_INTERVAL: 600000,
|
|
|
|
|
2011-01-10 21:51:29 -08:00
|
|
|
// How long to wait between sync attempts if the Master Password is locked.
|
|
|
|
MASTER_PASSWORD_LOCKED_RETRY_INTERVAL: 15 * 60 * 1000, // 15 minutes
|
|
|
|
|
2011-04-06 17:18:22 -07:00
|
|
|
// Separate from the ID fetch batch size to allow tuning for mobile.
|
2010-11-09 13:51:19 -08:00
|
|
|
MOBILE_BATCH_SIZE: 50,
|
|
|
|
|
2011-04-06 17:18:22 -07:00
|
|
|
// 50 is hardcoded here because of URL length restrictions.
|
|
|
|
// (GUIDs can be up to 64 chars long.)
|
|
|
|
// Individual engines can set different values for their limit if their
|
|
|
|
// identifiers are shorter.
|
|
|
|
DEFAULT_GUID_FETCH_BATCH_SIZE: 50,
|
|
|
|
DEFAULT_MOBILE_GUID_FETCH_BATCH_SIZE: 50,
|
|
|
|
|
2011-01-28 09:39:12 -08:00
|
|
|
// Default batch size for applying incoming records.
|
|
|
|
DEFAULT_STORE_BATCH_SIZE: 1,
|
2011-12-14 17:10:34 -08:00
|
|
|
HISTORY_STORE_BATCH_SIZE: 50, // same as MOBILE_BATCH_SIZE
|
|
|
|
FORMS_STORE_BATCH_SIZE: 50, // same as MOBILE_BATCH_SIZE
|
|
|
|
PASSWORDS_STORE_BATCH_SIZE: 50, // same as MOBILE_BATCH_SIZE
|
|
|
|
ADDONS_STORE_BATCH_SIZE: 1000000, // process all addons at once
|
|
|
|
APPS_STORE_BATCH_SIZE: 50, // same as MOBILE_BATCH_SIZE
|
2011-01-28 09:39:12 -08:00
|
|
|
|
2009-11-09 09:57:58 -08:00
|
|
|
// score thresholds for early syncs
|
2010-01-26 12:08:41 -08:00
|
|
|
SINGLE_USER_THRESHOLD: 1000,
|
2011-06-16 12:12:48 -07:00
|
|
|
MULTI_DEVICE_THRESHOLD: 300,
|
|
|
|
|
|
|
|
// Other score increment constants
|
|
|
|
SCORE_INCREMENT_SMALL: 1,
|
|
|
|
SCORE_INCREMENT_MEDIUM: 10,
|
|
|
|
|
|
|
|
// Instant sync score increment
|
|
|
|
SCORE_INCREMENT_XLARGE: 300 + 1, //MULTI_DEVICE_THRESHOLD + 1
|
2009-11-09 09:57:58 -08:00
|
|
|
|
2011-06-16 12:13:20 -07:00
|
|
|
// Delay before incrementing global score
|
|
|
|
SCORE_UPDATE_DELAY: 100,
|
|
|
|
|
2011-10-04 20:04:13 -07:00
|
|
|
// Delay for the back observer debouncer. This is chosen to be longer than any
|
|
|
|
// observed spurious idle/back events and short enough to pre-empt user activity.
|
|
|
|
IDLE_OBSERVER_BACK_DELAY: 100,
|
|
|
|
|
2009-09-15 19:07:23 -07:00
|
|
|
// Number of records to upload in a single POST (multiple POSTS if exceeded)
|
2010-06-01 15:07:50 -07:00
|
|
|
// FIXME: Record size limit is 256k (new cluster), so this can be quite large!
|
|
|
|
// (Bug 569295)
|
2009-09-15 19:07:23 -07:00
|
|
|
MAX_UPLOAD_RECORDS: 100,
|
2010-12-06 17:25:35 -08:00
|
|
|
MAX_HISTORY_UPLOAD: 5000,
|
|
|
|
MAX_HISTORY_DOWNLOAD: 5000,
|
2009-03-25 23:43:14 -07:00
|
|
|
|
|
|
|
// Top-level statuses:
|
2009-09-15 19:07:23 -07:00
|
|
|
STATUS_OK: "success.status_ok",
|
|
|
|
SYNC_FAILED: "error.sync.failed",
|
|
|
|
LOGIN_FAILED: "error.login.failed",
|
|
|
|
SYNC_FAILED_PARTIAL: "error.sync.failed_partial",
|
2010-04-09 10:20:41 -07:00
|
|
|
CLIENT_NOT_CONFIGURED: "service.client_not_configured",
|
2009-09-15 19:07:23 -07:00
|
|
|
STATUS_DISABLED: "service.disabled",
|
2011-01-10 21:51:29 -08:00
|
|
|
MASTER_PASSWORD_LOCKED: "service.master_password_locked",
|
2009-09-15 18:38:52 -07:00
|
|
|
|
|
|
|
// success states
|
2009-09-15 19:07:23 -07:00
|
|
|
LOGIN_SUCCEEDED: "success.login",
|
|
|
|
SYNC_SUCCEEDED: "success.sync",
|
|
|
|
ENGINE_SUCCEEDED: "success.engine",
|
2009-09-15 18:38:52 -07:00
|
|
|
|
|
|
|
// login failure status codes:
|
2009-09-15 19:07:23 -07:00
|
|
|
LOGIN_FAILED_NO_USERNAME: "error.login.reason.no_username",
|
2011-05-11 17:58:05 -07:00
|
|
|
LOGIN_FAILED_NO_PASSWORD: "error.login.reason.no_password2",
|
2011-08-19 14:35:29 -07:00
|
|
|
LOGIN_FAILED_NO_PASSPHRASE: "error.login.reason.no_recoverykey",
|
2009-09-15 19:07:23 -07:00
|
|
|
LOGIN_FAILED_NETWORK_ERROR: "error.login.reason.network",
|
2009-09-28 16:13:42 -07:00
|
|
|
LOGIN_FAILED_SERVER_ERROR: "error.login.reason.server",
|
2011-08-19 14:35:29 -07:00
|
|
|
LOGIN_FAILED_INVALID_PASSPHRASE: "error.login.reason.recoverykey",
|
2010-09-13 08:17:37 -07:00
|
|
|
LOGIN_FAILED_LOGIN_REJECTED: "error.login.reason.account",
|
2014-01-28 17:51:09 -08:00
|
|
|
LOGIN_FAILED_NOT_READY: "error.login.reason.initializing",
|
2009-09-15 18:38:52 -07:00
|
|
|
|
|
|
|
// sync failure status codes
|
2009-09-15 19:07:23 -07:00
|
|
|
METARECORD_DOWNLOAD_FAIL: "error.sync.reason.metarecord_download_fail",
|
|
|
|
VERSION_OUT_OF_DATE: "error.sync.reason.version_out_of_date",
|
|
|
|
DESKTOP_VERSION_OUT_OF_DATE: "error.sync.reason.desktop_version_out_of_date",
|
|
|
|
SETUP_FAILED_NO_PASSPHRASE: "error.sync.reason.setup_failed_no_passphrase",
|
2010-03-31 18:58:07 -07:00
|
|
|
CREDENTIALS_CHANGED: "error.sync.reason.credentials_changed",
|
2009-11-12 12:44:33 -08:00
|
|
|
ABORT_SYNC_COMMAND: "aborting sync, process commands said so",
|
2009-09-29 18:33:41 -07:00
|
|
|
NO_SYNC_NODE_FOUND: "error.sync.reason.no_node_found",
|
2010-09-11 09:39:21 -07:00
|
|
|
OVER_QUOTA: "error.sync.reason.over_quota",
|
2011-08-26 14:01:35 -07:00
|
|
|
PROLONGED_SYNC_FAILURE: "error.sync.prolonged_failure",
|
2011-12-08 13:54:42 -08:00
|
|
|
SERVER_MAINTENANCE: "error.sync.reason.serverMaintenance",
|
2010-09-11 09:39:21 -07:00
|
|
|
|
|
|
|
RESPONSE_OVER_QUOTA: "14",
|
2009-09-15 18:38:52 -07:00
|
|
|
|
|
|
|
// engine failure status codes
|
2009-09-15 19:07:23 -07:00
|
|
|
ENGINE_UPLOAD_FAIL: "error.engine.reason.record_upload_fail",
|
|
|
|
ENGINE_DOWNLOAD_FAIL: "error.engine.reason.record_download_fail",
|
|
|
|
ENGINE_UNKNOWN_FAIL: "error.engine.reason.unknown_fail",
|
2011-01-28 09:39:12 -08:00
|
|
|
ENGINE_APPLY_FAIL: "error.engine.reason.apply_fail",
|
2010-06-14 15:16:53 -07:00
|
|
|
ENGINE_METARECORD_DOWNLOAD_FAIL: "error.engine.reason.metarecord_download_fail",
|
2009-09-15 19:07:23 -07:00
|
|
|
ENGINE_METARECORD_UPLOAD_FAIL: "error.engine.reason.metarecord_upload_fail",
|
|
|
|
|
2010-12-09 18:12:09 -08:00
|
|
|
JPAKE_ERROR_CHANNEL: "jpake.error.channel",
|
|
|
|
JPAKE_ERROR_NETWORK: "jpake.error.network",
|
|
|
|
JPAKE_ERROR_SERVER: "jpake.error.server",
|
|
|
|
JPAKE_ERROR_TIMEOUT: "jpake.error.timeout",
|
|
|
|
JPAKE_ERROR_INTERNAL: "jpake.error.internal",
|
|
|
|
JPAKE_ERROR_INVALID: "jpake.error.invalid",
|
|
|
|
JPAKE_ERROR_NODATA: "jpake.error.nodata",
|
|
|
|
JPAKE_ERROR_KEYMISMATCH: "jpake.error.keymismatch",
|
|
|
|
JPAKE_ERROR_WRONGMESSAGE: "jpake.error.wrongmessage",
|
2011-04-14 10:49:54 -07:00
|
|
|
JPAKE_ERROR_USERABORT: "jpake.error.userabort",
|
2011-10-02 01:15:39 -07:00
|
|
|
JPAKE_ERROR_DELAYUNSUPPORTED: "jpake.error.delayunsupported",
|
2010-12-09 18:12:09 -08:00
|
|
|
|
2011-07-14 12:11:42 -07:00
|
|
|
// info types for Service.getStorageInfo
|
|
|
|
INFO_COLLECTIONS: "collections",
|
|
|
|
INFO_COLLECTION_USAGE: "collection_usage",
|
|
|
|
INFO_COLLECTION_COUNTS: "collection_counts",
|
|
|
|
INFO_QUOTA: "quota",
|
|
|
|
|
2009-09-15 19:07:23 -07:00
|
|
|
// Ways that a sync can be disabled (messages only to be printed in debug log)
|
2011-01-10 21:51:29 -08:00
|
|
|
kSyncMasterPasswordLocked: "User elected to leave Master Password locked",
|
2009-09-15 19:07:23 -07:00
|
|
|
kSyncWeaveDisabled: "Weave is disabled",
|
|
|
|
kSyncNetworkOffline: "Network is offline",
|
|
|
|
kSyncBackoffNotMet: "Trying to sync before the server said it's okay",
|
2010-04-05 20:53:31 -07:00
|
|
|
kFirstSyncChoiceNotMade: "User has not selected an action for first sync",
|
2009-03-25 23:43:14 -07:00
|
|
|
|
2009-05-18 11:11:07 -07:00
|
|
|
// Application IDs
|
2009-09-15 19:07:23 -07:00
|
|
|
FIREFOX_ID: "{ec8030f7-c20a-464f-9b0e-13a3a9e97384}",
|
|
|
|
FENNEC_ID: "{a23983c0-fd0e-11dc-95ff-0800200c9a66}",
|
|
|
|
SEAMONKEY_ID: "{92650c4d-4b8e-4d2a-b7eb-24ecf4f6b63a}",
|
2010-06-04 09:05:55 -07:00
|
|
|
TEST_HARNESS_ID: "xuth@mozilla.org",
|
2009-09-16 13:56:37 -07:00
|
|
|
|
2010-03-31 18:58:07 -07:00
|
|
|
MIN_PP_LENGTH: 12,
|
2012-08-14 11:34:14 -07:00
|
|
|
MIN_PASS_LENGTH: 8,
|
|
|
|
|
|
|
|
LOG_DATE_FORMAT: "%Y-%m-%d %H:%M:%S",
|
2009-09-16 13:45:08 -07:00
|
|
|
|
2009-09-15 19:07:23 -07:00
|
|
|
}))];
|