logstash-filter-fingerprint 3.4.3 → 3.4.4

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: 4840dc48f443b48ea2c6b92ad67fa69babbd2df840c01f3a28e380053ae4679e
4
- data.tar.gz: b53dc8974b796e3213b7f750118c5655d9d37ef23f9117b4ef997c410e3f72af
3
+ metadata.gz: 67ab2a8c642f61df85825d8de9f0cf7c6a1cf05b01b32ceffea1776ea4ebce66
4
+ data.tar.gz: 7af0a15fc8e0b686a263f2828919fd7da1fb5627fa86cb4f82a7b0a361c16b20
5
5
  SHA512:
6
- metadata.gz: 3479895f5cd57cead69ca66a3974bc7f210f14767b4cdc4be7027eb57c2d4b3d40b6874b436f87a315a8064569cc6d937de08bd8d1a483aeb52c9f9d6c403f92
7
- data.tar.gz: 96b87468c7aa651a6c11d79d6820368ada168877919ee53f900190c09aaefd5948d081ae4e4a1de826805d2fb7847209b2ade1b63ac94ff4a3a2911e20ef797d
6
+ metadata.gz: 23ded7513caf3a42ae83a921e535a0498132ddfa0b1fd4f992991abe1f9f910f9c1d4df475edb9c37677f1d9b59ebdd6442171794f58e91eb52e4d58a0052ac9
7
+ data.tar.gz: c0b36f667d92ff883b7e2507bbea40d6e9a3d0b52155c7a1342b435aa7bd144675684212092059f5bba20bcff64d08ce50f74eefa5762e1e41f772aafbb8c4dd
data/CHANGELOG.md CHANGED
@@ -1,3 +1,6 @@
1
+ ## 3.4.4
2
+ - Fix, eagerly load OpenSSL classes ot avoid uninitialized constant error [#76](https://github.com/logstash-plugins/logstash-filter-fingerprint/pull/76)
3
+
1
4
  ## 3.4.3
2
5
  - pin murmurhash3 to 0.1.6 [#74](https://github.com/logstash-plugins/logstash-filter-fingerprint/pull/74)
3
6
 
@@ -134,6 +134,10 @@ class LogStash::Filters::Fingerprint < LogStash::Filters::Base
134
134
  when :PUNCTUATION
135
135
  # nothing
136
136
  else
137
+ # force the resolution of OpenSSL class to avoid errors when loaded in multi-threaded
138
+ # #fingerprint_openssl method to instantiate the appropriate digest class.
139
+ # https://github.com/logstash-plugins/logstash-filter-fingerprint/issues/75
140
+ select_digest(@method)
137
141
  class << self; alias_method :fingerprint, :fingerprint_openssl; end
138
142
  end
139
143
  end
@@ -209,7 +213,10 @@ class LogStash::Filters::Fingerprint < LogStash::Filters::Base
209
213
  # we must include the id in the thread local variable name, so that we can
210
214
  # store multiple digest instances
211
215
  digest_string = "digest-#{id}"
212
- Thread.current[digest_string] ||= select_digest(@method)
216
+ unless Thread.current[digest_string]
217
+ digest_class = select_digest(@method)
218
+ Thread.current[digest_string] = digest_class.new
219
+ end
213
220
  digest = Thread.current[digest_string]
214
221
  # in JRuby 1.7.11 outputs as ASCII-8BIT
215
222
  if @key.nil?
@@ -261,18 +268,19 @@ class LogStash::Filters::Fingerprint < LogStash::Filters::Base
261
268
  end
262
269
  end
263
270
 
271
+ # Return Class reference more appropriate for the method.
264
272
  def select_digest(method)
265
273
  case method
266
274
  when :SHA1
267
- OpenSSL::Digest::SHA1.new
275
+ OpenSSL::Digest::SHA1
268
276
  when :SHA256
269
- OpenSSL::Digest::SHA256.new
277
+ OpenSSL::Digest::SHA256
270
278
  when :SHA384
271
- OpenSSL::Digest::SHA384.new
279
+ OpenSSL::Digest::SHA384
272
280
  when :SHA512
273
- OpenSSL::Digest::SHA512.new
281
+ OpenSSL::Digest::SHA512
274
282
  when :MD5
275
- OpenSSL::Digest::MD5.new
283
+ OpenSSL::Digest::MD5
276
284
  else
277
285
  # we really should never get here
278
286
  raise(LogStash::ConfigurationError, "Unknown digest for method=#{method.to_s}")
@@ -1,7 +1,7 @@
1
1
  Gem::Specification.new do |s|
2
2
 
3
3
  s.name = 'logstash-filter-fingerprint'
4
- s.version = '3.4.3'
4
+ s.version = '3.4.4'
5
5
  s.licenses = ['Apache-2.0']
6
6
  s.summary = "Fingerprints fields by replacing values with a consistent hash"
7
7
  s.description = "This gem is a Logstash plugin required to be installed on top of the Logstash core pipeline using $LS_HOME/bin/logstash-plugin install gemname. This gem is not a stand-alone program"
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: logstash-filter-fingerprint
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.4.3
4
+ version: 3.4.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Elastic
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-05-12 00:00:00.000000000 Z
11
+ date: 2024-03-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  requirement: !ruby/object:Gem::Requirement