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
Unknown Object (File)
Sat, Mar 15, 4:05 AM
Unknown Object (File)
Wed, Mar 5, 3:10 AM
Unknown Object (File)
Wed, Feb 26, 11:38 AM
Unknown Object (File)
Wed, Feb 26, 11:38 AM
Unknown Object (File)
Wed, Feb 26, 11:37 AM
Unknown Object (File)
Sat, Feb 22, 1:50 PM
Unknown Object (File)
Feb 15 2025, 9:28 PM
Unknown Object (File)
Jan 30 2025, 10:54 PM
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