Page MenuHomePhabricator

D5641.diff
No OneTemporary

D5641.diff

diff --git a/services/tunnelbroker/src/notifications/config.rs b/services/tunnelbroker/src/notifications/config.rs
new file mode 100644
--- /dev/null
+++ b/services/tunnelbroker/src/notifications/config.rs
@@ -0,0 +1,8 @@
+#[derive(Default, Clone)]
+pub struct Config {
+ pub fcm_api_key: String,
+ pub apns_certificate_path: String,
+ pub apns_certificate_password: String,
+ pub apns_topic: String,
+ pub is_sandbox: bool,
+}
diff --git a/services/tunnelbroker/src/notifications/mod.rs b/services/tunnelbroker/src/notifications/mod.rs
--- a/services/tunnelbroker/src/notifications/mod.rs
+++ b/services/tunnelbroker/src/notifications/mod.rs
@@ -1,2 +1,23 @@
pub mod apns;
+pub mod config;
pub mod fcm;
+use super::cxx_bridge::ffi::{getConfigParameter, isSandbox};
+use lazy_static::lazy_static;
+
+lazy_static! {
+ static ref CONFIG: config::Config = config::Config {
+ fcm_api_key: getConfigParameter("notifications.fcm_server_key")
+ .expect("Error getting `notifications.fcm_server_key` config parameter"),
+ apns_certificate_path: getConfigParameter("notifications.apns_cert_path")
+ .expect("Error getting `notifications.apns_cert_path` config parameter"),
+ apns_certificate_password: getConfigParameter(
+ "notifications.apns_cert_password"
+ )
+ .expect(
+ "Error getting `notifications.apns_cert_password` config parameter"
+ ),
+ apns_topic: getConfigParameter("notifications.apns_topic")
+ .expect("Error getting `apns_topic` config parameter"),
+ is_sandbox: isSandbox().expect("Error determining of sandboxing"),
+ };
+}

File Metadata

Mime Type
text/plain
Expires
Mon, Dec 23, 11:16 AM (18 h, 46 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2694551
Default Alt Text
D5641.diff (1 KB)

Event Timeline