diff --git a/services/tunnelbroker/src/notifs/wns/error.rs b/services/tunnelbroker/src/notifs/wns/error.rs
--- a/services/tunnelbroker/src/notifs/wns/error.rs
+++ b/services/tunnelbroker/src/notifs/wns/error.rs
@@ -12,4 +12,18 @@
ReadLock,
#[display(fmt = "Failed to acquire write lock")]
WriteLock,
+ #[display(fmt = "WNS Notification Error: {}", _0)]
+ WNSNotification(WNSNotificationError),
+ #[display(fmt = "Missing WNS ID")]
+ MissingWNSID,
}
+
+#[derive(Debug, Display)]
+pub enum WNSNotificationError {
+ #[display(fmt = "HTTP Error: {}", _0)]
+ Http(reqwest::Error),
+ #[display(fmt = "Unknown Error: {}", _0)]
+ Unknown(String),
+}
+
+impl std::error::Error for WNSNotificationError {}
diff --git a/services/tunnelbroker/src/notifs/wns/mod.rs b/services/tunnelbroker/src/notifs/wns/mod.rs
--- a/services/tunnelbroker/src/notifs/wns/mod.rs
+++ b/services/tunnelbroker/src/notifs/wns/mod.rs
@@ -13,6 +13,12 @@
expires: SystemTime,
}
+#[derive(Debug, Clone)]
+pub struct WNSNotif {
+ pub device_token: String,
+ pub payload: String,
+}
+
#[derive(Clone)]
pub struct WNSClient {
http_client: reqwest::Client,
@@ -30,9 +36,51 @@
})
}
- pub async fn get_wns_token(
- &mut self,
- ) -> Result