Page MenuHomePhabricator

D6040.id20151.diff
No OneTemporary

D6040.id20151.diff

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

Mime Type
text/plain
Expires
Sat, Dec 21, 10:24 PM (20 h, 9 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2684375
Default Alt Text
D6040.id20151.diff (1 KB)

Event Timeline