Page MenuHomePhabricator

D13223.id43985.diff
No OneTemporary

D13223.id43985.diff

diff --git a/services/identity/src/device_list.rs b/services/identity/src/device_list.rs
--- a/services/identity/src/device_list.rs
+++ b/services/identity/src/device_list.rs
@@ -95,19 +95,19 @@
impl TryFrom<UpdateDeviceListRequest> for SignedDeviceList {
type Error = tonic::Status;
fn try_from(request: UpdateDeviceListRequest) -> Result<Self, Self::Error> {
- request.new_device_list.parse().map_err(|err| {
- warn!("Failed to deserialize device list update: {}", err);
- tonic::Status::invalid_argument(
- tonic_status_messages::INVALID_DEVICE_LIST_PAYLOAD,
- )
- })
+ request.new_device_list.parse()
}
}
impl FromStr for SignedDeviceList {
- type Err = serde_json::Error;
+ type Err = tonic::Status;
fn from_str(s: &str) -> Result<Self, Self::Err> {
- serde_json::from_str(s)
+ serde_json::from_str(s).map_err(|err| {
+ warn!("Failed to deserialize device list: {}", err);
+ tonic::Status::invalid_argument(
+ tonic_status_messages::INVALID_DEVICE_LIST_PAYLOAD,
+ )
+ })
}
}
diff --git a/services/identity/src/grpc_services/authenticated.rs b/services/identity/src/grpc_services/authenticated.rs
--- a/services/identity/src/grpc_services/authenticated.rs
+++ b/services/identity/src/grpc_services/authenticated.rs
@@ -464,12 +464,7 @@
// Get and verify singleton device list
let parsed_device_list: SignedDeviceList =
- message.signed_device_list.parse().map_err(|err| {
- warn!("Failed to deserialize device list: {}", err);
- tonic::Status::invalid_argument(
- tonic_status_messages::INVALID_DEVICE_LIST_PAYLOAD,
- )
- })?;
+ message.signed_device_list.parse()?;
let update_payload = DeviceListUpdate::try_from(parsed_device_list)?;
crate::device_list::verify_singleton_device_list(

File Metadata

Mime Type
text/plain
Expires
Sat, Nov 23, 10:26 AM (19 h, 28 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2569123
Default Alt Text
D13223.id43985.diff (1 KB)

Event Timeline