Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F3491127
D5929.id19554.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
D5929.id19554.diff
View Options
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(
@@ -15,3 +17,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>,
+) -> Result<(), anyhow::Error> {
+ 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
Details
Attached
Mime Type
text/plain
Expires
Thu, Dec 19, 6:17 PM (11 h, 7 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2678343
Default Alt Text
D5929.id19554.diff (1 KB)
Attached To
Mode
D5929: [services/commtest] Tunnelbroker - Adding `deviceID` validation check function
Attached
Detach File
Event Timeline
Log In to Comment