Page MenuHomePhabricator

[identity] getInboundKeysForUser RPC implementation
ClosedPublic

Authored by varun on Aug 17 2023, 9:48 PM.
Tags
None
Referenced Files
Unknown Object (File)
Fri, Nov 22, 6:21 AM
Unknown Object (File)
Fri, Nov 22, 5:51 AM
Unknown Object (File)
Sun, Nov 3, 9:03 PM
Unknown Object (File)
Sun, Oct 27, 3:18 AM
Unknown Object (File)
Sun, Oct 27, 3:18 AM
Unknown Object (File)
Sun, Oct 27, 3:18 AM
Unknown Object (File)
Sun, Oct 27, 3:18 AM
Unknown Object (File)
Sun, Oct 27, 3:17 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