Page MenuHomePhabricator

[tunnelbroker] Close WS session when received special AMQP message
ClosedPublic

Authored by bartek on Sep 2 2024, 11:46 PM.
Tags
None
Referenced Files
F4080538: D13227.id.diff
Sat, Feb 15, 9:28 PM
Unknown Object (File)
Thu, Jan 30, 10:54 PM
Unknown Object (File)
Jan 15 2025, 6:56 AM
Unknown Object (File)
Jan 11 2025, 2:16 AM
Unknown Object (File)
Dec 18 2024, 4:43 AM
Unknown Object (File)
Dec 18 2024, 4:43 AM
Unknown Object (File)
Dec 18 2024, 4:43 AM
Unknown Object (File)
Dec 18 2024, 4:43 AM
Subscribers

Details

Summary

Address ENG-8256.

Added a special AMQP message, that when received by consumer for given device ID, the websocket session is closed.

Test Plan

Modified SendMessageToDevice to send this message instead. Confirmed that the device is disconnected.

Diff Detail

Repository
rCOMM Comm
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

bartek held this revision as a draft.
bartek published this revision for review.Sep 3 2024, 12:11 AM

I also considered using an enum

enum AMQPMessage {
  MessageToDevice(MessageToDevice),
  SessionClose
}

but again I had weird issues with serde when trying to make it backwards compatible with existing format.

For now I sticked to simple "special message" constant.

One note: This is safe because of serialization here and the malicious device will not be able to close other devices sessions.

This revision is now accepted and ready to land.Sep 6 2024, 6:08 AM