Page MenuHomePhabricator

[keyserver] set default identity socket addr based on NODE_ENV value
ClosedPublic

Authored by varun on Dec 2 2023, 3:55 PM.
Tags
None
Referenced Files
Unknown Object (File)
Sat, Nov 23, 9:06 AM
Unknown Object (File)
Fri, Nov 8, 4:42 AM
Unknown Object (File)
Oct 27 2024, 8:20 AM
Unknown Object (File)
Oct 22 2024, 3:03 PM
Unknown Object (File)
Oct 22 2024, 3:03 PM
Unknown Object (File)
Oct 22 2024, 3:03 PM
Unknown Object (File)
Sep 27 2024, 6:17 AM
Unknown Object (File)
Aug 31 2024, 8:54 PM
Subscribers

Details

Summary

if NODE_ENV is "development", we try to connect to staging. if it's anything else, we try to connect to the prod identity service.

before landing this, i will let devs know that in order to talk to their local identity service, they'll now need to have a well-formed secrets/identity_service_config.json file or set the equivalent env var

Test Plan

ran yarn dev and connected to the staging instance

Diff Detail

Repository
rCOMM Comm
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

varun requested review of this revision.Dec 2 2023, 4:14 PM

Makes sense to me but I don't know Rust – glad @bartek is a required reviewer

bartek added inline comments.
keyserver/addons/rust-node-addon/src/identity_client/mod.rs
68–73 ↗(On Diff #34165)

are there any good practices on whether consts should be local vs global scope?

This revision is now accepted and ready to land.Dec 3 2023, 10:39 PM
keyserver/addons/rust-node-addon/src/identity_client/mod.rs
68–73 ↗(On Diff #34165)

I think they should be global if they're going to be used in other places. in this case, i suppose the ENV_ consts should be in the global scope, since there's a chance we might use them elsewhere. i don't think we'll use the SOCKET_ADDR consts anywhere else, though