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)
Sun, Nov 10, 6:58 AM
Unknown Object (File)
Oct 6 2024, 10:21 AM
Unknown Object (File)
Oct 6 2024, 3:08 AM
Unknown Object (File)
Oct 6 2024, 3:08 AM
Unknown Object (File)
Oct 6 2024, 3:08 AM
Unknown Object (File)
Oct 6 2024, 3:08 AM
Unknown Object (File)
Oct 6 2024, 3:07 AM
Unknown Object (File)
Sep 17 2024, 11:52 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
Branch
add-notifs-secrets-to-config
Lint
No Lint Coverage
Unit
No Test Coverage

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