Page MenuHomePhabricator

[identity] more helpers for identity service
ClosedPublic

Authored by varun on Aug 8 2023, 12:12 PM.
Tags
None
Referenced Files
Unknown Object (File)
Thu, May 2, 5:45 PM
Unknown Object (File)
Wed, May 1, 10:30 PM
Unknown Object (File)
Tue, Apr 16, 3:40 AM
Unknown Object (File)
Tue, Apr 16, 3:24 AM
Unknown Object (File)
Mon, Apr 15, 3:35 AM
Unknown Object (File)
Sat, Apr 13, 8:31 AM
Unknown Object (File)
Sat, Apr 13, 3:36 AM
Unknown Object (File)
Fri, Apr 12, 12:30 PM
Subscribers

Details

Summary

From the device_info HashMap, we need to construct an InboundKeyInfo struct. These are some helper functions to do that.

Depends on D8761

Test Plan

Tested in subsequent diff when we actually call the helpers

Diff Detail

Repository
rCOMM Comm
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

varun requested review of this revision.Aug 8 2023, 12:47 PM
jon requested changes to this revision.Aug 9 2023, 5:36 PM
jon added inline comments.
services/identity/src/client_service.rs
897–901 ↗(On Diff #29652)

This file is already ~1000 lines long. Do you mind if we have a grpc_utils.rs, which contains all these "marshaling to types" helpers?

Also, we might be able to do impl TryFrom<HashMap<String, String>> for InboundKeyInfo, which would just make the call into:

let inbound_key_info = InboundKeyInfo::try_from(query)?;
931–934 ↗(On Diff #29652)

In D8607 I added something similar

This revision now requires changes to proceed.Aug 9 2023, 5:36 PM
varun added inline comments.
services/identity/src/client_service.rs
931–934 ↗(On Diff #29652)

I couldn't find the method you added...

services/identity/src/grpc_utils.rs
26 ↗(On Diff #30059)

this should just be impl actually, not impl<'a>. I have fixed it in the subsequent diff

jon added inline comments.
services/identity/src/client_service.rs
931–934 ↗(On Diff #29652)

It was implemented in D8721

This revision is now accepted and ready to land.Aug 18 2023, 1:32 PM
services/identity/src/client_service.rs
931–934 ↗(On Diff #29652)

the trait implementation is HashMap<String, AttributeValue> but the type I'm dealing with here is HashMap<String, String>