logstash-integration-kafka 11.5.3-java → 11.6.0-java

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: b90e8cfa9937ff3001c3d5774b304c2a1457e869a4477f6357b42a1f31daba39
4
- data.tar.gz: 81f9e12937c0bbf2623d07abaaec1af2af257e3c6a64ba29f2f7fa6e84fb8cb6
3
+ metadata.gz: 9d342010bbdc6c64b7380374583eb1d33648c5cd9e8b948e6d40c9c62c120963
4
+ data.tar.gz: 3bcf9b167d4cb7cc6d2857d6f81dce26bf09120fed71a2a75d7a54137f6d4a0a
5
5
  SHA512:
6
- metadata.gz: 1ebf6b2738abc83423185bee8675433623f29422cc8ed115d74670bbeb14e185328a2fb5fa3c5d79adc4a73584de2a8877d31076b79a63ecf8a5b3d79577535c
7
- data.tar.gz: 773147cac614399537cc088d92d0df44c457745c4e2b30d2b05f72bdf33070b82a00d4362b64ddff8adffdfb130d214e0096c4ed5f4b9eebcf4f2db9c86d7eda
6
+ metadata.gz: 1d0097a7d05bbc52065e1f32f6fc8f600052f6eeb75a782bfd270763d73df8150fa74fdadb705bc1eb6e448ed725420642cb6aaeb016bfae058718ec3b8fe0ea
7
+ data.tar.gz: 99487e99f6fbfdb52f2b103a2f9fa9504a67253f9591ef3650ccbbcc7eac5cd5ca5170c841e692b17ac9b02d17c356519d6e4a3b7caf3e1a24825e65e3b9aee5
data/CHANGELOG.md CHANGED
@@ -1,3 +1,10 @@
1
+ ## 11.6.0
2
+ - Support additional `oauth` and `sasl` configuration options for configuring kafka client [#189](https://github.com/logstash-plugins/logstash-integration-kafka/pull/189)
3
+
4
+ ## 11.5.4
5
+ - Update kafka client to 3.8.1 and transitive dependencies [#188](https://github.com/logstash-plugins/logstash-integration-kafka/pull/188)
6
+ - Removed Jar Dependencies dependency [#187](https://github.com/logstash-plugins/logstash-integration-kafka/pull/187)
7
+
1
8
  ## 11.5.3
2
9
  - Update kafka client to 3.7.1 and transitive dependencies [#186](https://github.com/logstash-plugins/logstash-integration-kafka/pull/186)
3
10
 
data/docs/index.asciidoc CHANGED
@@ -1,7 +1,7 @@
1
1
  :plugin: kafka
2
2
  :type: integration
3
3
  :no_codec:
4
- :kafka_client: 3.7.1
4
+ :kafka_client: 3.8.1
5
5
 
6
6
  ///////////////////////////////////////////
7
7
  START - GENERATED VARIABLES, DO NOT EDIT!
@@ -2,8 +2,8 @@
2
2
  :plugin: kafka
3
3
  :type: input
4
4
  :default_codec: plain
5
- :kafka_client: 3.7
6
- :kafka_client_doc: 37
5
+ :kafka_client: 3.8.1
6
+ :kafka_client_doc: 38
7
7
 
8
8
  ///////////////////////////////////////////
9
9
  START - GENERATED VARIABLES, DO NOT EDIT!
@@ -131,6 +131,13 @@ See the https://kafka.apache.org/{kafka_client_doc}/documentation for more detai
131
131
  | <<plugins-{type}s-{plugin}-request_timeout_ms>> |<<number,number>>|No
132
132
  | <<plugins-{type}s-{plugin}-retry_backoff_ms>> |<<number,number>>|No
133
133
  | <<plugins-{type}s-{plugin}-sasl_client_callback_handler_class>> |<<string,string>>|No
134
+ | <<plugins-{type}s-{plugin}-sasl_oauthbearer_token_endpoint_url>> |<<string,string>>|No
135
+ | <<plugins-{type}s-{plugin}-sasl_oauthbearer_scope_claim_name>> |<<string,string>>|No
136
+ | <<plugins-{type}s-{plugin}-sasl_login_callback_handler_class>> |<<string,string>>|No
137
+ | <<plugins-{type}s-{plugin}-sasl_login_connect_timeout_ms>> |<<number,number>>|No
138
+ | <<plugins-{type}s-{plugin}-sasl_login_read_timeout_ms>> |<<number,number>>|No
139
+ | <<plugins-{type}s-{plugin}-sasl_login_retry_backoff_ms>> |<<number,number>>|No
140
+ | <<plugins-{type}s-{plugin}-sasl_login_retry_backoff_max_ms>> |<<number,number>>|No
134
141
  | <<plugins-{type}s-{plugin}-sasl_jaas_config>> |<<string,string>>|No
135
142
  | <<plugins-{type}s-{plugin}-sasl_kerberos_service_name>> |<<string,string>>|No
136
143
  | <<plugins-{type}s-{plugin}-sasl_mechanism>> |<<string,string>>|No
@@ -556,13 +563,62 @@ retries are exhausted.
556
563
  The amount of time to wait before attempting to retry a failed fetch request
557
564
  to a given topic partition. This avoids repeated fetching-and-failing in a tight loop.
558
565
 
559
- [id="plugins-{type}s-{plugin}-sasl_client_callback_handler_class""]
566
+ [id="plugins-{type}s-{plugin}-sasl_client_callback_handler_class"]
560
567
  ===== `sasl_client_callback_handler_class`
561
- * Value type is <<string,string>>
562
- * There is no default value for this setting.
568
+ * Value type is <<string,string>>
569
+ * There is no default value for this setting.
563
570
 
564
571
  The SASL client callback handler class the specified SASL mechanism should use.
565
572
 
573
+ [id="plugins-{type}s-{plugin}-sasl_oauthbearer_token_endpoint_url"]
574
+ ===== `sasl_oauthbearer_token_endpoint_url`
575
+ * Value type is <<string,string>>
576
+ * There is no default value for this setting.
577
+
578
+ The URL for the OAuth 2.0 issuer token endpoint.
579
+
580
+ [id="plugins-{type}s-{plugin}-sasl_oauthbearer_scope_claim_name"]
581
+ ===== `sasl_oauthbearer_scope_claim_name`
582
+ * Value type is <<string,string>>
583
+ * Default value is `"scope"`
584
+
585
+ (optional) The override name of the scope claim.
586
+
587
+ [id="plugins-{type}s-{plugin}-sasl_login_callback_handler_class"]
588
+ ===== `sasl_login_callback_handler_class`
589
+ * Value type is <<string,string>>
590
+ * There is no default value for this setting.
591
+
592
+ The SASL login callback handler class the specified SASL mechanism should use.
593
+
594
+ [id="plugins-{type}s-{plugin}-sasl_login_connect_timeout_ms"]
595
+ ===== `sasl_login_connect_timeout_ms`
596
+ * Value type is <<number,number>>
597
+ * There is no default value for this setting.
598
+
599
+ (optional) The duration, in milliseconds, for HTTPS connect timeout
600
+
601
+ [id="plugins-{type}s-{plugin}-sasl_login_read_timeout_ms"]
602
+ ===== `sasl_login_read_timeout_ms`
603
+ * Value type is <<number,number>>
604
+ * There is no default value for this setting.
605
+
606
+ (optional) The duration, in milliseconds, for HTTPS read timeout.
607
+
608
+ [id="plugins-{type}s-{plugin}-sasl_login_retry_backoff_ms"]
609
+ ===== `sasl_login_retry_backoff_ms`
610
+ * Value type is <<number,number>>
611
+ * Default value is `100` milliseconds.
612
+
613
+ (optional) The duration, in milliseconds, to wait between HTTPS call attempts.
614
+
615
+ [id="plugins-{type}s-{plugin}-sasl_login_retry_backoff_max_ms"]
616
+ ===== `sasl_login_retry_backoff_max_ms`
617
+ * Value type is <<number,number>>
618
+ * Default value is `10000` milliseconds.
619
+
620
+ (optional) The maximum duration, in milliseconds, for HTTPS call attempts.
621
+
566
622
  [id="plugins-{type}s-{plugin}-sasl_jaas_config"]
567
623
  ===== `sasl_jaas_config`
568
624
 
@@ -2,8 +2,8 @@
2
2
  :plugin: kafka
3
3
  :type: output
4
4
  :default_codec: plain
5
- :kafka_client: 3.7
6
- :kafka_client_doc: 37
5
+ :kafka_client: 3.8.1
6
+ :kafka_client_doc: 38
7
7
 
8
8
  ///////////////////////////////////////////
9
9
  START - GENERATED VARIABLES, DO NOT EDIT!
@@ -102,6 +102,13 @@ See the https://kafka.apache.org/{kafka_client_doc}/documentation for more detai
102
102
  | <<plugins-{type}s-{plugin}-retries>> |<<number,number>>|No
103
103
  | <<plugins-{type}s-{plugin}-retry_backoff_ms>> |<<number,number>>|No
104
104
  | <<plugins-{type}s-{plugin}-sasl_client_callback_handler_class>> |<<string,string>>|No
105
+ | <<plugins-{type}s-{plugin}-sasl_oauthbearer_token_endpoint_url>> |<<string,string>>|No
106
+ | <<plugins-{type}s-{plugin}-sasl_oauthbearer_scope_claim_name>> |<<string,string>>|No
107
+ | <<plugins-{type}s-{plugin}-sasl_login_callback_handler_class>> |<<string,string>>|No
108
+ | <<plugins-{type}s-{plugin}-sasl_login_connect_timeout_ms>> |<<number,number>>|No
109
+ | <<plugins-{type}s-{plugin}-sasl_login_read_timeout_ms>> |<<number,number>>|No
110
+ | <<plugins-{type}s-{plugin}-sasl_login_retry_backoff_ms>> |<<number,number>>|No
111
+ | <<plugins-{type}s-{plugin}-sasl_login_retry_backoff_max_ms>> |<<number,number>>|No
105
112
  | <<plugins-{type}s-{plugin}-sasl_jaas_config>> |<<string,string>>|No
106
113
  | <<plugins-{type}s-{plugin}-sasl_kerberos_service_name>> |<<string,string>>|No
107
114
  | <<plugins-{type}s-{plugin}-sasl_mechanism>> |<<string,string>>|No
@@ -392,13 +399,62 @@ In versions prior to 10.5.0, any exception is retried indefinitely unless the `r
392
399
 
393
400
  The amount of time to wait before attempting to retry a failed produce request to a given topic partition.
394
401
 
395
- [id="plugins-{type}s-{plugin}-sasl_client_callback_handler_class""]
402
+ [id="plugins-{type}s-{plugin}-sasl_client_callback_handler_class"]
396
403
  ===== `sasl_client_callback_handler_class`
397
- * Value type is <<string,string>>
398
- * There is no default value for this setting.
404
+ * Value type is <<string,string>>
405
+ * There is no default value for this setting.
399
406
 
400
407
  The SASL client callback handler class the specified SASL mechanism should use.
401
408
 
409
+ [id="plugins-{type}s-{plugin}-sasl_oauthbearer_token_endpoint_url"]
410
+ ===== `sasl_oauthbearer_token_endpoint_url`
411
+ * Value type is <<string,string>>
412
+ * There is no default value for this setting.
413
+
414
+ The URL for the OAuth 2.0 issuer token endpoint.
415
+
416
+ [id="plugins-{type}s-{plugin}-sasl_oauthbearer_scope_claim_name"]
417
+ ===== `sasl_oauthbearer_scope_claim_name`
418
+ * Value type is <<string,string>>
419
+ * Default value is `"scope"`
420
+
421
+ (optional) The override name of the scope claim.
422
+
423
+ [id="plugins-{type}s-{plugin}-sasl_login_callback_handler_class"]
424
+ ===== `sasl_login_callback_handler_class`
425
+ * Value type is <<string,string>>
426
+ * There is no default value for this setting.
427
+
428
+ The SASL login callback handler class the specified SASL mechanism should use.
429
+
430
+ [id="plugins-{type}s-{plugin}-sasl_login_connect_timeout_ms"]
431
+ ===== `sasl_login_connect_timeout_ms`
432
+ * Value type is <<number,number>>
433
+ * There is no default value for this setting.
434
+
435
+ (optional) The duration, in milliseconds, for HTTPS connect timeout
436
+
437
+ [id="plugins-{type}s-{plugin}-sasl_login_read_timeout_ms"]
438
+ ===== `sasl_login_read_timeout_ms`
439
+ * Value type is <<number,number>>
440
+ * There is no default value for this setting.
441
+
442
+ (optional) The duration, in milliseconds, for HTTPS read timeout.
443
+
444
+ [id="plugins-{type}s-{plugin}-sasl_login_retry_backoff_ms"]
445
+ ===== `sasl_login_retry_backoff_ms`
446
+ * Value type is <<number,number>>
447
+ * Default value is `100` milliseconds.
448
+
449
+ (optional) The duration, in milliseconds, to wait between HTTPS call attempts.
450
+
451
+ [id="plugins-{type}s-{plugin}-sasl_login_retry_backoff_max_ms"]
452
+ ===== `sasl_login_retry_backoff_max_ms`
453
+ * Value type is <<number,number>>
454
+ * Default value is `10000` milliseconds.
455
+
456
+ (optional) The maximum duration, in milliseconds, for HTTPS call attempts.
457
+
402
458
  [id="plugins-{type}s-{plugin}-sasl_jaas_config"]
403
459
  ===== `sasl_jaas_config`
404
460
 
@@ -210,6 +210,20 @@ class LogStash::Inputs::Kafka < LogStash::Inputs::Base
210
210
  config :security_protocol, :validate => ["PLAINTEXT", "SSL", "SASL_PLAINTEXT", "SASL_SSL"], :default => "PLAINTEXT"
211
211
  # SASL client callback handler class
212
212
  config :sasl_client_callback_handler_class, :validate => :string
213
+ # The URL for the OAuth 2.0 issuer token endpoint.
214
+ config :sasl_oauthbearer_token_endpoint_url, :validate => :string
215
+ # (optional) The override name of the scope claim.
216
+ config :sasl_oauthbearer_scope_claim_name, :validate => :string, :default => 'scope' # Kafka default
217
+ # SASL login callback handler class
218
+ config :sasl_login_callback_handler_class, :validate => :string
219
+ # (optional) The duration, in milliseconds, for HTTPS connect timeout
220
+ config :sasl_login_connect_timeout_ms, :validate => :number
221
+ # (optional) The duration, in milliseconds, for HTTPS read timeout.
222
+ config :sasl_login_read_timeout_ms, :validate => :number
223
+ # (optional) The duration, in milliseconds, to wait between HTTPS call attempts.
224
+ config :sasl_login_retry_backoff_ms, :validate => :number, :default => 100 # Kafka default
225
+ # (optional) The maximum duration, in milliseconds, for HTTPS call attempts.
226
+ config :sasl_login_retry_backoff_max_ms, :validate => :number, :default => 10000 # Kafka default
213
227
  # http://kafka.apache.org/documentation.html#security_sasl[SASL mechanism] used for client connections.
214
228
  # This may be any mechanism for which a security provider is available.
215
229
  # GSSAPI is the default mechanism.
@@ -149,6 +149,20 @@ class LogStash::Outputs::Kafka < LogStash::Outputs::Base
149
149
  config :security_protocol, :validate => ["PLAINTEXT", "SSL", "SASL_PLAINTEXT", "SASL_SSL"], :default => "PLAINTEXT"
150
150
  # SASL client callback handler class
151
151
  config :sasl_client_callback_handler_class, :validate => :string
152
+ # The URL for the OAuth 2.0 issuer token endpoint.
153
+ config :sasl_oauthbearer_token_endpoint_url, :validate => :string
154
+ # (optional) The override name of the scope claim.
155
+ config :sasl_oauthbearer_scope_claim_name, :validate => :string, :default => 'scope' # Kafka default
156
+ # SASL login callback handler class
157
+ config :sasl_login_callback_handler_class, :validate => :string
158
+ # (optional) The duration, in milliseconds, for HTTPS connect timeout
159
+ config :sasl_login_connect_timeout_ms, :validate => :number
160
+ # (optional) The duration, in milliseconds, for HTTPS read timeout.
161
+ config :sasl_login_read_timeout_ms, :validate => :number
162
+ # (optional) The duration, in milliseconds, to wait between HTTPS call attempts.
163
+ config :sasl_login_retry_backoff_ms, :validate => :number, :default => 100 # Kafka default
164
+ # (optional) The maximum duration, in milliseconds, for HTTPS call attempts.
165
+ config :sasl_login_retry_backoff_max_ms, :validate => :number, :default => 10000 # Kafka default
152
166
  # http://kafka.apache.org/documentation.html#security_sasl[SASL mechanism] used for client connections.
153
167
  # This may be any mechanism for which a security provider is available.
154
168
  # GSSAPI is the default mechanism.
@@ -42,6 +42,13 @@ module LogStash module PluginMixins module Kafka
42
42
  props.put("sasl.kerberos.service.name", sasl_kerberos_service_name) unless sasl_kerberos_service_name.nil?
43
43
  props.put("sasl.jaas.config", sasl_jaas_config) unless sasl_jaas_config.nil?
44
44
  props.put("sasl.client.callback.handler.class", sasl_client_callback_handler_class) unless sasl_client_callback_handler_class.nil?
45
+ props.put("sasl.oauthbearer.token.endpoint.url", sasl_oauthbearer_token_endpoint_url) unless sasl_oauthbearer_token_endpoint_url.nil?
46
+ props.put("sasl.oauthbearer.scope.claim.name", sasl_oauthbearer_scope_claim_name) unless sasl_oauthbearer_scope_claim_name.nil?
47
+ props.put("sasl.login.callback.handler.class", sasl_login_callback_handler_class) unless sasl_login_callback_handler_class.nil?
48
+ props.put("sasl.login.connect.timeout.ms", sasl_login_connect_timeout_ms.to_s) unless sasl_login_connect_timeout_ms.nil?
49
+ props.put("sasl.login.read.timeout.ms", sasl_login_read_timeout_ms.to_s) unless sasl_login_read_timeout_ms.nil?
50
+ props.put("sasl.login.retry.backoff.ms", sasl_login_retry_backoff_ms.to_s) unless sasl_login_retry_backoff_ms.nil?
51
+ props.put("sasl.login.retry.backoff.max.ms", sasl_login_retry_backoff_max_ms.to_s) unless sasl_login_retry_backoff_max_ms.nil?
45
52
  end
46
53
 
47
54
  def reassign_dns_lookup
@@ -1,11 +1,11 @@
1
1
  # AUTOGENERATED BY THE GRADLE SCRIPT. DO NOT EDIT.
2
2
 
3
3
  require 'jar_dependencies'
4
- require_jar('io.confluent', 'kafka-avro-serializer', '7.7.1')
5
- require_jar('io.confluent', 'kafka-schema-serializer', '7.7.1')
4
+ require_jar('io.confluent', 'kafka-avro-serializer', '7.8.0')
5
+ require_jar('io.confluent', 'kafka-schema-serializer', '7.8.0')
6
6
  require_jar('org.apache.avro', 'avro', '1.11.4')
7
- require_jar('io.confluent', 'kafka-schema-registry-client', '7.7.1')
8
- require_jar('org.apache.kafka', 'kafka-clients', '3.7.1')
7
+ require_jar('io.confluent', 'kafka-schema-registry-client', '7.8.0')
8
+ require_jar('org.apache.kafka', 'kafka-clients', '3.8.1')
9
9
  require_jar('org.slf4j', 'slf4j-api', '1.7.36')
10
10
  require_jar('com.github.luben', 'zstd-jni', '1.5.6-8')
11
11
  require_jar('org.lz4', 'lz4-java', '1.8.0')
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = 'logstash-integration-kafka'
3
- s.version = '11.5.3'
3
+ s.version = '11.6.0'
4
4
  s.licenses = ['Apache-2.0']
5
5
  s.summary = "Integration with Kafka - input and output plugins"
6
6
  s.description = "This gem is a Logstash plugin required to be installed on top of the Logstash core pipeline "+
@@ -35,8 +35,6 @@ Gem::Specification.new do |s|
35
35
  "integration_plugins" => "logstash-input-kafka,logstash-output-kafka"
36
36
  }
37
37
 
38
- s.add_development_dependency 'jar-dependencies', '>= 0.3.12'
39
-
40
38
  s.platform = RUBY_PLATFORM
41
39
 
42
40
  # Gem dependencies
@@ -218,6 +218,54 @@ describe LogStash::Inputs::Kafka do
218
218
 
219
219
  end
220
220
 
221
+ context 'when oauth is configured' do
222
+ let(:config) { super().merge(
223
+ 'security_protocol' => 'SASL_PLAINTEXT',
224
+ 'sasl_mechanism' => 'OAUTHBEARER',
225
+ 'sasl_oauthbearer_token_endpoint_url' => 'https://auth.example.com/token',
226
+ 'sasl_oauthbearer_scope_claim_name' => 'custom_scope'
227
+ )}
228
+
229
+ it "sets oauth properties" do
230
+ expect(org.apache.kafka.clients.consumer.KafkaConsumer).
231
+ to receive(:new).with(hash_including(
232
+ 'security.protocol' => 'SASL_PLAINTEXT',
233
+ 'sasl.mechanism' => 'OAUTHBEARER',
234
+ 'sasl.oauthbearer.token.endpoint.url' => 'https://auth.example.com/token',
235
+ 'sasl.oauthbearer.scope.claim.name' => 'custom_scope'
236
+ )).and_return(kafka_client = double('kafka-consumer'))
237
+
238
+ expect(subject.send(:create_consumer, 'test-client-1', 'group_instance_id')).to be kafka_client
239
+ end
240
+ end
241
+
242
+ context 'when sasl is configured' do
243
+ let(:config) { super().merge(
244
+ 'security_protocol' => 'SASL_PLAINTEXT',
245
+ 'sasl_mechanism' => 'OAUTHBEARER',
246
+ 'sasl_login_connect_timeout_ms' => 15000,
247
+ 'sasl_login_read_timeout_ms' => 5000,
248
+ 'sasl_login_retry_backoff_ms' => 200,
249
+ 'sasl_login_retry_backoff_max_ms' => 15000,
250
+ 'sasl_login_callback_handler_class' => 'org.example.CustomLoginHandler'
251
+ )}
252
+
253
+ it "sets sasl login properties" do
254
+ expect(org.apache.kafka.clients.consumer.KafkaConsumer).
255
+ to receive(:new).with(hash_including(
256
+ 'security.protocol' => 'SASL_PLAINTEXT',
257
+ 'sasl.mechanism' => 'OAUTHBEARER',
258
+ 'sasl.login.connect.timeout.ms' => '15000',
259
+ 'sasl.login.read.timeout.ms' => '5000',
260
+ 'sasl.login.retry.backoff.ms' => '200',
261
+ 'sasl.login.retry.backoff.max.ms' => '15000',
262
+ 'sasl.login.callback.handler.class' => 'org.example.CustomLoginHandler'
263
+ )).and_return(kafka_client = double('kafka-consumer'))
264
+
265
+ expect(subject.send(:create_consumer, 'test-client-2', 'group_instance_id')).to be kafka_client
266
+ end
267
+ end
268
+
221
269
  describe "schema registry" do
222
270
  let(:base_config) do {
223
271
  'schema_registry_url' => 'http://localhost:8081',
@@ -9,6 +9,7 @@ describe "outputs/kafka" do
9
9
  '@timestamp' => LogStash::Timestamp.now}) }
10
10
 
11
11
  let(:future) { double('kafka producer future') }
12
+ subject { LogStash::Outputs::Kafka.new(config) }
12
13
 
13
14
  context 'when initializing' do
14
15
  it "should register" do
@@ -267,8 +268,6 @@ describe "outputs/kafka" do
267
268
  File.join(File.dirname(__FILE__), '../../fixtures/trust-store_stub.jks')
268
269
  end
269
270
 
270
- subject { LogStash::Outputs::Kafka.new(config) }
271
-
272
271
  it 'sets empty ssl.endpoint.identification.algorithm' do
273
272
  expect(org.apache.kafka.clients.producer.KafkaProducer).
274
273
  to receive(:new).with(hash_including('ssl.endpoint.identification.algorithm' => ''))
@@ -283,4 +282,53 @@ describe "outputs/kafka" do
283
282
 
284
283
  end
285
284
 
285
+ context 'when oauth is configured' do
286
+ let(:config) {
287
+ simple_kafka_config.merge(
288
+ 'security_protocol' => 'SASL_PLAINTEXT',
289
+ 'sasl_mechanism' => 'OAUTHBEARER',
290
+ 'sasl_oauthbearer_token_endpoint_url' => 'https://auth.example.com/token',
291
+ 'sasl_oauthbearer_scope_claim_name' => 'custom_scope'
292
+ )
293
+ }
294
+
295
+ it "sets oauth properties" do
296
+ expect(org.apache.kafka.clients.producer.KafkaProducer).
297
+ to receive(:new).with(hash_including(
298
+ 'security.protocol' => 'SASL_PLAINTEXT',
299
+ 'sasl.mechanism' => 'OAUTHBEARER',
300
+ 'sasl.oauthbearer.token.endpoint.url' => 'https://auth.example.com/token',
301
+ 'sasl.oauthbearer.scope.claim.name' => 'custom_scope'
302
+ ))
303
+ subject.register
304
+ end
305
+ end
306
+
307
+ context 'when sasl is configured' do
308
+ let(:config) {
309
+ simple_kafka_config.merge(
310
+ 'security_protocol' => 'SASL_PLAINTEXT',
311
+ 'sasl_mechanism' => 'OAUTHBEARER',
312
+ 'sasl_login_connect_timeout_ms' => 15000,
313
+ 'sasl_login_read_timeout_ms' => 5000,
314
+ 'sasl_login_retry_backoff_ms' => 200,
315
+ 'sasl_login_retry_backoff_max_ms' => 15000,
316
+ 'sasl_login_callback_handler_class' => 'org.example.CustomLoginHandler'
317
+ )
318
+ }
319
+
320
+ it "sets sasl login properties" do
321
+ expect(org.apache.kafka.clients.producer.KafkaProducer).
322
+ to receive(:new).with(hash_including(
323
+ 'security.protocol' => 'SASL_PLAINTEXT',
324
+ 'sasl.mechanism' => 'OAUTHBEARER',
325
+ 'sasl.login.connect.timeout.ms' => '15000',
326
+ 'sasl.login.read.timeout.ms' => '5000',
327
+ 'sasl.login.retry.backoff.ms' => '200',
328
+ 'sasl.login.retry.backoff.max.ms' => '15000',
329
+ 'sasl.login.callback.handler.class' => 'org.example.CustomLoginHandler'
330
+ ))
331
+ subject.register
332
+ end
333
+ end
286
334
  end
metadata CHANGED
@@ -1,29 +1,15 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: logstash-integration-kafka
3
3
  version: !ruby/object:Gem::Version
4
- version: 11.5.3
4
+ version: 11.6.0
5
5
  platform: java
6
6
  authors:
7
7
  - Elastic
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-11-25 00:00:00.000000000 Z
11
+ date: 2025-01-07 00:00:00.000000000 Z
12
12
  dependencies:
13
- - !ruby/object:Gem::Dependency
14
- requirement: !ruby/object:Gem::Requirement
15
- requirements:
16
- - - ">="
17
- - !ruby/object:Gem::Version
18
- version: 0.3.12
19
- name: jar-dependencies
20
- type: :development
21
- prerelease: false
22
- version_requirements: !ruby/object:Gem::Requirement
23
- requirements:
24
- - - ">="
25
- - !ruby/object:Gem::Version
26
- version: 0.3.12
27
13
  - !ruby/object:Gem::Dependency
28
14
  requirement: !ruby/object:Gem::Requirement
29
15
  requirements:
@@ -258,11 +244,11 @@ files:
258
244
  - spec/unit/inputs/kafka_spec.rb
259
245
  - spec/unit/outputs/kafka_spec.rb
260
246
  - vendor/jar-dependencies/com/github/luben/zstd-jni/1.5.6-8/zstd-jni-1.5.6-8.jar
261
- - vendor/jar-dependencies/io/confluent/kafka-avro-serializer/7.7.1/kafka-avro-serializer-7.7.1.jar
262
- - vendor/jar-dependencies/io/confluent/kafka-schema-registry-client/7.7.1/kafka-schema-registry-client-7.7.1.jar
263
- - vendor/jar-dependencies/io/confluent/kafka-schema-serializer/7.7.1/kafka-schema-serializer-7.7.1.jar
247
+ - vendor/jar-dependencies/io/confluent/kafka-avro-serializer/7.8.0/kafka-avro-serializer-7.8.0.jar
248
+ - vendor/jar-dependencies/io/confluent/kafka-schema-registry-client/7.8.0/kafka-schema-registry-client-7.8.0.jar
249
+ - vendor/jar-dependencies/io/confluent/kafka-schema-serializer/7.8.0/kafka-schema-serializer-7.8.0.jar
264
250
  - vendor/jar-dependencies/org/apache/avro/avro/1.11.4/avro-1.11.4.jar
265
- - vendor/jar-dependencies/org/apache/kafka/kafka-clients/3.7.1/kafka-clients-3.7.1.jar
251
+ - vendor/jar-dependencies/org/apache/kafka/kafka-clients/3.8.1/kafka-clients-3.8.1.jar
266
252
  - vendor/jar-dependencies/org/lz4/lz4-java/1.8.0/lz4-java-1.8.0.jar
267
253
  - vendor/jar-dependencies/org/slf4j/slf4j-api/1.7.36/slf4j-api-1.7.36.jar
268
254
  - vendor/jar-dependencies/org/xerial/snappy/snappy-java/1.1.10.7/snappy-java-1.1.10.7.jar