Skip to content

Commit 56f8c92

Browse files
committed
sasl.oauthbearer.token.endpoint.url Kafka client setting to set oauthbearer token endpoint url
1 parent 7786c5e commit 56f8c92

File tree

5 files changed

+44
-0
lines changed

5 files changed

+44
-0
lines changed

docs/input-kafka.asciidoc

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,8 @@ See the https://kafka.apache.org/{kafka_client_doc}/documentation for more detai
131131
| <<plugins-{type}s-{plugin}-request_timeout_ms>> |<<number,number>>|No
132132
| <<plugins-{type}s-{plugin}-retry_backoff_ms>> |<<number,number>>|No
133133
| <<plugins-{type}s-{plugin}-sasl_client_callback_handler_class>> |<<string,string>>|No
134+
| <<plugins-{type}s-{plugin}-sasl_login_callback_handler_class>> |<<string,string>>|No
135+
| <<plugins-{type}s-{plugin}-sasl_oauthbearer_token_endpoint_url>> |<<string,string>>|No
134136
| <<plugins-{type}s-{plugin}-sasl_jaas_config>> |<<string,string>>|No
135137
| <<plugins-{type}s-{plugin}-sasl_kerberos_service_name>> |<<string,string>>|No
136138
| <<plugins-{type}s-{plugin}-sasl_mechanism>> |<<string,string>>|No
@@ -563,6 +565,20 @@ to a given topic partition. This avoids repeated fetching-and-failing in a tight
563565

564566
The SASL client callback handler class the specified SASL mechanism should use.
565567

568+
[id="plugins-{type}s-{plugin}-sasl_login_callback_handler_class""]
569+
===== `sasl_login_callback_handler_class`
570+
* Value type is <<string,string>>
571+
* There is no default value for this setting.
572+
573+
The SASL login callback handler class the specified SASL mechanism should use.
574+
575+
[id="plugins-{type}s-{plugin}-sasl_oauthbearer_token_endpoint_url""]
576+
===== `sasl_oauthbearer_token_endpoint_url`
577+
* Value type is <<string,string>>
578+
* There is no default value for this setting.
579+
580+
The URL where the Kafka client requests OAuth 2.0 tokens from an authorization server for integration with OAuth 2.0 identity providers.
581+
566582
[id="plugins-{type}s-{plugin}-sasl_jaas_config"]
567583
===== `sasl_jaas_config`
568584

docs/output-kafka.asciidoc

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,8 @@ See the https://kafka.apache.org/{kafka_client_doc}/documentation for more detai
102102
| <<plugins-{type}s-{plugin}-retries>> |<<number,number>>|No
103103
| <<plugins-{type}s-{plugin}-retry_backoff_ms>> |<<number,number>>|No
104104
| <<plugins-{type}s-{plugin}-sasl_client_callback_handler_class>> |<<string,string>>|No
105+
| <<plugins-{type}s-{plugin}-sasl_login_callback_handler_class>> |<<string,string>>|No
106+
| <<plugins-{type}s-{plugin}-sasl_oauthbearer_token_endpoint_url>> |<<string,string>>|No
105107
| <<plugins-{type}s-{plugin}-sasl_jaas_config>> |<<string,string>>|No
106108
| <<plugins-{type}s-{plugin}-sasl_kerberos_service_name>> |<<string,string>>|No
107109
| <<plugins-{type}s-{plugin}-sasl_mechanism>> |<<string,string>>|No
@@ -399,6 +401,20 @@ The amount of time to wait before attempting to retry a failed produce request t
399401

400402
The SASL client callback handler class the specified SASL mechanism should use.
401403

404+
[id="plugins-{type}s-{plugin}-sasl_login_callback_handler_class""]
405+
===== `sasl_login_callback_handler_class`
406+
* Value type is <<string,string>>
407+
* There is no default value for this setting.
408+
409+
The SASL login callback handler class the specified SASL mechanism should use.
410+
411+
[id="plugins-{type}s-{plugin}-sasl_oauthbearer_token_endpoint_url""]
412+
===== `sasl_oauthbearer_token_endpoint_url`
413+
* Value type is <<string,string>>
414+
* There is no default value for this setting.
415+
416+
The URL where the Kafka client requests OAuth 2.0 tokens from an authorization server for integration with OAuth 2.0 identity providers.
417+
402418
[id="plugins-{type}s-{plugin}-sasl_jaas_config"]
403419
===== `sasl_jaas_config`
404420

lib/logstash/inputs/kafka.rb

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -210,6 +210,10 @@ class LogStash::Inputs::Kafka < LogStash::Inputs::Base
210210
config :security_protocol, :validate => ["PLAINTEXT", "SSL", "SASL_PLAINTEXT", "SASL_SSL"], :default => "PLAINTEXT"
211211
# SASL client callback handler class
212212
config :sasl_client_callback_handler_class, :validate => :string
213+
# SASL login callback handler class
214+
config :sasl_login_callback_handler_class, :validate => :string
215+
# The URL where the Kafka client requests OAuth 2.0 tokens from an authorization server.
216+
config :sasl_oauthbearer_token_endpoint_url, :validate => :string
213217
# http://kafka.apache.org/documentation.html#security_sasl[SASL mechanism] used for client connections.
214218
# This may be any mechanism for which a security provider is available.
215219
# GSSAPI is the default mechanism.

lib/logstash/outputs/kafka.rb

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,10 @@ class LogStash::Outputs::Kafka < LogStash::Outputs::Base
149149
config :security_protocol, :validate => ["PLAINTEXT", "SSL", "SASL_PLAINTEXT", "SASL_SSL"], :default => "PLAINTEXT"
150150
# SASL client callback handler class
151151
config :sasl_client_callback_handler_class, :validate => :string
152+
# SASL login callback handler class
153+
config :sasl_login_callback_handler_class, :validate => :string
154+
# The URL where the Kafka client requests OAuth 2.0 tokens from an authorization server.
155+
config :sasl_oauthbearer_token_endpoint_url, :validate => :string
152156
# http://kafka.apache.org/documentation.html#security_sasl[SASL mechanism] used for client connections.
153157
# This may be any mechanism for which a security provider is available.
154158
# GSSAPI is the default mechanism.
@@ -363,6 +367,8 @@ def create_producer
363367
props.put(kafka::VALUE_SERIALIZER_CLASS_CONFIG, value_serializer)
364368

365369
props.put("security.protocol", security_protocol) unless security_protocol.nil?
370+
props.put("sasl.login.callback.handler.class", sasl_login_callback_handler_class) unless sasl_login_callback_handler_class.nil?
371+
props.put("sasl.oauthbearer.token.endpoint.url", sasl_oauthbearer_token_endpoint_url) unless sasl_oauthbearer_token_endpoint_url.nil?
366372

367373
if security_protocol == "SSL"
368374
set_trustore_keystore_config(props)

lib/logstash/plugin_mixins/kafka/common.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,8 @@ def set_sasl_config(props)
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?
4444
props.put("sasl.client.callback.handler.class", sasl_client_callback_handler_class) unless sasl_client_callback_handler_class.nil?
45+
props.put("sasl.login.callback.handler.class", sasl_login_callback_handler_class) unless sasl_login_callback_handler_class.nil?
46+
props.put("sasl.oauthbearer.token.endpoint.url", sasl_oauthbearer_token_endpoint_url) unless sasl_oauthbearer_token_endpoint_url.nil?
4547
end
4648

4749
def reassign_dns_lookup

0 commit comments

Comments
 (0)