Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AIOKafkaAdminClient does not accept SASL authentication kwargs #889

Closed
selevit opened this issue May 25, 2023 · 0 comments · Fixed by #890
Closed

AIOKafkaAdminClient does not accept SASL authentication kwargs #889

selevit opened this issue May 25, 2023 · 0 comments · Fixed by #890

Comments

@selevit
Copy link
Contributor

selevit commented May 25, 2023

Describe the bug

AIOKafkaAdminClient does not accept SASL extra authentication keyword arguments, required for authentication in Amazon MSK.

When trying to pass them, it fails with the following error:

Traceback (most recent call last):
  File "kafka_bug_mre.py", line 4, in <module>
    admin_client = AIOKafkaAdminClient(
TypeError: AIOKafkaAdminClient.__init__() got an unexpected keyword argument 'sasl_mechanism'

Expected behaviour

AIOKafkaAdminClient.__init__ should accept all arguments that are valid for a simple AIOKafkaClient.

Environment:

  • aiokafka version 0.8.0
  • kafka-python version: 2.0.2
  • Kafka Broker version 7.3.2-ccs (Commit:853191ff421b2935dfa531545651ab667b809801)

Reproducible example

from aiokafka.admin import AIOKafkaAdminClient
from aiokafka.helpers import create_ssl_context

admin_client = AIOKafkaAdminClient(
    bootstrap_servers=["localhost:9092"],
    sasl_mechanism="SCRAM-SHA-512",
    sasl_plain_username="username",
    sasl_plain_password="password",
    security_protocol="SASL_SSL",
    ssl_context=create_ssl_context(),
)
@selevit selevit changed the title AIOKafkaAdminClient does not accept SASL authentication options AIOKafkaAdminClient does not accept SASL authentication kwargs May 25, 2023
selevit pushed a commit to selevit/aiokafka that referenced this issue May 26, 2023
@ods ods closed this as completed in #890 May 30, 2023
ods added a commit that referenced this issue May 30, 2023
* Support SASL authentication in AIOKafkaAdminClient [#889]

* Add missing deps into README

* Added a foundation for admin sasl tests

* Bring back gssapi_consumer_factory() method

* Add forgotten await-s

* Add more admin tests

* Add CHANGES

* Swap method back to minimize diff

---------

Co-authored-by: Sergey Levitin <sergeylevitin@protonmail.com>
Co-authored-by: Denis Otkidach <denis.otkidach@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant