Page MenuHomePhabricator

D5929.id20191.diff
No OneTemporary

D5929.id20191.diff

diff --git a/services/commtest/src/tunnelbroker/tunnelbroker_utils.rs b/services/commtest/src/tunnelbroker/tunnelbroker_utils.rs
--- a/services/commtest/src/tunnelbroker/tunnelbroker_utils.rs
+++ b/services/commtest/src/tunnelbroker/tunnelbroker_utils.rs
@@ -1,9 +1,11 @@
+use anyhow::bail;
use std::env;
use tonic::transport::Channel;
use tonic::transport::Error;
pub mod proto {
tonic::include_proto!("tunnelbroker");
}
+use super::new_session::get_string_to_sign;
pub use proto::tunnelbroker_service_client::TunnelbrokerServiceClient;
pub async fn tonic_client_builder(
@@ -14,3 +16,14 @@
.unwrap_or(String::from("localhost"));
TunnelbrokerServiceClient::connect(format!("http://{}:{}", host, port)).await
}
+
+pub async fn session_signature_device_id_format_validation(
+ client: &mut TunnelbrokerServiceClient<tonic::transport::Channel>,
+) -> anyhow::Result<()> {
+ let wrong_device_id =
+ "some:OOOQ7b2ueEmQ4QsevRWlXxFCNt055y20T1PHdoYAQRt0S6TLzZWNM6XSvdWqxm";
+ if let Ok(_) = get_string_to_sign(client, wrong_device_id).await {
+ bail!("Got success result on wrong deviceID format")
+ }
+ Ok(())
+}

File Metadata

Mime Type
text/plain
Expires
Thu, Dec 19, 6:17 PM (11 h, 22 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2676859
Default Alt Text
D5929.id20191.diff (1 KB)

Event Timeline