From d9e9d294fe97a03adead063e50bf5bd8f35dc293 Mon Sep 17 00:00:00 2001 From: Tommi Vainikainen Date: Tue, 3 Oct 2023 10:35:34 +0300 Subject: [PATCH] Enable SASL authentication in backup code Pass SASL related connection parameters to KafkaAdminClient so backup code can access Kafka also with SASL authentication. --- karapace/kafka_utils.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/karapace/kafka_utils.py b/karapace/kafka_utils.py index 33a55a580..43b7a7ec4 100644 --- a/karapace/kafka_utils.py +++ b/karapace/kafka_utils.py @@ -17,6 +17,9 @@ def kafka_admin_from_config(config: Config) -> KafkaAdminClient: bootstrap_servers=config["bootstrap_uri"], client_id=config["client_id"], security_protocol=config["security_protocol"], + sasl_mechanism=config["sasl_mechanism"], + sasl_plain_username=config["sasl_plain_username"], + sasl_plain_password=config["sasl_plain_password"], ssl_cafile=config["ssl_cafile"], ssl_certfile=config["ssl_certfile"], ssl_keyfile=config["ssl_keyfile"],