Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F3257954
D5837.id19206.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Referenced Files
None
Subscribers
None
D5837.id19206.diff
View Options
diff --git a/services/commtest/src/lib.rs b/services/commtest/src/lib.rs
--- a/services/commtest/src/lib.rs
+++ b/services/commtest/src/lib.rs
@@ -2,3 +2,4 @@
pub mod blob;
pub mod constants;
pub mod tools;
+pub mod tunnelbroker;
diff --git a/services/commtest/src/tunnelbroker/mod.rs b/services/commtest/src/tunnelbroker/mod.rs
new file mode 100644
--- /dev/null
+++ b/services/commtest/src/tunnelbroker/mod.rs
@@ -0,0 +1,2 @@
+pub mod new_session;
+pub mod tunnelbroker_utils;
diff --git a/services/commtest/src/tunnelbroker/new_session.rs b/services/commtest/src/tunnelbroker/new_session.rs
new file mode 100644
--- /dev/null
+++ b/services/commtest/src/tunnelbroker/new_session.rs
@@ -0,0 +1,18 @@
+use crate::tools::Error;
+use crate::tunnelbroker::tunnelbroker_utils::{
+ proto::SessionSignatureRequest, TunnelbrokerServiceClient,
+};
+use tonic::Request;
+
+pub async fn get_session_signature(
+ client: &mut TunnelbrokerServiceClient<tonic::transport::Channel>,
+ device_id: &str,
+) -> Result<String, Error> {
+ let response = client
+ .session_signature(Request::new(SessionSignatureRequest {
+ device_id: String::from(device_id),
+ }))
+ .await?;
+ let string_to_sign = response.into_inner().to_sign;
+ Ok(string_to_sign)
+}
diff --git a/services/commtest/src/tunnelbroker/tunnelbroker_utils.rs b/services/commtest/src/tunnelbroker/tunnelbroker_utils.rs
new file mode 100644
--- /dev/null
+++ b/services/commtest/src/tunnelbroker/tunnelbroker_utils.rs
@@ -0,0 +1,4 @@
+pub mod proto {
+ tonic::include_proto!("tunnelbroker");
+}
+pub use proto::tunnelbroker_service_client::TunnelbrokerServiceClient;
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sat, Nov 16, 9:29 PM (20 h, 56 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2504381
Default Alt Text
D5837.id19206.diff (1 KB)
Attached To
Mode
D5837: [services/commtest] Tunnelbroker - Adding of helper function for the `SessionSignature` client request
Attached
Detach File
Event Timeline
Log In to Comment