summaryrefslogtreecommitdiffstats
path: root/sync/protocol
diff options
context:
space:
mode:
authorzea@chromium.org <zea@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-07-31 19:44:25 +0000
committerzea@chromium.org <zea@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-07-31 19:44:25 +0000
commit310512cc361ab20d11a236095664fafae2250fac (patch)
treece779afc56fb845f043ea7f54e905c7ff4d8d697 /sync/protocol
parent126f1d652abfd11204fb7b4aed48dcb9999903d9 (diff)
downloadchromium_src-310512cc361ab20d11a236095664fafae2250fac.zip
chromium_src-310512cc361ab20d11a236095664fafae2250fac.tar.gz
chromium_src-310512cc361ab20d11a236095664fafae2250fac.tar.bz2
[Sync] Add support for performing a GetKey on startup.
The functionality is behind the --sync-keystore-encryption flag, and the key is not currently consumed by anything, but this lays the groundwork for testing the server and client interaction. We request a key anytime we perform a GetUpdates while the cryptographer does not have a keystore key. But, it is considered an error to request a key and not receive one, putting us into a state of backoff. BUG=129665 TEST=sync_unit_tests, running against python server Review URL: https://chromiumcodereview.appspot.com/10455012 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@149248 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'sync/protocol')
-rw-r--r--sync/protocol/sync.proto49
1 files changed, 30 insertions, 19 deletions
diff --git a/sync/protocol/sync.proto b/sync/protocol/sync.proto
index ec9a1d2..8f44823 100644
--- a/sync/protocol/sync.proto
+++ b/sync/protocol/sync.proto
@@ -446,6 +446,14 @@ message GetUpdatesMessage {
// delimited by a length prefix, which is encoded as a varint.
optional bool streaming = 7 [default = false];
+ // Whether the client needs the server to provide an encryption key for this
+ // account.
+ // Note: this should typically only be set on the first GetUpdates a client
+ // requests. Clients are expected to persist the encryption key from then on.
+ // The allowed frequency for requesting encryption keys is much lower than
+ // other datatypes, so repeated usage will likely result in throttling.
+ optional bool need_encryption_key = 8 [default = false];
+
// Whether to create the mobile bookmarks folder if it's not
// already created. Should be set to true only by mobile clients.
optional bool create_mobile_bookmarks_folder = 1000 [default = false];
@@ -572,6 +580,10 @@ message GetUpdatesResponse {
// Progress markers in the context of a response will never have the
// |timestamp_token_for_migration| field set.
repeated DataTypeProgressMarker new_progress_marker = 5;
+
+ // The current encryption key associated with this account. Only set if the
+ // GetUpdatesMessage in the request had need_encryption_key == true.
+ optional bytes encryption_key = 6;
};
// The metadata response for GetUpdatesMessage. This response is sent when
@@ -625,25 +637,6 @@ message ClientToServerResponse {
optional CommitResponse commit = 1;
optional GetUpdatesResponse get_updates = 2;
optional AuthenticateResponse authenticate = 3;
- // DEPRECATED - this field was never used in production.
- // optional ClearUserDataResponse clear_user_data = 9;
- optional GetUpdatesMetadataResponse stream_metadata = 10;
- // If GetUpdatesStreamingResponse is contained in the ClientToServerResponse,
- // none of the other fields (error_code and etc) will be set.
- optional GetUpdatesStreamingResponse stream_data = 11;
-
- message Error {
- optional SyncEnums.ErrorType error_type = 1 [default = UNKNOWN];
- optional string error_description = 2;
- optional string url = 3;
- optional SyncEnums.Action action = 4 [default = UNKNOWN_ACTION];
-
- // Currently only meaningful if |error_type| is throttled. If this field
- // is absent then the whole client (all datatypes) is throttled.
- repeated int32 error_data_type_ids = 5;
- }
-
- optional Error error = 13;
// Up until protocol_version 24, the default was SUCCESS which made it
// impossible to add new enum values since older clients would parse any
@@ -663,9 +656,27 @@ message ClientToServerResponse {
optional ClientCommand client_command = 7;
optional ProfilingData profiling_data = 8;
+ // DEPRECATED - this field was never used in production.
+ // optional ClearUserDataResponse clear_user_data = 9;
+ optional GetUpdatesMetadataResponse stream_metadata = 10;
+ // If GetUpdatesStreamingResponse is contained in the ClientToServerResponse,
+ // none of the other fields (error_code and etc) will be set.
+ optional GetUpdatesStreamingResponse stream_data = 11;
// The data types whose storage has been migrated. Present when the value of
// error_code is MIGRATION_DONE.
repeated int32 migrated_data_type_id = 12;
+
+ message Error {
+ optional SyncEnums.ErrorType error_type = 1 [default = UNKNOWN];
+ optional string error_description = 2;
+ optional string url = 3;
+ optional SyncEnums.Action action = 4 [default = UNKNOWN_ACTION];
+
+ // Currently only meaningful if |error_type| is throttled. If this field
+ // is absent then the whole client (all datatypes) is throttled.
+ repeated int32 error_data_type_ids = 5;
+ }
+ optional Error error = 13;
};