Skip to content

Commit

Permalink
Add missing sasl.login.callback.handler.class" config (logstash-plu…
Browse files Browse the repository at this point in the history
  • Loading branch information
darby.han committed Sep 13, 2024
1 parent 6d45a94 commit 85862c6
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 0 deletions.
8 changes: 8 additions & 0 deletions docs/input-kafka.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,7 @@ See the https://kafka.apache.org/{kafka_client_doc}/documentation for more detai
| <<plugins-{type}s-{plugin}-sasl_client_callback_handler_class>> |<<string,string>>|No
| <<plugins-{type}s-{plugin}-sasl_oauthbearer_token_endpoint_url>> |<<string,string>>|No
| <<plugins-{type}s-{plugin}-sasl_oauthbearer_scope_claim_name>> |<<string,string>>|No
| <<plugins-{type}s-{plugin}-sasl_login_callback_handler_class>> |<<string,string>>|No
| <<plugins-{type}s-{plugin}-sasl_login_connect_timeout_ms>> |<<number,number>>|No
| <<plugins-{type}s-{plugin}-sasl_login_read_timeout_ms>> |<<number,number>>|No
| <<plugins-{type}s-{plugin}-sasl_login_retry_backoff_ms>> |<<number,number>>|No
Expand Down Expand Up @@ -583,6 +584,13 @@ The URL for the OAuth 2.0 issuer token endpoint.

(optional) The override name of the scope claim.

[id="plugins-{type}s-{plugin}-sasl_login_callback_handler_class"]
===== `sasl_login_callback_handler_class`
* Value type is <<string,string>>
* There is no default value for this setting.

The SASL login callback handler class the specified SASL mechanism should use.

[id="plugins-{type}s-{plugin}-sasl_login_connect_timeout_ms"]
===== `sasl_login_connect_timeout_ms`
* Value type is <<number,number>>
Expand Down
8 changes: 8 additions & 0 deletions docs/output-kafka.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@ See the https://kafka.apache.org/{kafka_client_doc}/documentation for more detai
| <<plugins-{type}s-{plugin}-sasl_client_callback_handler_class>> |<<string,string>>|No
| <<plugins-{type}s-{plugin}-sasl_oauthbearer_token_endpoint_url>> |<<string,string>>|No
| <<plugins-{type}s-{plugin}-sasl_oauthbearer_scope_claim_name>> |<<string,string>>|No
| <<plugins-{type}s-{plugin}-sasl_login_callback_handler_class>> |<<string,string>>|No
| <<plugins-{type}s-{plugin}-sasl_login_connect_timeout_ms>> |<<number,number>>|No
| <<plugins-{type}s-{plugin}-sasl_login_read_timeout_ms>> |<<number,number>>|No
| <<plugins-{type}s-{plugin}-sasl_login_retry_backoff_ms>> |<<number,number>>|No
Expand Down Expand Up @@ -419,6 +420,13 @@ The URL for the OAuth 2.0 issuer token endpoint.

(optional) The override name of the scope claim.

[id="plugins-{type}s-{plugin}-sasl_login_callback_handler_class"]
===== `sasl_login_callback_handler_class`
* Value type is <<string,string>>
* There is no default value for this setting.

The SASL login callback handler class the specified SASL mechanism should use.

[id="plugins-{type}s-{plugin}-sasl_login_connect_timeout_ms"]
===== `sasl_login_connect_timeout_ms`
* Value type is <<number,number>>
Expand Down
2 changes: 2 additions & 0 deletions lib/logstash/inputs/kafka.rb
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,8 @@ class LogStash::Inputs::Kafka < LogStash::Inputs::Base
config :sasl_oauthbearer_token_endpoint_url, :validate => :string
# (optional) The override name of the scope claim.
config :sasl_oauthbearer_scope_claim_name, :validate => :string, :default => 'scope'
# SASL login callback handler class
config :sasl_login_callback_handler_class, :validate => :string
# (optional) The duration, in milliseconds, for HTTPS connect timeout
config :sasl_login_connect_timeout_ms, :validate => :number, :default => 10000
# (optional) The duration, in milliseconds, for HTTPS read timeout.
Expand Down
2 changes: 2 additions & 0 deletions lib/logstash/outputs/kafka.rb
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,8 @@ class LogStash::Outputs::Kafka < LogStash::Outputs::Base
config :sasl_oauthbearer_token_endpoint_url, :validate => :string
# (optional) The override name of the scope claim.
config :sasl_oauthbearer_scope_claim_name, :validate => :string, :default => 'scope'
# SASL login callback handler class
config :sasl_login_callback_handler_class, :validate => :string
# (optional) The duration, in milliseconds, for HTTPS connect timeout
config :sasl_login_connect_timeout_ms, :validate => :number, :default => 10000
# (optional) The duration, in milliseconds, for HTTPS read timeout.
Expand Down
1 change: 1 addition & 0 deletions lib/logstash/plugin_mixins/kafka/common.rb
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ def set_sasl_config(props)
props.put("sasl.client.callback.handler.class", sasl_client_callback_handler_class) unless sasl_client_callback_handler_class.nil?
props.put("sasl.oauthbearer.token.endpoint.url", sasl_oauthbearer_token_endpoint_url) unless sasl_oauthbearer_token_endpoint_url.nil?
props.put("sasl.oauthbearer.scope.claim.name", sasl_oauthbearer_scope_claim_name) unless sasl_oauthbearer_scope_claim_name.nil?
props.put("sasl.login.callback.handler.class", sasl_login_callback_handler_class) unless sasl_login_callback_handler_class.nil?
props.put("sasl.login.connect.timeout.ms", sasl_login_connect_timeout_ms.to_s) unless sasl_login_connect_timeout_ms.nil?
props.put("sasl.login.read.timeout.ms", sasl_login_read_timeout_ms.to_s) unless sasl_login_read_timeout_ms.nil?
props.put("sasl.login.retry.backoff.ms", sasl_login_retry_backoff_ms.to_s) unless sasl_login_retry_backoff_ms.nil?
Expand Down

0 comments on commit 85862c6

Please sign in to comment.