logstash-core 6.8.6-java → 6.8.11-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: a9d7d36743dd7f39111f8a88f64f0696fc4fbb79411fb2bbc070e20bf7fef179
4
- data.tar.gz: 9b6a1e235e2d5356990d5f4c4b609d4e87b913c53a139278127174befe85c69d
3
+ metadata.gz: 9f9e757fe4ffbc1fb7bb183bc3d12e4e2ec04e486dd1da1f85e0cf54f315f258
4
+ data.tar.gz: a826e2f7d1ddf9da267f07ec7b33daafaba0ec38341fcac77f2aa24d6b15296c
5
5
  SHA512:
6
- metadata.gz: 725ab71aadf8ebb3ef481191340c19b40541c75e27dd88a52acf7cc493593000fdff86836a348451d2f0d8cb10b8ae28129821e161be3c8ef8e526d752520131
7
- data.tar.gz: e682dff610e7be2ab9a148610f885c15b71365f415f5831b0832e2427fed6711d66b17f1a33368b9ff80b975b92a1155ae1e400c9d966b54b4548ea155efda92
6
+ metadata.gz: ecb204af58e61a75ad0dfe46bfab557635915758bd5bdab3a31c219cac3802ff83cb0ccb6031b256d900bcc45fd7d87743c2e919322312abbb07253e76288b0e
7
+ data.tar.gz: 5bd91c2e3319178fcb312ab8b2d96dee23484f0d80cd0e7f4fc70fbbaede4e658c899b8c703d3d3d81fb0cf0305bc7f5a068063129c1e5bd004b542791f51f89
@@ -32,8 +32,9 @@ class LogStash::DependencyReport < Clamp::Command
32
32
  command = ["./gradlew", "generateLicenseReport", "-PlicenseReportInputCSV=#{ruby_output_path}", "-PlicenseReportOutputCSV=#{output_path}"]
33
33
  puts "Executing #{command}"
34
34
  system(*command)
35
+
35
36
  if $?.exitstatus != 0
36
- raise "Could not run gradle java deps! Exit status #{$?.exitstatus}"
37
+ raise "generateLicenseReport failed with exit status #{$?.exitstatus}"
37
38
  end
38
39
 
39
40
  nil
@@ -0,0 +1,33 @@
1
+ require 'thread' # Mutex
2
+
3
+ # A [LazySingleton] wraps the result of the provided block,
4
+ # which is guaranteed to be called at-most-once, even if the
5
+ # block's return value is nil.
6
+ class ::LogStash::Util::LazySingleton
7
+
8
+ def initialize(&block)
9
+ @mutex = Mutex.new
10
+ @block = block
11
+ @instantiated = false
12
+ end
13
+
14
+ def instance
15
+ unless @instantiated
16
+ @mutex.synchronize do
17
+ unless @instantiated
18
+ @instance = @block.call
19
+ @instantiated = true
20
+ end
21
+ end
22
+ end
23
+
24
+ return @instance
25
+ end
26
+
27
+ def reset!
28
+ @mutex.synchronize do
29
+ @instantiated = false
30
+ @instance = nil
31
+ end
32
+ end
33
+ end
@@ -2,12 +2,17 @@
2
2
 
3
3
  java_import "org.logstash.secret.store.SecretStoreExt"
4
4
 
5
+ require_relative 'lazy_singleton'
6
+
5
7
  module ::LogStash::Util::SubstitutionVariables
6
8
 
7
9
  include LogStash::Util::Loggable
8
10
 
9
11
  SUBSTITUTION_PLACEHOLDER_REGEX = /\${(?<name>[a-zA-Z_.][a-zA-Z0-9_.]*)(:(?<default>[^}]*))?}/
10
12
 
13
+ SECRET_STORE = ::LogStash::Util::LazySingleton.new { load_secret_store }
14
+ private_constant :SECRET_STORE
15
+
11
16
  # Recursive method to replace substitution variable references in parameters
12
17
  def deep_replace(value)
13
18
  if value.is_a?(Hash)
@@ -42,7 +47,7 @@ module ::LogStash::Util::SubstitutionVariables
42
47
  logger.debug("Replacing `#{placeholder}` with actual value")
43
48
 
44
49
  #check the secret store if it exists
45
- secret_store = SecretStoreExt.getIfExists(LogStash::SETTINGS.get_setting("keystore.file").value, LogStash::SETTINGS.get_setting("keystore.classname").value)
50
+ secret_store = SECRET_STORE.instance
46
51
  replacement = secret_store.nil? ? nil : secret_store.retrieveSecret(SecretStoreExt.getStoreId(name))
47
52
  #check the environment
48
53
  replacement = ENV.fetch(name, default) if replacement.nil?
