Page MenuHomePhabricator

[Identity] Add config for Identity service
ClosedPublic

Authored by varun on Apr 21 2022, 12:07 PM.
Tags
None
Referenced Files
F1990804: D3812.id.diff
Tue, Jun 11, 7:24 AM
F1990030: D3812.id12142.diff
Tue, Jun 11, 5:41 AM
Unknown Object (File)
Mon, Jun 10, 5:45 AM
Unknown Object (File)
Sat, Jun 8, 7:28 AM
Unknown Object (File)
Wed, May 29, 6:14 PM
Unknown Object (File)
Wed, May 29, 6:14 PM
Unknown Object (File)
Wed, May 29, 6:14 PM
Unknown Object (File)
Wed, May 29, 6:14 PM

Details

Summary

Depends on D3799

In order to implement PAKE registration/login in the Identity service, we need to persist a secret key and then share that key with the gRPC methods that use it. In this diff I have created a config module to load the key from a file into memory and then shared the key with the gRPC methods by adding a Config struct to MyIdentityService.

Test Plan

Ran the service and tested that the relevant Config was available in MyIdentityService

Diff Detail

Repository
rCOMM Comm
Branch
varun/identity_service (branched from master)
Lint
No Lint Coverage
Unit
No Test Coverage

Event Timeline

Harbormaster returned this revision to the author for changes because remote builds failed.Apr 21 2022, 12:10 PM
Harbormaster failed remote builds in B8426: Diff 11758!

trigger new build after rebase

jim requested changes to this revision.Apr 26 2022, 9:57 AM
jim added inline comments.
services/identity/src/config.rs
22

This isn't a great way to do error handling -- you're throwing away the type information...

I would make a wrapper enum with derive_more.

#[derive(Debug, derive_more::Display, derive_more::From, derive_more::Error)]
pub enum Error {
  #[display(...)]
  Pake(PakeError),
  #[display(...)]
  IO(io::Error),
}
services/identity/src/main.rs
11

Load the config first then, MyIdentityService::new(config)

15

Why expect? You can just return an err.

This revision now requires changes to proceed.Apr 26 2022, 9:57 AM
This revision is now accepted and ready to land.May 4 2022, 10:18 AM
This revision was automatically updated to reflect the committed changes.