logstash-input-tcp 5.2.1-java → 5.2.5-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: 6ee7c79fca2dceea8688b100903ab8318ad2cd652740b0538c102504209bd1e0
4
- data.tar.gz: fee6f5e7d1804c8ef60fd771a3d50caeeee289c9e517a93c2a33a5d207202bdb
3
+ metadata.gz: eeb327ea4a6ee534cbaf7844b90492296ed940792dd7801e753b8866d51287a1
4
+ data.tar.gz: 4d71e276661849f6730e7f765b9a4202f75dd3ebc5668011d9dc7bafdc4de9ab
5
5
  SHA512:
6
- metadata.gz: 970218c4f6ed173209de6d40113423a49e356e1eeb3a8cf8603b5ddd7c51ae4766cadf73e78d917a17ba36b4d447fc1d9512ea12081dbd1cbb2e28e0f8ea9340
7
- data.tar.gz: 0b4120780dcae5f582c118247a064025a57f998ddbe20ff5cb15d3c4ecbdef0a0a522cd6bd2968e77db75ff034d6810f4e13f8372f2de49ce08ea1cada19e573
6
+ metadata.gz: 5f7351ec1cdf22d72507349dc1d7c7c1b933b5ea28f66ab2c3cc2477123cddfe0af4b41f270e6a1bbba5a6703f444b4ead434bc056fa72e18b7119209e29db75
7
+ data.tar.gz: 8eb0a4174e5c5f9405627762dc76b8100a8b1b6cf42dc4767c488ebf6ca62121ab05b9bcc74b6fd92c539468ec59f79cb46a8a3f739db79c2fd81f24f6e01bc8
data/CHANGELOG.md CHANGED
@@ -1,3 +1,16 @@
1
+ ## 5.2.5
2
+ - Update Log4j dependency to 2.17
3
+
4
+ ## 5.2.4
5
+ - Update Log4j dependency to 2.16, ensuring this plugin's runtime relies only on log4j-api instead
6
+ of providing its own log4j-core [#189](https://github.com/logstash-plugins/logstash-input-tcp/pull/189)
7
+
8
+ ## 5.2.3
9
+ - Skip empty lines while reading certificate files [#144](https://github.com/logstash-plugins/logstash-input-tcp/issues/144)
10
+
11
+ ## 5.2.2
12
+ - Fixed race condition where data would be accepted before queue was configured [#142](https://github.com/logstash-plugins/logstash-input-tcp/pull/142)
13
+
1
14
  ## 5.2.1
2
15
  - Support multiple certificates per file [#140](https://github.com/logstash-plugins/logstash-input-tcp/pull/140)
3
16
  - Fixed support for encrypted pkcs8 private keys [#133](https://github.com/logstash-plugins/logstash-input-tcp/pull/133)
@@ -127,12 +127,19 @@ class SslOptions
127
127
 
128
128
  private
129
129
  def fetch_certificates_from_file(file, cf)
130
- fis = FileInputStream.new(file)
130
+ fis = java.io.FileInputStream.new(file)
131
131
 
132
132
  while (fis.available > 0) do
133
- yield cf.generateCertificate(fis)
133
+ cert = generate_certificate(cf, fis)
134
+ yield cert if cert
134
135
  end
135
136
  ensure
136
137
  fis.close if fis
137
138
  end
139
+
140
+ def generate_certificate(cf, fis)
141
+ cf.generateCertificate(fis)
142
+ rescue Java::JavaSecurityCert::CertificateException => e
143
+ raise e unless e.cause.message == "Empty input"
144
+ end
138
145
  end
@@ -141,11 +141,6 @@ class LogStash::Inputs::Tcp < LogStash::Inputs::Base
141
141
  def register
142
142
  fix_streaming_codecs
143
143
 
144
- # note that since we are opening a socket in register, we must also make sure we close it
145
- # in the close method even if we also close it in the stop method since we could have
146
- # a situation where register is called but not run & stop.
147
-
148
- @logger.info("Starting tcp input listener", :address => "#{@host}:#{@port}", :ssl_enable => "#{@ssl_enable}")
149
144
  if server?
150
145
  ssl_context = get_ssl_context(SslOptions)
151
146
 
@@ -157,6 +152,7 @@ class LogStash::Inputs::Tcp < LogStash::Inputs::Base
157
152
  def run(output_queue)
158
153
  @output_queue = output_queue
159
154
  if server?
155
+ @logger.info("Starting tcp input listener", :address => "#{@host}:#{@port}", :ssl_enable => "#{@ssl_enable}")
160
156
  @loop.run
161
157
  else
162
158
  run_client()
@@ -31,7 +31,11 @@ Gem::Specification.new do |s|
31
31
  s.add_runtime_dependency 'logstash-codec-json_lines'
32
32
  s.add_runtime_dependency 'logstash-codec-multiline'
33
33
 
34
- s.add_development_dependency 'logstash-devutils'
34
+ # 5.x branch of this plugin provides support for LS5&6.
35
+ # To use LS7+, you must use v6+ of this plugin.
36
+ s.add_runtime_dependency 'logstash-core', '< 7.0.0'
37
+
38
+ s.add_development_dependency 'logstash-devutils', '~> 1.0'
35
39
  s.add_development_dependency 'flores', '~> 0.0.6'
36
40
  s.add_development_dependency 'stud', '~> 0.0.22'
37
41
  end
@@ -382,6 +382,35 @@ describe LogStash::Inputs::Tcp do
382
382
  ssc.delete
383
383
  end
384
384
  end
385
+
386
+ context "with multiple certificates with empty spaces in them" do
387
+ let(:ssc) { SelfSignedCertificate.new }
388
+ let(:certificate_file) { ssc.certificate }
389
+ let(:key_file) { ssc.private_key}
390
+ let(:ssc_2) { SelfSignedCertificate.new }
391
+ let(:certificate_file_2) { ssc.certificate }
392
+ let(:config) do
393
+ {
394
+ "host" => "127.0.0.1",
395
+ "port" => port,
396
+ "ssl_enable" => true,
397
+ "ssl_cert" => certificate_file.path,
398
+ "ssl_key" => key_file.path
399
+ }
400
+ end
401
+ before(:each) do
402
+ File.open(certificate_file.path, "a") do |file|
403
+ path = ssc_2.certificate.path
404
+ file.puts("\n")
405
+ file.puts(IO.read(path))
406
+ file.puts("\n")
407
+ end
408
+ end
409
+
410
+ it "should register without errors" do
411
+ expect { subject.register }.to_not raise_error
412
+ end
413
+ end
385
414
  end
386
415
  end
387
416
 
@@ -399,12 +428,7 @@ describe LogStash::Inputs::Tcp do
399
428
  chain_of_certificates = TcpHelpers.new.chain_of_certificates
400
429
 
401
430
  let(:tcp) do
402
- begin
403
- socket = TCPSocket.new("127.0.0.1", port)
404
- rescue Errno::ECONNREFUSED
405
- sleep 1
406
- socket = TCPSocket.new("127.0.0.1", port)
407
- end
431
+ Stud::try(5.times) { TCPSocket.new("127.0.0.1", port) }
408
432
  end
409
433
  let(:sslcontext) do
410
434
  sslcontext = OpenSSL::SSL::SSLContext.new
@@ -502,14 +526,8 @@ describe LogStash::Inputs::Tcp do
502
526
 
503
527
  context "that disconnects before doing TLS handshake" do
504
528
  before do
505
- begin
506
- client = TCPSocket.new("127.0.0.1", port)
507
- client.close
508
- rescue Errno::ECONNREFUSED
509
- sleep 1
510
- client = TCPSocket.new("127.0.0.1", port)
511
- client.close
512
- end
529
+ client = Stud::try(5.times) { TCPSocket.new("127.0.0.1", port) }
530
+ client.close
513
531
  end
514
532
 
515
533
  it "should not negatively impact the plugin" do
@@ -540,7 +558,7 @@ describe LogStash::Inputs::Tcp do
540
558
  # Assertion to verify this test is actually sending something.
541
559
  expect(garbage.length).to be > 0
542
560
 
543
- client = TCPSocket.new("127.0.0.1", port)
561
+ client = Stud::try(5.times) { TCPSocket.new("127.0.0.1", port) }
544
562
  client.write(garbage)
545
563
  client.flush
546
564
  Thread.new { sleep(1); client.close }
data/version CHANGED
@@ -1 +1 @@
1
- 5.2.1
1
+ 5.2.5
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: logstash-input-tcp
3
3
  version: !ruby/object:Gem::Version
4
- version: 5.2.1
4
+ version: 5.2.5
5
5
  platform: java
6
6
  authors:
7
7
  - Elastic
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-03-08 00:00:00.000000000 Z
11
+ date: 2021-12-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  requirement: !ruby/object:Gem::Requirement
@@ -103,17 +103,31 @@ dependencies:
103
103
  - !ruby/object:Gem::Dependency
104
104
  requirement: !ruby/object:Gem::Requirement
105
105
  requirements:
106
- - - ">="
106
+ - - "<"
107
107
  - !ruby/object:Gem::Version
108
- version: '0'
108
+ version: 7.0.0
109
+ name: logstash-core
110
+ prerelease: false
111
+ type: :runtime
112
+ version_requirements: !ruby/object:Gem::Requirement
113
+ requirements:
114
+ - - "<"
115
+ - !ruby/object:Gem::Version
116
+ version: 7.0.0
117
+ - !ruby/object:Gem::Dependency
118
+ requirement: !ruby/object:Gem::Requirement
119
+ requirements:
120
+ - - "~>"
121
+ - !ruby/object:Gem::Version
122
+ version: '1.0'
109
123
  name: logstash-devutils
110
124
  prerelease: false
111
125
  type: :development
112
126
  version_requirements: !ruby/object:Gem::Requirement
113
127
  requirements:
114
- - - ">="
128
+ - - "~>"
115
129
  - !ruby/object:Gem::Version
116
- version: '0'
130
+ version: '1.0'
117
131
  - !ruby/object:Gem::Dependency
118
132
  requirement: !ruby/object:Gem::Requirement
119
133
  requirements:
@@ -164,7 +178,7 @@ files:
164
178
  - logstash-input-tcp.gemspec
165
179
  - spec/inputs/tcp_spec.rb
166
180
  - spec/spec_helper.rb
167
- - vendor/jar-dependencies/org/logstash/inputs/logstash-input-tcp/5.2.1/logstash-input-tcp-5.2.1.jar
181
+ - vendor/jar-dependencies/org/logstash/inputs/plugin/5.2.5/plugin-5.2.5.jar
168
182
  - version
169
183
  homepage: http://www.elastic.co/guide/en/logstash/current/index.html
170
184
  licenses:
@@ -188,8 +202,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
188
202
  - !ruby/object:Gem::Version
189
203
  version: '0'
190
204
  requirements: []
191
- rubyforge_project:
192
- rubygems_version: 2.6.13
205
+ rubygems_version: 3.1.6
193
206
  signing_key:
194
207
  specification_version: 4
195
208
  summary: Reads events from a TCP socket