Skip to content

Kafka BasicAuth

KafkaBasicAuth

Connect to Kafka using sasl.mechanism="PLAIN".

For more details see Kafka Documentation.

Added in 0.9.0

Examples:

Auth in Kafka with user and password:

from onetl.connection import Kafka

auth = Kafka.BasicAuth(
    user="some_user",
    password="abc",
)

Parameters:

  • user

    (str) –
  • password

    (SecretStr) –

parse(options)

If a parameter inherited from the ReadOptions class was passed, then it will be returned unchanged. If a Dict object was passed it will be converted to ReadOptions.

Otherwise, an exception will be raised