Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F3508084
D6040.id20302.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
D6040.id20302.diff
View Options
diff --git a/native/native_rust_library/src/tunnelbroker_client.rs b/native/native_rust_library/src/tunnelbroker_client.rs
--- a/native/native_rust_library/src/tunnelbroker_client.rs
+++ b/native/native_rust_library/src/tunnelbroker_client.rs
@@ -1,6 +1,9 @@
use crate::TunnelbrokerClient;
-use crate::tunnelbroker::SessionSignatureRequest;
+use crate::tunnelbroker::NewSessionRequest;
+use crate::tunnelbroker::{
+ new_session_request::DeviceTypes, SessionSignatureRequest,
+};
pub async fn get_nonce_to_sign(
mut client: Box<TunnelbrokerClient>,
@@ -15,3 +18,31 @@
.to_sign,
)
}
+
+pub async fn get_new_session_id(
+ mut client: Box<TunnelbrokerClient>,
+ device_id: String,
+ public_key: String,
+ signature: String,
+ device_type: DeviceTypes,
+ device_app_version: String,
+ device_os: String,
+ notify_token: Option<String>,
+) -> Result<String, tonic::Status> {
+ Ok(
+ client
+ .tunnelbroker_client
+ .new_session(NewSessionRequest {
+ device_id,
+ public_key,
+ signature,
+ notify_token,
+ device_type: device_type as i32,
+ device_app_version,
+ device_os,
+ })
+ .await?
+ .into_inner()
+ .session_id,
+ )
+}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sat, Dec 21, 9:47 PM (19 h, 22 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2684375
Default Alt Text
D6040.id20302.diff (1 KB)
Attached To
Mode
D6040: [native/rust_library] Tunnelbroker client - Adding of the `get_new_session_id` function
Attached
Detach File
Event Timeline
Log In to Comment