Skip to content

Commit 7786c5e

Browse files
andselkorsosa
andauthored
Exposed sasl.client.callback.handler.class Kafka client setting to select a specific SASL Handler class (#177)
Co-authored-by: Akos Korsos <[email protected]>
1 parent 3e41f09 commit 7786c5e

File tree

5 files changed

+21
-0
lines changed

5 files changed

+21
-0
lines changed

docs/input-kafka.asciidoc

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,7 @@ See the https://kafka.apache.org/{kafka_client_doc}/documentation for more detai
130130
| <<plugins-{type}s-{plugin}-reconnect_backoff_ms>> |<<number,number>>|No
131131
| <<plugins-{type}s-{plugin}-request_timeout_ms>> |<<number,number>>|No
132132
| <<plugins-{type}s-{plugin}-retry_backoff_ms>> |<<number,number>>|No
133+
| <<plugins-{type}s-{plugin}-sasl_client_callback_handler_class>> |<<string,string>>|No
133134
| <<plugins-{type}s-{plugin}-sasl_jaas_config>> |<<string,string>>|No
134135
| <<plugins-{type}s-{plugin}-sasl_kerberos_service_name>> |<<string,string>>|No
135136
| <<plugins-{type}s-{plugin}-sasl_mechanism>> |<<string,string>>|No
@@ -555,6 +556,13 @@ retries are exhausted.
555556
The amount of time to wait before attempting to retry a failed fetch request
556557
to a given topic partition. This avoids repeated fetching-and-failing in a tight loop.
557558

559+
[id="plugins-{type}s-{plugin}-sasl_client_callback_handler_class""]
560+
===== `sasl_client_callback_handler_class`
561+
* Value type is <<string,string>>
562+
* There is no default value for this setting.
563+
564+
The SASL client callback handler class the specified SASL mechanism should use.
565+
558566
[id="plugins-{type}s-{plugin}-sasl_jaas_config"]
559567
===== `sasl_jaas_config`
560568

docs/output-kafka.asciidoc

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,7 @@ See the https://kafka.apache.org/{kafka_client_doc}/documentation for more detai
101101
| <<plugins-{type}s-{plugin}-request_timeout_ms>> |<<number,number>>|No
102102
| <<plugins-{type}s-{plugin}-retries>> |<<number,number>>|No
103103
| <<plugins-{type}s-{plugin}-retry_backoff_ms>> |<<number,number>>|No
104+
| <<plugins-{type}s-{plugin}-sasl_client_callback_handler_class>> |<<string,string>>|No
104105
| <<plugins-{type}s-{plugin}-sasl_jaas_config>> |<<string,string>>|No
105106
| <<plugins-{type}s-{plugin}-sasl_kerberos_service_name>> |<<string,string>>|No
106107
| <<plugins-{type}s-{plugin}-sasl_mechanism>> |<<string,string>>|No
@@ -391,6 +392,13 @@ In versions prior to 10.5.0, any exception is retried indefinitely unless the `r
391392

392393
The amount of time to wait before attempting to retry a failed produce request to a given topic partition.
393394

395+
[id="plugins-{type}s-{plugin}-sasl_client_callback_handler_class""]
396+
===== `sasl_client_callback_handler_class`
397+
* Value type is <<string,string>>
398+
* There is no default value for this setting.
399+
400+
The SASL client callback handler class the specified SASL mechanism should use.
401+
394402
[id="plugins-{type}s-{plugin}-sasl_jaas_config"]
395403
===== `sasl_jaas_config`
396404

lib/logstash/inputs/kafka.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -208,6 +208,8 @@ class LogStash::Inputs::Kafka < LogStash::Inputs::Base
208208
config :ssl_endpoint_identification_algorithm, :validate => :string, :default => 'https'
209209
# Security protocol to use, which can be either of PLAINTEXT,SSL,SASL_PLAINTEXT,SASL_SSL
210210
config :security_protocol, :validate => ["PLAINTEXT", "SSL", "SASL_PLAINTEXT", "SASL_SSL"], :default => "PLAINTEXT"
211+
# SASL client callback handler class
212+
config :sasl_client_callback_handler_class, :validate => :string
211213
# http://kafka.apache.org/documentation.html#security_sasl[SASL mechanism] used for client connections.
212214
# This may be any mechanism for which a security provider is available.
213215
# GSSAPI is the default mechanism.

lib/logstash/outputs/kafka.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,8 @@ class LogStash::Outputs::Kafka < LogStash::Outputs::Base
147147
config :ssl_endpoint_identification_algorithm, :validate => :string, :default => 'https'
148148
# Security protocol to use, which can be either of PLAINTEXT,SSL,SASL_PLAINTEXT,SASL_SSL
149149
config :security_protocol, :validate => ["PLAINTEXT", "SSL", "SASL_PLAINTEXT", "SASL_SSL"], :default => "PLAINTEXT"
150+
# SASL client callback handler class
151+
config :sasl_client_callback_handler_class, :validate => :string
150152
# http://kafka.apache.org/documentation.html#security_sasl[SASL mechanism] used for client connections.
151153
# This may be any mechanism for which a security provider is available.
152154
# GSSAPI is the default mechanism.

lib/logstash/plugin_mixins/kafka/common.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ def set_sasl_config(props)
4141

4242
props.put("sasl.kerberos.service.name", sasl_kerberos_service_name) unless sasl_kerberos_service_name.nil?
4343
props.put("sasl.jaas.config", sasl_jaas_config) unless sasl_jaas_config.nil?
44+
props.put("sasl.client.callback.handler.class", sasl_client_callback_handler_class) unless sasl_client_callback_handler_class.nil?
4445
end
4546

4647
def reassign_dns_lookup

0 commit comments

Comments
 (0)