Skip to content

Commit 04ff4b7

Browse files
author
Shlomi Kushchi
committed
cr fixes
1 parent 208d56f commit 04ff4b7

File tree

5 files changed

+8
-182
lines changed

5 files changed

+8
-182
lines changed

sdk/core/azure_core_amqp/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ native-tls = { version = "0.2", optional = true }
3434
tokio-native-tls = { version = "0.3", optional = true }
3535
tracing.workspace = true
3636
typespec = { workspace = true, features = ["amqp"] }
37+
typespec_client_core = { workspace = true }
3738
typespec_macros.workspace = true
3839

3940
[dev-dependencies]

sdk/core/azure_core_amqp/src/socks5.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,14 @@
55
66
use azure_core::{error::Result, http::Url};
77
use native_tls::TlsConnector as NativeTlsConnector;
8+
use std::collections::HashSet;
89
use std::pin::Pin;
910
use std::task::{Context, Poll};
1011
use tokio::io::{AsyncRead, AsyncWrite};
1112
use tokio_native_tls::TlsConnector;
1213
use tokio_socks::{tcp::Socks5Stream, TargetAddr};
1314
use tracing::{debug, error, trace};
15+
use typespec_client_core::http::Sanitizer;
1416

1517
/// A trait that combines AsyncRead, AsyncWrite, Unpin, Send and Debug for SOCKS5 streams
1618
pub trait SocksStream: AsyncRead + AsyncWrite + Unpin + Send + std::fmt::Debug + 'static {}
@@ -492,7 +494,7 @@ impl SocksConnection {
492494
if masked.password().is_some() {
493495
let _ = masked.set_password(Some("***"));
494496
}
495-
masked.sanitize(&[])
497+
masked.sanitize(&HashSet::new())
496498
}
497499
}
498500

sdk/eventhubs/azure_messaging_eventhubs/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ futures.workspace = true
2626
rand.workspace = true
2727
rand_chacha.workspace = true
2828
tracing.workspace = true
29+
typespec_client_core = { workspace = true }
2930

3031
[build-dependencies]
3132
rustc_version.workspace = true

sdk/eventhubs/azure_messaging_eventhubs/examples/eventhubs_socks5_proxy.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,8 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {
126126
/// to prevent credential exposure in log files.
127127
fn mask_proxy_credentials(url: &str) -> String {
128128
use azure_core::http::Url;
129+
use std::collections::HashSet;
130+
use typespec_client_core::http::Sanitizer;
129131

130132
if let Ok(parsed_url) = Url::parse(url) {
131133
let mut masked = parsed_url.clone();
@@ -135,7 +137,7 @@ fn mask_proxy_credentials(url: &str) -> String {
135137
if parsed_url.password().is_some() {
136138
let _ = masked.set_password(Some("***"));
137139
}
138-
masked.sanitize(&[])
140+
masked.sanitize(&HashSet::new())
139141
} else {
140142
// If URL parsing fails, return a safe placeholder
141143
"invalid_proxy_url".to_string()

sdk/eventhubs/azure_messaging_eventhubs/tests/eventhubs_socks5_proxy.rs

Lines changed: 0 additions & 180 deletions
This file was deleted.

0 commit comments

Comments
 (0)