View Source KafkaEx.Auth.SASL.VersionSupport (kafka_ex v0.15.0)
Version compatibility checker for SASL authentication.
Determines which SASL features are available based on the configured Kafka version, preventing runtime errors from unsupported operations.
Support Matrix
| Kafka Version | SASL/PLAIN | API Versions | SCRAM-SHA |
|---|---|---|---|
| 0.8.x | ❌ | ❌ | ❌ |
| 0.9.x | ✅ | ❌ | ❌ |
| 0.10.0-0.10.1 | ✅ | ✅ | ❌ |
| 0.10.2+ | ✅ | ✅ | ✅ |
Configuration
Set Kafka version in your config:
config :kafka_ex,
kafka_version: "0.10.2" # or "kayrock" for latest
## Usage
This module is used internally by the SASL authentication flow
to make decisions about:
Whether to fetch API versions during handshake
Which mechanisms are supported
Whether SSL is required for PLAIN mechanism
Summary
Functions
Returns whether to check API versions during SASL handshake.
Determines SASL support level based on configured Kafka version.
Validates SASL configuration against server capabilities. Returns :ok or an error tuple with a descriptive message.
Types
@type support_level() :: :unsupported | :plain_only | :plain_with_api_versions | :full
Functions
@spec check_api_versions?() :: boolean()
Returns whether to check API versions during SASL handshake.
@spec sasl_support_level() :: support_level()
Determines SASL support level based on configured Kafka version.
@spec validate_config(KafkaEx.Auth.Config.t(), KafkaEx.Socket.t()) :: :ok | {:error, term()}
Validates SASL configuration against server capabilities. Returns :ok or an error tuple with a descriptive message.