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
Unknown Object (File)
Sat, Dec 21, 11:54 AM
Unknown Object (File)
Sat, Dec 21, 11:53 AM
Unknown Object (File)
Fri, Nov 29, 6:17 AM
Unknown Object (File)
Fri, Nov 29, 6:13 AM
Unknown Object (File)
Fri, Nov 29, 4:10 AM
Unknown Object (File)
Nov 25 2024, 5:59 PM
Unknown Object (File)
Nov 10 2024, 6:58 AM
Unknown Object (File)
Oct 6 2024, 10:21 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