Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F3362097
D12375.id41299.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
D12375.id41299.diff
View Options
diff --git a/lib/types/tunnelbroker/peer-to-peer-message-types.js b/lib/types/tunnelbroker/peer-to-peer-message-types.js
--- a/lib/types/tunnelbroker/peer-to-peer-message-types.js
+++ b/lib/types/tunnelbroker/peer-to-peer-message-types.js
@@ -26,6 +26,7 @@
QR_CODE_AUTH_MESSAGE: 'QRCodeAuthMessage',
DEVICE_LIST_UPDATED: 'DeviceListUpdated',
MESSAGE_PROCESSED: 'MessageProcessed',
+ IDENTITY_DEVICE_LIST_UPDATED: 'IdentityDeviceListUpdated',
});
export type OutboundSessionCreation = {
@@ -100,13 +101,22 @@
deviceID: t.String,
});
+export type IdentityDeviceListUpdated = {
+ +type: 'IdentityDeviceListUpdated',
+};
+export const identityDeviceListUpdatedValidator: TInterface<IdentityDeviceListUpdated> =
+ tShape<IdentityDeviceListUpdated>({
+ type: tString(peerToPeerMessageTypes.IDENTITY_DEVICE_LIST_UPDATED),
+ });
+
export type PeerToPeerMessage =
| OutboundSessionCreation
| EncryptedMessage
| RefreshKeyRequest
| QRCodeAuthMessage
| DeviceListUpdated
- | MessageProcessed;
+ | MessageProcessed
+ | IdentityDeviceListUpdated;
export const peerToPeerMessageValidator: TUnion<PeerToPeerMessage> = t.union([
outboundSessionCreationValidator,
@@ -115,4 +125,5 @@
qrCodeAuthMessageValidator,
deviceListUpdatedValidator,
messageProcessedValidator,
+ identityDeviceListUpdatedValidator,
]);
diff --git a/shared/tunnelbroker_messages/src/messages/device_list_updated.rs b/shared/tunnelbroker_messages/src/messages/device_list_updated.rs
new file mode 100644
--- /dev/null
+++ b/shared/tunnelbroker_messages/src/messages/device_list_updated.rs
@@ -0,0 +1,7 @@
+//! Messages sent from Identity to device informing that device list was updated.
+
+use serde::{Deserialize, Serialize};
+
+#[derive(Serialize, Deserialize, PartialEq, Debug)]
+#[serde(tag = "type", rename_all = "camelCase")]
+pub struct IdentityDeviceListUpdated {}
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
@@ -1,5 +1,6 @@
//! Messages sent between Tunnelbroker and a device.
+pub mod device_list_updated;
pub mod keys;
pub mod message_receive_confirmation;
pub mod message_to_device;
@@ -7,6 +8,7 @@
pub mod message_to_device_request_status;
pub mod session;
+pub use device_list_updated::*;
pub use keys::*;
pub use message_receive_confirmation::*;
pub use message_to_device::*;
@@ -41,10 +43,12 @@
MessageToDevice(MessageToDevice),
MessageReceiveConfirmation(MessageReceiveConfirmation),
Heartbeat(Heartbeat),
+ IdentityDeviceListUpdated(IdentityDeviceListUpdated),
}
#[derive(Serialize, Deserialize, Debug)]
#[serde(untagged)]
pub enum PeerToPeerMessages {
RefreshKeysRequest(RefreshKeyRequest),
+ IdentityDeviceListUpdated(IdentityDeviceListUpdated),
}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Mon, Nov 25, 9:24 PM (22 h, 1 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2580787
Default Alt Text
D12375.id41299.diff (2 KB)
Attached To
Mode
D12375: [lib] add `IdentityDeviceListUpdated` P2P message type
Attached
Detach File
Event Timeline
Log In to Comment