From 3d2a71741f1265a7470ac1d00d5168d962ffbc53 Mon Sep 17 00:00:00 2001 From: Einar Omang Date: Mon, 6 Jan 2025 15:35:23 +0100 Subject: [PATCH] fix: SASL/PLAIN The previous fix did not work. This is now definitely verified to be working and also makes coherent sense. --- .circleci/config.yml | 1 + src/messenger.rs | 4 +++- tests/client.rs | 4 ++++ 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 35523f3..7fddbd1 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -279,6 +279,7 @@ jobs: # Don't use the first node here since this is likely the controller and we want to ensure that we automatically # pick the controller for certain actions (e.g. topic creation) and don't just get lucky. KAFKA_CONNECT: "invalid:9093,kafka-1:9093" + KAFKA_SASL_CONNECT: kafka-1:9093 SOCKS_PROXY: "proxy:1080" steps: - checkout diff --git a/src/messenger.rs b/src/messenger.rs index 34fea00..06a8d60 100644 --- a/src/messenger.rs +++ b/src/messenger.rs @@ -610,7 +610,9 @@ where let authentication_response = self.sasl_authentication(to_sent.into_inner()).await?; data_received = Some(authentication_response.auth_bytes.0); - } else { + } + + if state.is_finished() { break; } } diff --git a/tests/client.rs b/tests/client.rs index 024dc7b..b87d4bb 100644 --- a/tests/client.rs +++ b/tests/client.rs @@ -44,6 +44,10 @@ async fn test_sasl() { .sasl_config(rskafka::client::SaslConfig::Plain( rskafka::client::Credentials::new("admin".to_string(), "admin-secret".to_string()), )) + .backoff_config(BackoffConfig { + deadline: Some(Duration::from_secs(1)), + ..Default::default() + }) .build() .await .unwrap();