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)
Sat, Dec 14, 10:28 PM
Unknown Object (File)
Sat, Dec 14, 10:28 PM
Unknown Object (File)
Sat, Dec 14, 10:28 PM
Unknown Object (File)
Sat, Dec 14, 10:26 PM
Unknown Object (File)
Sat, Dec 14, 10:08 PM
Unknown Object (File)
Wed, Dec 11, 2:37 AM
Unknown Object (File)
Thu, Dec 5, 7:58 PM
Unknown Object (File)
Sun, Dec 1, 10:29 AM
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
No Lint Coverage
Unit
No Test Coverage

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

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>