@@ -54,4 +59,20 @@ module ::LogStash::Util::SubstitutionVariables
54
59
  end
55
60
  end # def replace_placeholders
56
61
 
62
+ class << self
63
+ private
64
+
65
+ # loads a secret_store from disk if available, or returns nil
66
+ #
67
+ # @api private
68
+ # @return [SecretStoreExt,nil]
69
+ def load_secret_store
70
+ SecretStoreExt.getIfExists(LogStash::SETTINGS.get_setting("keystore.file").value, LogStash::SETTINGS.get_setting("keystore.classname").value)
71
+ end
72
+
73
+ # @api test
74
+ def reset_secret_store
75
+ SECRET_STORE.reset!
76
+ end
77
+ end
57
78
  end
@@ -158,6 +158,11 @@ describe LogStash::Settings do
158
158
 
159
159
  before :each do
160
160
  LogStash::SETTINGS.set("keystore.file", File.join(File.dirname(__FILE__), "../../src/test/resources/logstash.keystore.with.default.pass"))
161
+ LogStash::Util::SubstitutionVariables.send(:reset_secret_store)
162
+ end
163
+
164
+ after(:each) do
165
+ LogStash::Util::SubstitutionVariables.send(:reset_secret_store)
161
166
  end
162
167
 
163
168
  context "placeholders in flat logstash.yml" do
@@ -211,6 +216,7 @@ describe LogStash::Settings do
211
216
 
212
217
  before :each do
213
218
  LogStash::SETTINGS.set("keystore.file", File.join(File.dirname(__FILE__), "../../src/test/resources/logstash.keystore.with.default.pass"))
219
+ LogStash::Util::SubstitutionVariables.send(:reset_secret_store)
214
220
  end
215
221
 
216
222
  before do
@@ -225,6 +231,10 @@ describe LogStash::Settings do
225
231
  ENV.delete('a')
226
232
  end
227
233
 
234
+ after(:each) do
235
+ LogStash::Util::SubstitutionVariables.send(:reset_secret_store)
236
+ end
237
+
228
238
  subject do
229
239
  settings = described_class.new
230
240
  settings.register(LogStash::Setting::ArrayCoercible.new("host", String, []))
@@ -1,6 +1,6 @@
1
1
  ---
2
- logstash: 6.8.6
3
- logstash-core: 6.8.6
2
+ logstash: 6.8.11
3
+ logstash-core: 6.8.11
4
4
  logstash-core-plugin-api: 2.1.16
5
5
 
6
6
  # jruby must reference a *released* version of jruby which can be downloaded from the official download url
@@ -20,8 +20,8 @@ jruby:
20
20
  # Note: this file is copied to the root of logstash-core because its gemspec needs it when
21
21
  # bundler evaluates the gemspec via bin/logstash
22
22
  # Ensure Jackson version here is kept in sync with version used by jrjackson gem
23
- jrjackson: 0.4.10
24
- jackson: 2.9.9
25
- jackson-databind: 2.9.9.3
23
+ jrjackson: 0.4.11
24
+ jackson: 2.9.10
25
+ jackson-databind: 2.9.10.1
26
26
 
27
27
  # This is a copy the project level versions.yml into this gem's root and it is created when the gemspec is evaluated.
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: logstash-core
3
3
  version: !ruby/object:Gem::Version
4
- version: 6.8.6
4
+ version: 6.8.11
5
5
  platform: java
6
6
  authors:
7
7
  - Elastic
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-12-13 00:00:00.000000000 Z
11
+ date: 2020-07-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  requirement: !ruby/object:Gem::Requirement
@@ -257,7 +257,7 @@ dependencies:
257
257
  requirements:
258
258
  - - '='
259
259
  - !ruby/object:Gem::Version
260
- version: 0.4.10
260
+ version: 0.4.11
261
261
  name: jrjackson
262
262
  type: :runtime
263
263
  prerelease: false
@@ -265,7 +265,7 @@ dependencies:
265
265
  requirements:
266
266
  - - '='
267
267
  - !ruby/object:Gem::Version
268
- version: 0.4.10
268
+ version: 0.4.11
269
269
  - !ruby/object:Gem::Dependency
270
270
  requirement: !ruby/object:Gem::Requirement
271
271
  requirements:
@@ -455,6 +455,7 @@ files:
455
455
  - lib/logstash/util/duration_formatter.rb
456
456
  - lib/logstash/util/filetools.rb
457
457
  - lib/logstash/util/java_version.rb
458
+ - lib/logstash/util/lazy_singleton.rb
458
459
  - lib/logstash/util/loggable.rb
459
460
  - lib/logstash/util/manticore_ssl_config_helper.rb
460
461
  - lib/logstash/util/modules_setting_array.rb