fix(targets): pass credentials to MQTT broker availability check (#2192)

Signed-off-by: houseme <housemecn@gmail.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
This commit is contained in:
houseme
2026-03-17 23:53:28 +08:00
committed by GitHub
parent b5d881f399
commit 9ce3c7742c
2 changed files with 26 additions and 3 deletions
+3 -1
View File
@@ -225,7 +225,9 @@ impl Operation for NotificationTarget {
let topic = kv_map
.get(rustfs_config::MQTT_TOPIC)
.ok_or_else(|| s3_error!(InvalidArgument, "topic is required"))?;
check_mqtt_broker_available(endpoint, topic)
let username = kv_map.get(rustfs_config::MQTT_USERNAME).copied();
let password = kv_map.get(rustfs_config::MQTT_PASSWORD).copied();
check_mqtt_broker_available(endpoint, topic, username, password)
.await
.map_err(|e| s3_error!(InvalidArgument, "MQTT Broker unavailable: {}", e))?;