Page MenuHomePhabricator

D5570.diff
No OneTemporary

D5570.diff

diff --git a/services/identity/src/service.rs b/services/identity/src/service.rs
--- a/services/identity/src/service.rs
+++ b/services/identity/src/service.rs
@@ -383,7 +383,18 @@
&self,
request: Request<GetUserPublicKeyRequest>,
) -> Result<Response<GetUserPublicKeyResponse>, Status> {
- unimplemented!()
+ let message = request.into_inner();
+ let public_key = match self
+ .client
+ .get_user_public_key(message.user_id, message.device_id)
+ .await
+ {
+ Ok(Some(public_key)) => public_key,
+ Ok(None) => return Err(Status::not_found("no public key found")),
+ Err(e) => return Err(handle_db_error(e)),
+ };
+ let response = Response::new(GetUserPublicKeyResponse { public_key });
+ Ok(response)
}
}

File Metadata

Mime Type
text/plain
Expires
Sun, Dec 22, 9:12 PM (17 h, 23 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2692662
Default Alt Text
D5570.diff (775 B)

Event Timeline