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)
Wed, Jan 15, 6:56 AM
Unknown Object (File)
Sat, Jan 11, 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
Unknown Object (File)
Nov 13 2024, 7:52 PM
Unknown Object (File)
Nov 10 2024, 1:03 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
No Lint Coverage
Unit
No Test Coverage

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