[services] Tunnelbroker - Add secrets handling for notifications in config file
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:
- Successfully built the service.
- 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);
- App start fails with the appropriate error when some of the required parameters are not existent in the config file.
Reviewers: jon, karol, tomek
Reviewed By: karol, tomek
Subscribers: ashoat, tomek, atul, karol, abosh
Differential Revision: https://phab.comm.dev/D5065