Skip to content

Commit

Permalink
[Tunnelbroker] improve Tunnelbroker messages docs
Browse files Browse the repository at this point in the history
Summary:
- Addresses: https://phab.comm.dev/D9463?id=31961#inline-59838
- Fix typos
- Fix file name

Test Plan: N/A

Reviewers: michal, bartek, varun, jon

Reviewed By: michal

Subscribers: ashoat, tomek, wyilio

Differential Revision: https://phab.comm.dev/D9521
  • Loading branch information
xsanm committed Oct 18, 2023
1 parent 99c8d56 commit 5ade2a0
Show file tree
Hide file tree
Showing 8 changed files with 16 additions and 14 deletions.
5 changes: 3 additions & 2 deletions services/tunnelbroker/src/websockets/session.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,9 @@ use tokio::io::AsyncRead;
use tokio::io::AsyncWrite;
use tracing::{debug, error, info};
use tunnelbroker_messages::{
send_confirmation::Failure, send_confirmation::MessageSentStatus,
session::DeviceTypes, MessageToDeviceRequest, Messages,
message_to_device_request_status::Failure,
message_to_device_request_status::MessageSentStatus, session::DeviceTypes,
MessageToDeviceRequest, Messages,
};

use crate::database::{self, DatabaseClient, DeviceMessage};
Expand Down
2 changes: 1 addition & 1 deletion shared/tunnelbroker_messages/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
pub mod messages;

pub use message_to_device_request_status::*;
pub use messages::*;
pub use send_confirmation::*;
2 changes: 1 addition & 1 deletion shared/tunnelbroker_messages/src/messages/keys.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Messages sent between Tunnelbroker and a device
//! Messages sent from Tunnelbroker to a device.
use serde::{Deserialize, Serialize};

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Messages sent between Tunnelbroker and a device via WebSocket
//! Messages sent between Tunnelbroker and a device via WebSocket.
use serde::{Deserialize, Serialize};

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Message sent from WebSocket clients to Tunnelbroker
//! Message sent from Tunnelbroker to WebSocket.
use serde::{Deserialize, Serialize};

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// Message sent from Tunnelbroker to WebSocket clients to inform that message
// was processed, saved in DDB and will be delivered.
//! Message sent from Tunnelbroker to WebSocket clients to inform that message
//! was processed, saved in DDB, and will be delivered.
use serde::{Deserialize, Serialize};

Expand Down
7 changes: 4 additions & 3 deletions shared/tunnelbroker_messages/src/messages/mod.rs
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
// Messages sent between Tunnelbroker and a device
//! Messages sent between Tunnelbroker and a device.
pub mod keys;
pub mod message_to_device;
pub mod message_to_device_request;
pub mod send_confirmation;
pub mod message_to_device_request_status;
pub mod session;

pub use keys::*;
pub use message_to_device::*;
pub use message_to_device_request::*;
pub use send_confirmation::*;
pub use message_to_device_request_status::*;
pub use session::*;

use serde::{Deserialize, Serialize};
Expand Down
6 changes: 3 additions & 3 deletions shared/tunnelbroker_messages/src/messages/session.rs
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
// Messages sent between Tunnelbroker and a device
//! The first message sent from WebSocket client to Tunnelbroker.
use serde::{Deserialize, Serialize};

/// The workflow when estabilishing a Tunnelbroker connection:
/// The workflow when establishing a Tunnelbroker connection:
/// - Client sends ConnectionInitializationMessage
/// - Tunnelbroker validates access_token with identity service
/// - Tunnelbroker emits an AMQP message declaring that it has opened a new
/// connection with a given device, so that the respective tunnelbroker
/// connection with a given device, so that the respective Tunnelbroker
/// instance can close the existing connection.
/// - Tunnelbroker returns a session_id representing that the connection was
/// accepted
Expand Down

0 comments on commit 5ade2a0

Please sign in to comment.