logstash-integration-kafka 11.5.4-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: 2aa0fa8dec3f2fd40ca01d9204dfbacb514635584e9dd36d2b6eb26df2920801
4
- data.tar.gz: b887f71474c06efbdf342c512fa6a37c14d8500fabb5a6cdd9c5373c2d7b192d
3
+ metadata.gz: 9d342010bbdc6c64b7380374583eb1d33648c5cd9e8b948e6d40c9c62c120963
4
+ data.tar.gz: 3bcf9b167d4cb7cc6d2857d6f81dce26bf09120fed71a2a75d7a54137f6d4a0a
5
5
  SHA512:
6
- metadata.gz: 29297b83b191648c25a9cab409c0dd7b6182e517e6583a40ae5462a9bb249a47a7ef815a83579ea14dbc5207d3773f7e502a8af484340d1a48db66e5ccfeaf76
7
- data.tar.gz: e4b7b2334cb17197c11f5cabf140cc3e67e4d5d96203b11b5187411482a957236d292edda61868562823daf559bac89430c99d9a73c9ba4392f62d3830babd0f
6
+ metadata.gz: 1d0097a7d05bbc52065e1f32f6fc8f600052f6eeb75a782bfd270763d73df8150fa74fdadb705bc1eb6e448ed725420642cb6aaeb016bfae058718ec3b8fe0ea
7
+ data.tar.gz: 99487e99f6fbfdb52f2b103a2f9fa9504a67253f9591ef3650ccbbcc7eac5cd5ca5170c841e692b17ac9b02d17c356519d6e4a3b7caf3e1a24825e65e3b9aee5
data/CHANGELOG.md CHANGED
@@ -1,3 +1,6 @@
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
+
1
4
  ## 11.5.4
2
5
  - Update kafka client to 3.8.1 and transitive dependencies [#188](https://github.com/logstash-plugins/logstash-integration-kafka/pull/188)
3
6
  - Removed Jar Dependencies dependency [#187](https://github.com/logstash-plugins/logstash-integration-kafka/pull/187)
@@ -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
 
@@ -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,6 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = 'logstash-integration-kafka'
3
- s.version = '11.5.4'
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 "+
@@ -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,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: logstash-integration-kafka
3
3
  version: !ruby/object:Gem::Version
4
- version: 11.5.4
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-12-18 00:00:00.000000000 Z
11
+ date: 2025-01-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  requirement: !ruby/object:Gem::Requirement