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, Nov 23, 11:46 PM
Unknown Object (File)
Sat, Nov 23, 11:45 PM
Unknown Object (File)
Thu, Nov 21, 11:28 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:17 AM
Unknown Object (File)
Sun, Oct 27, 3:07 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
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>