Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F3531158
D4099.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Referenced Files
None
Subscribers
None
D4099.diff
View Options
diff --git a/native/cpp/CommonCpp/grpc/protos/backup.proto b/native/cpp/CommonCpp/grpc/protos/backup.proto
--- a/native/cpp/CommonCpp/grpc/protos/backup.proto
+++ b/native/cpp/CommonCpp/grpc/protos/backup.proto
@@ -30,9 +30,10 @@
message CreateNewBackupRequest {
oneof data {
string userID = 1;
- bytes keyEntropy = 2;
- bytes newCompactionHash = 3;
- bytes newCompactionChunk = 4;
+ string deviceID = 2;
+ bytes keyEntropy = 3;
+ bytes newCompactionHash = 4;
+ bytes newCompactionChunk = 5;
}
}
diff --git a/services/backup/src/Reactors/server/CreateNewBackupReactor.h b/services/backup/src/Reactors/server/CreateNewBackupReactor.h
--- a/services/backup/src/Reactors/server/CreateNewBackupReactor.h
+++ b/services/backup/src/Reactors/server/CreateNewBackupReactor.h
@@ -21,13 +21,15 @@
backup::CreateNewBackupResponse> {
enum class State {
USER_ID = 1,
- KEY_ENTROPY = 2,
- DATA_HASH = 3,
- DATA_CHUNKS = 4,
+ DEVICE_ID = 2,
+ KEY_ENTROPY = 3,
+ DATA_HASH = 4,
+ DATA_CHUNKS = 5,
};
State state = State::USER_ID;
std::string userID;
+ std::string deviceID;
std::string keyEntropy;
std::string dataHash;
std::string holder;
diff --git a/services/backup/src/Reactors/server/CreateNewBackupReactor.cpp b/services/backup/src/Reactors/server/CreateNewBackupReactor.cpp
--- a/services/backup/src/Reactors/server/CreateNewBackupReactor.cpp
+++ b/services/backup/src/Reactors/server/CreateNewBackupReactor.cpp
@@ -25,6 +25,14 @@
throw std::runtime_error("user id expected but not received");
}
this->userID = request.userid();
+ this->state = State::DEVICE_ID;
+ return nullptr;
+ }
+ case State::DEVICE_ID: {
+ if (!request.has_deviceid()) {
+ throw std::runtime_error("device id expected but not received");
+ }
+ this->deviceID = request.deviceid();
this->state = State::KEY_ENTROPY;
return nullptr;
}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Thu, Dec 26, 6:26 AM (12 h, 32 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2704068
Default Alt Text
D4099.diff (1 KB)
Attached To
Mode
D4099: [services] Backup - receive device id when creating new backup
Attached
Detach File
Event Timeline
Log In to Comment