Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F3332798
D12895.id42850.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
2 KB
Referenced Files
None
Subscribers
None
D12895.id42850.diff
View Options
diff --git a/Cargo.lock b/Cargo.lock
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -5822,6 +5822,7 @@
dependencies = [
"serde",
"serde_json",
+ "util_macros",
"websocket_messages",
]
diff --git a/lib/types/tunnelbroker/notif-types.js b/lib/types/tunnelbroker/notif-types.js
--- a/lib/types/tunnelbroker/notif-types.js
+++ b/lib/types/tunnelbroker/notif-types.js
@@ -15,3 +15,15 @@
+data: string,
+priority: 'NORMAL' | 'HIGH',
};
+
+export type TunnelbrokerWebPushNotif = {
+ +type: 'WebPushNotif',
+ +clientMessageID: string,
+ +deviceID: string,
+ +payload: string,
+};
+
+export type TunnelbrokerNotif =
+ | TunnelbrokerAPNsNotif
+ | TunnelbrokerFCMNotif
+ | TunnelbrokerWebPushNotif;
diff --git a/shared/tunnelbroker_messages/Cargo.toml b/shared/tunnelbroker_messages/Cargo.toml
--- a/shared/tunnelbroker_messages/Cargo.toml
+++ b/shared/tunnelbroker_messages/Cargo.toml
@@ -11,3 +11,4 @@
serde = { workspace = true, features = ["derive"] }
serde_json = { workspace = true }
websocket_messages = { path = "../websocket_messages" }
+util_macros = { path = "../util_macros" }
diff --git a/shared/tunnelbroker_messages/src/messages/mod.rs b/shared/tunnelbroker_messages/src/messages/mod.rs
--- a/shared/tunnelbroker_messages/src/messages/mod.rs
+++ b/shared/tunnelbroker_messages/src/messages/mod.rs
@@ -43,6 +43,7 @@
AnonymousInitializationMessage(AnonymousInitializationMessage),
APNsNotif(APNsNotif),
FCMNotif(FCMNotif),
+ WebPushNotif(WebPushNotif),
MessageToDeviceRequest(MessageToDeviceRequest),
MessageReceiveConfirmation(MessageReceiveConfirmation),
MessageToTunnelbrokerRequest(MessageToTunnelbrokerRequest),
diff --git a/shared/tunnelbroker_messages/src/messages/notif.rs b/shared/tunnelbroker_messages/src/messages/notif.rs
--- a/shared/tunnelbroker_messages/src/messages/notif.rs
+++ b/shared/tunnelbroker_messages/src/messages/notif.rs
@@ -1,4 +1,5 @@
use serde::{Deserialize, Serialize};
+use util_macros::TagAwareDeserialize;
/// APNs notif built on client.
#[derive(Serialize, Deserialize, PartialEq, Debug)]
@@ -23,3 +24,14 @@
pub data: String,
pub priority: String,
}
+
+/// WebPush notif built on client.
+#[derive(Serialize, Deserialize, TagAwareDeserialize, PartialEq, Debug)]
+#[serde(tag = "type", remote = "Self", rename_all = "camelCase")]
+pub struct WebPushNotif {
+ #[serde(rename = "clientMessageID")]
+ pub client_message_id: String,
+ #[serde(rename = "deviceID")]
+ pub device_id: String,
+ pub payload: String,
+}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Fri, Nov 22, 1:50 AM (4 h, 48 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2559333
Default Alt Text
D12895.id42850.diff (2 KB)
Attached To
Mode
D12895: [tunnelbroker][lib] Add WebPush notif message type
Attached
Detach File
Event Timeline
Log In to Comment