Page MenuHomePhabricator

[identity] getInboundKeysForUser RPC implementation
ClosedPublic

Authored by varun on Aug 17 2023, 9:48 PM.
Tags
None
Referenced Files
F1698739: D8863.diff
Sat, May 4, 3:25 AM
Unknown Object (File)
Thu, May 2, 3:11 PM
Unknown Object (File)
Wed, May 1, 2:00 PM
Unknown Object (File)
Tue, Apr 16, 6:01 PM
Unknown Object (File)
Tue, Apr 16, 3:21 AM
Unknown Object (File)
Mon, Apr 15, 9:18 PM
Unknown Object (File)
Mon, Apr 15, 8:44 PM
Unknown Object (File)
Mon, Apr 15, 12:13 AM
Subscribers

Details

Summary

use previously implemented helpers to implement the actual RPC method

Note that this intentionally does not include one-time keys (not required for inbound, only outbound).

Depends on D8765

Test Plan

called the RPC for an existing user in my local DDB table and got back required keys.

Diff Detail

Repository
rCOMM Comm
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

jon added inline comments.
services/identity/src/client_service.rs
826–834 ↗(On Diff #30060)

We should probably do something like .filter_map (|r| r.map_err(|e| error!("{}", e)).ok()).collect() to just collect the valid results.

As written, I think if any of the InboundKeyInfo::try_from calls fail, it will make the entire query fail.

https://doc.rust-lang.org/rust-by-example/error/iter_result.html#fail-the-entire-operation-with-collect

This revision now requires changes to proceed.Aug 18 2023, 12:58 PM

move InboundKeyInfo import

jon added inline comments.
services/identity/src/client_service.rs
828–836 ↗(On Diff #30159)

I think we want filter_map to remove all the Err's, and so we would only get back a HashMap.

Would need to do some testing to verify though.

If this doesn't yield results, I would just continue as-is.

This revision is now accepted and ready to land.Aug 23 2023, 9:03 AM
services/identity/src/client_service.rs
828–836 ↗(On Diff #30159)

kept the match statement but addressed your overall point about filtering out the Errs