Page MenuHomePhabricator

[services] Tunnelbroker - Add secrets handling for notifications in config file
ClosedPublic

Authored by max on Sep 6 2022, 5:50 AM.
Tags
None
Referenced Files
F2905049: D5065.id16581.diff
Sun, Oct 6, 3:08 AM
F2905048: D5065.id16495.diff
Sun, Oct 6, 3:08 AM
F2905047: D5065.id16364.diff
Sun, Oct 6, 3:08 AM
F2905044: D5065.id.diff
Sun, Oct 6, 3:08 AM
F2904976: D5065.diff
Sun, Oct 6, 3:07 AM
Unknown Object (File)
Tue, Sep 17, 11:52 AM
Unknown Object (File)
Sat, Sep 14, 8:51 PM
Unknown Object (File)
Sat, Sep 7, 3:13 AM

Details

Summary

This diff introduces changes to the Tunnelbroker's Config manager to add handling of notifications secrets to the config file.

At the moment we already have some secrets for Tunnelbroker which are handled by the config file. For example AMQP server credentials. Seems that it's a good way to store the secrets for notifications services in the config file as well.

We need to store the following secret data for the notifications services:

Apple APNS:

  • P12 certificate path;
  • P12 certificate password;
  • APNs topic.

Android FCM:

  • Server Key.

The config file notifications fields will be as required and must be provided for the app to start.

Following the current convention for the config file it will look like the below:

[notifications]
apns_cert_path = "~/cert.p12"
apns_cert_password = "cert_password"
apns_topic = "comm.somebundle.name"
fcm_server_key = "AAAA:AAAA....BBBB"

Related Linear task: ENG-1739

Test Plan
  1. Successfully built the service.
  2. Successfully get the config parameters values by calling:
const std::string cert_path =
      config::ConfigManager::getInstance().getParameter(
          config::ConfigManager::OPTION_NOTIFS_APNS_P12_CERT_PATH);
const std::string cert_password =
      config::ConfigManager::getInstance().getParameter(
          config::ConfigManager::OPTION_NOTIFS_APNS_P12_CERT_PASSWORD);
const std::string fcm_server_key =
      config::ConfigManager::getInstance().getParameter(
          config::ConfigManager::OPTION_NOTIFS_FCM_SERVER_KEY);
  1. App start fails with the appropriate error when some of the required parameters are not existent in the config file.

Diff Detail

Repository
rCOMM Comm
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

max held this revision as a draft.
max published this revision for review.Sep 6 2022, 6:05 AM
max edited the summary of this revision. (Show Details)
max edited the test plan for this revision. (Show Details)
max added reviewers: karol, tomek.
max edited the summary of this revision. (Show Details)

Adding topic for APNS configuration, because it's mandatory in production mode.

This revision is now accepted and ready to land.Sep 12 2022, 5:40 AM