logstash-integration-kafka 10.7.7-java → 10.8.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: 7a9e872c7a49cd1eb9fc9709c10be72d1c9609b0f19ef5550a2dd7cb317a925e
4
- data.tar.gz: b0541ab279e7b7fcea74f1a951e7916abf54adde8bae60e2c4b5897b6f4daadb
3
+ metadata.gz: a322e757007ef9c740f48a93ebe97aa50511a29b17450219ea4f2d08a49934e1
4
+ data.tar.gz: 111a1d72591d14876f33dba65cfc29e6c9ae397397f295e3a94e5078b413eb3a
5
5
  SHA512:
6
- metadata.gz: 1e53d939b471032107afaeb2b7656bf6c755d803e1effbda487b953ae6cc0b79fd97458834d079168023e0ecfa8aeec67a474dc1a4a99336a7be10af3d1b6412
7
- data.tar.gz: bea64e388923bab253278e46eccc0701c2bda8f3067cc1e429223fbc3f9cd3a797ced2e334755bbbe3bbf1cf711237359d85e1c6ec22cde822ced2285840fd9f
6
+ metadata.gz: bac61cfb956bb284df97746df68afc90b12b1d04186eba0cf27fc68886858dad965aefcf46566dc8e27e8a484b524c7ce8d3185d24d9412798e06defc9f78ab8
7
+ data.tar.gz: f706aaad143f31fdd31ea47c5d1604f490f505f08329ecd07dff75201c51d1983701e79e2f74a52f484c860eb026a26880447e3b89a985dffeb7367728cab1ef
data/CHANGELOG.md CHANGED
@@ -1,3 +1,7 @@
1
+ ## 10.8.0
2
+ - Added config setting to enable schema registry validation to be skipped when an authentication scheme unsupported
3
+ by the validator is used [#97](https://github.com/logstash-plugins/logstash-integration-kafka/pull/97)
4
+
1
5
  ## 10.7.7
2
6
  - Fix: Correct the settings to allow basic auth to work properly, either by setting `schema_registry_key/secret` or embedding username/password in the
3
7
  url [#94](https://github.com/logstash-plugins/logstash-integration-kafka/pull/94)
@@ -128,6 +128,7 @@ See the https://kafka.apache.org/{kafka_client_doc}/documentation for more detai
128
128
  | <<plugins-{type}s-{plugin}-schema_registry_proxy>> |<<uri,uri>>|No
129
129
  | <<plugins-{type}s-{plugin}-schema_registry_secret>> |<<string,string>>|No
130
130
  | <<plugins-{type}s-{plugin}-schema_registry_url>> |<<uri,uri>>|No
131
+ | <<plugins-{type}s-{plugin}-schema_registry_validation>> |<<string,string>>|No
131
132
  | <<plugins-{type}s-{plugin}-security_protocol>> |<<string,string>>, one of `["PLAINTEXT", "SSL", "SASL_PLAINTEXT", "SASL_SSL"]`|No
132
133
  | <<plugins-{type}s-{plugin}-send_buffer_bytes>> |<<number,number>>|No
133
134
  | <<plugins-{type}s-{plugin}-session_timeout_ms>> |<<number,number>>|No
@@ -576,6 +577,18 @@ The schemas must follow a naming convention with the pattern <topic name>-value.
576
577
  Use either the Schema Registry config option or the
577
578
  <<plugins-{type}s-{plugin}-value_deserializer_class>> config option, but not both.
578
579
 
580
+ [id="plugins-{type}s-{plugin}-schema_registry_validation"]
581
+ ===== `schema_registry_validation`
582
+
583
+ * Value can be either of: `auto`, `skip`
584
+ * Default value is `"auto"`
585
+
586
+ NOTE: Under most circumstances, the default setting of `auto` should not need to be changed.
587
+
588
+ When using the schema registry, by default the plugin checks connectivity and validates the schema registry, during plugin registration, before events are processed.
589
+ In some circumstances, this process may fail when it tries to validate an authenticated schema registry, causing the plugin to crash.
590
+ This setting allows the plugin to skip validation during registration, which allows the plugin to continue and events to be processed. Note that an incorrectly configured schema registry will still stop the plugin from processing events.
591
+
579
592
  [id="plugins-{type}s-{plugin}-security_protocol"]
580
593
  ===== `security_protocol`
581
594
 
@@ -22,6 +22,10 @@ module LogStash
22
22
  # Option to set the proxy of the Schema Registry.
23
23
  # This option permits to define a proxy to be used to reach the schema registry service instance.
24
24
  config :schema_registry_proxy, :validate => :uri
25
+
26
+ # Option to skip validating the schema registry during registration. This can be useful when using
27
+ # certificate based auth
28
+ config :schema_registry_validation, :validate => ['auto', 'skip'], :default => 'auto'
25
29
  end
26
30
 
27
31
  def check_schema_registry_parameters
@@ -29,10 +33,21 @@ module LogStash
29
33
  check_for_schema_registry_conflicts
30
34
  @schema_registry_proxy_host, @schema_registry_proxy_port = split_proxy_into_host_and_port(schema_registry_proxy)
31
35
  check_for_key_and_secret
32
- check_for_schema_registry_connectivity_and_subjects
36
+ check_for_schema_registry_connectivity_and_subjects if schema_registry_validation?
33
37
  end
34
38
  end
35
39
 
40
+ def schema_registry_validation?
41
+ return false if schema_registry_validation.to_s == 'skip'
42
+ return false if using_kerberos? # pre-validation doesn't support kerberos
43
+
44
+ true
45
+ end
46
+
47
+ def using_kerberos?
48
+ security_protocol == "SASL_PLAINTEXT" || security_protocol == "SASL_SSL"
49
+ end
50
+
36
51
  private
37
52
  def check_for_schema_registry_conflicts
38
53
  if @value_deserializer_class != LogStash::Inputs::Kafka::DEFAULT_DESERIALIZER_CLASS
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = 'logstash-integration-kafka'
3
- s.version = '10.7.7'
3
+ s.version = '10.8.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 "+
@@ -177,11 +177,16 @@ describe LogStash::Inputs::Kafka do
177
177
  end
178
178
  end
179
179
 
180
- context "register parameter verification" do
180
+ describe "schema registry parameter verification" do
181
+ let(:base_config) do {
182
+ 'schema_registry_url' => 'http://localhost:8081',
183
+ 'topics' => ['logstash'],
184
+ 'consumer_threads' => 4
185
+ }
186
+ end
187
+
181
188
  context "schema_registry_url" do
182
- let(:config) do
183
- { 'schema_registry_url' => 'http://localhost:8081', 'topics' => ['logstash'], 'consumer_threads' => 4 }
184
- end
189
+ let(:config) { base_config }
185
190
 
186
191
  it "conflict with value_deserializer_class should fail" do
187
192
  config['value_deserializer_class'] = 'my.fantasy.Deserializer'
@@ -194,19 +199,63 @@ describe LogStash::Inputs::Kafka do
194
199
  end
195
200
  end
196
201
 
197
- context "decorate_events" do
198
- let(:config) { { 'decorate_events' => 'extended'} }
202
+ context 'when kerberos auth is used' do
203
+ ['SASL_SSL', 'SASL_PLAINTEXT'].each do |protocol|
204
+ context "with #{protocol}" do
205
+ ['auto', 'skip'].each do |vsr|
206
+ context "when validata_schema_registry is #{vsr}" do
207
+ let(:config) { base_config.merge({'security_protocol' => protocol,
208
+ 'schema_registry_validation' => vsr})
209
+ }
210
+ it 'skips verification' do
211
+ expect(subject).not_to receive(:check_for_schema_registry_connectivity_and_subjects)
212
+ expect { subject.register }.not_to raise_error
213
+ end
214
+ end
215
+ end
216
+ end
217
+ end
218
+ end
199
219
 
200
- it "should raise error for invalid value" do
201
- config['decorate_events'] = 'avoid'
202
- expect { subject.register }.to raise_error LogStash::ConfigurationError, /Something is wrong with your configuration./
220
+ context 'when kerberos auth is not used' do
221
+ context "when skip_verify is set to auto" do
222
+ let(:config) { base_config.merge({'schema_registry_validation' => 'auto'})}
223
+ it 'performs verification' do
224
+ expect(subject).to receive(:check_for_schema_registry_connectivity_and_subjects)
225
+ expect { subject.register }.not_to raise_error
226
+ end
203
227
  end
204
228
 
205
- it "should map old true boolean value to :record_props mode" do
206
- config['decorate_events'] = "true"
207
- subject.register
208
- expect(subject.metadata_mode).to include(:record_props)
229
+ context "when skip_verify is set to default" do
230
+ let(:config) { base_config }
231
+ it 'performs verification' do
232
+ expect(subject).to receive(:check_for_schema_registry_connectivity_and_subjects)
233
+ expect { subject.register }.not_to raise_error
234
+ end
209
235
  end
236
+
237
+ context "when skip_verify is set to skip" do
238
+ let(:config) { base_config.merge({'schema_registry_validation' => 'skip'})}
239
+ it 'should skip verification' do
240
+ expect(subject).not_to receive(:check_for_schema_registry_connectivity_and_subjects)
241
+ expect { subject.register }.not_to raise_error
242
+ end
243
+ end
244
+ end
245
+ end
246
+
247
+ context "decorate_events" do
248
+ let(:config) { { 'decorate_events' => 'extended'} }
249
+
250
+ it "should raise error for invalid value" do
251
+ config['decorate_events'] = 'avoid'
252
+ expect { subject.register }.to raise_error LogStash::ConfigurationError, /Something is wrong with your configuration./
253
+ end
254
+
255
+ it "should map old true boolean value to :record_props mode" do
256
+ config['decorate_events'] = "true"
257
+ subject.register
258
+ expect(subject.metadata_mode).to include(:record_props)
210
259
  end
211
260
  end
212
261
 
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: 10.7.7
4
+ version: 10.8.0
5
5
  platform: java
6
6
  authors:
7
7
  - Elastic
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-07-06 00:00:00.000000000 Z
11
+ date: 2021-07-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  requirement: !ruby/object:Gem::Requirement