Page MenuHomePhabricator

[Tunnelbroker] implement APNs config
ClosedPublic

Authored by kamil on Jun 28 2024, 4:25 AM.
Tags
None
Referenced Files
F3373538: D12609.diff
Tue, Nov 26, 10:15 AM
Unknown Object (File)
Tue, Nov 12, 12:13 PM
Unknown Object (File)
Tue, Nov 12, 11:40 AM
Unknown Object (File)
Tue, Nov 12, 11:30 AM
Unknown Object (File)
Tue, Nov 12, 7:16 AM
Unknown Object (File)
Tue, Nov 12, 2:43 AM
Unknown Object (File)
Oct 14 2024, 8:36 AM
Unknown Object (File)
Oct 14 2024, 7:12 AM
Subscribers

Details

Summary

Config to APNs similar to keyserver, but instead of reading private key from the file we pass it inside JSON (command line or AWS KMS secrets).

Keyserver config: link.

Depends on D12608

Test Plan
  1. Add config var from commandline and log it
  2. For staging (using env::var) going to test after deploying

Diff Detail

Repository
rCOMM Comm
Branch
apns-tb
Lint
No Lint Coverage
Unit
No Test Coverage

Event Timeline

kamil held this revision as a draft.
kamil published this revision for review.Jun 28 2024, 6:24 AM
kamil edited the summary of this revision. (Show Details)
bartek requested changes to this revision.Jul 1 2024, 1:58 AM

Can we either?:

  • Fully rely on clap parsing the env variable
  • Remove the env support in clap
services/tunnelbroker/src/config.rs
31
  1. This code means you can pass either --apns-config CLI param or env variable named "ENV_APNS_CONFIG".
  2. Separately you have crate::constants::ENV_APNS_CONFIG (which has value "APNS_CONFIG") and you're parsing it below (manually without clap).

If you go with 2 only, you can remove this line

services/tunnelbroker/src/main.rs
36–42

If you rely on clap parsing the env var, this shouldn't be necessary, #[arg(env = ENV_APNS_CONFIG)] should handle it for you

This revision now requires changes to proceed.Jul 1 2024, 1:59 AM

Thanks, @bartek, update to rely on clap.

Tested both:

cargo run -- --apns-config '{"key":"your_key_here","keyId":"your_key_id_here","teamId":"your_team_id_here","production":true}'

and

APNS_CONFIG='{"key":"your_key_here","keyId":"your_key_id_here","teamId":"your_team_id_here","production":true}' cargo run

I'm glad it worked, thanks!

This revision is now accepted and ready to land.Jul 2 2024, 3:36 AM
This revision was automatically updated to reflect the committed changes.