logstash-core 6.1.0-java → 6.1.1-java

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 83b5b84eb3c3b4cbf13f2b52b49c71dbdd039314d626ef132ecc39c4c99def2f
4
- data.tar.gz: b253d715ef3b14356a4043399289f460fa33d3d07ec47af6525fca0fb1089432
3
+ metadata.gz: 7552e565f3c3c48330156cbbe377242f94224743eb8fbe7570da6d9dcd0a2de0
4
+ data.tar.gz: 52ca8909ad7532ae6b835e291925b88637b7da30a857c97f36e28fc089372334
5
5
  SHA512:
6
- metadata.gz: abb3868e2c57adb416b1db38c793236d2a022592e33a3cd7b0c99a8a51781fa3d98fdba53dfdee1890b93547c7b3c12af1d0de4b07af38669109e94c859cd312
7
- data.tar.gz: fc6f31b28c7ce4aa978838af1f60ef6d752fabe639c22b00468db86c706b648511062baa9b4e69bea60414f5dccda814946751e601d92763c4b12a242f37c10d
6
+ metadata.gz: fe8ab5dcfcb6e4a88ccfa4b1b879c509d1f2152cbd27d02973bfe0d94da5d61641d45d4452d827e17e6669608ebd0491bfb98cbd2e5871dc258d333de903c522
7
+ data.tar.gz: 5bd7b2485ec5ce44a7cf8e601d8171c498e55c341a1cbf3384fa85f71f68e0df8a9d916a42dfd90e14cdccf5d921e9fd6049a5aa45d7727fde771d1500f3fedc
Binary file
@@ -60,30 +60,6 @@ module LogStash::Config::Mixin
60
60
  # store the plugin type, turns LogStash::Inputs::Base into 'input'
61
61
  @plugin_type = self.class.ancestors.find { |a| a.name =~ /::Base$/ }.config_name
62
62
 
63
- # warn about deprecated variable use
64
- params.each do |name, value|
65
- opts = self.class.get_config[name]
66
- if opts && opts[:deprecated]
67
- extra = opts[:deprecated].is_a?(String) ? opts[:deprecated] : ""
68
- extra.gsub!("%PLUGIN%", self.class.config_name)
69
- self.logger.warn("You are using a deprecated config setting " +
70
- "#{name.inspect} set in #{self.class.config_name}. " +
71
- "Deprecated settings will continue to work, " +
72
- "but are scheduled for removal from logstash " +
73
- "in the future. #{extra} If you have any questions " +
74
- "about this, please visit the #logstash channel " +
75
- "on freenode irc.", :name => name, :plugin => self)
76
-
77
- end
78
- if opts && opts[:obsolete]
79
- extra = opts[:obsolete].is_a?(String) ? opts[:obsolete] : ""
80
- extra.gsub!("%PLUGIN%", self.class.config_name)
81
- raise LogStash::ConfigurationError,
82
- I18n.t("logstash.runner.configuration.obsolete", :name => name,
83
- :plugin => self.class.config_name, :extra => extra)
84
- end
85
- end
86
-
87
63
  # Set defaults from 'config :foo, :default => somevalue'
88
64
  self.class.get_config.each do |name, opts|
89
65
  next if params.include?(name.to_s)
@@ -109,17 +85,46 @@ module LogStash::Config::Mixin
109
85
  params[name.to_s] = deep_replace(value)
110
86
  end
111
87
 
112
-
113
88
  if !self.class.validate(params)
114
89
  raise LogStash::ConfigurationError,
115
90
  I18n.t("logstash.runner.configuration.invalid_plugin_settings")
116
91
  end
117
92
 
93
+ # now that we know the parameters are valid, we can obfuscate the original copy
94
+ # of the parameters before storing them as an instance variable
95
+ self.class.secure_params!(original_params)
96
+ @original_params = original_params
97
+
98
+ # warn about deprecated variable use
99
+ original_params.each do |name, value|
100
+ opts = self.class.get_config[name]
101
+ if opts && opts[:deprecated]
102
+ extra = opts[:deprecated].is_a?(String) ? opts[:deprecated] : ""
103
+ extra.gsub!("%PLUGIN%", self.class.config_name)
104
+ self.logger.warn("You are using a deprecated config setting " +
105
+ "#{name.inspect} set in #{self.class.config_name}. " +
106
+ "Deprecated settings will continue to work, " +
107
+ "but are scheduled for removal from logstash " +
108
+ "in the future. #{extra} If you have any questions " +
109
+ "about this, please visit the #logstash channel " +
110
+ "on freenode irc.", :name => name, :plugin => self)
111
+
112
+ end
113
+
114
+ if opts && opts[:obsolete]
115
+ extra = opts[:obsolete].is_a?(String) ? opts[:obsolete] : ""
116
+ extra.gsub!("%PLUGIN%", self.class.config_name)
117
+ raise LogStash::ConfigurationError,
118
+ I18n.t("logstash.runner.configuration.obsolete", :name => name,
119
+ :plugin => self.class.config_name, :extra => extra)
120
+ end
121
+ end
122
+
118
123
  # We remove any config options marked as obsolete,
119
124
  # no code should be associated to them and their values should not bleed
120
125
  # to the plugin context.
121
126
  #
122
- # This need to be done after fetching the options from the parents classed
127
+ # This need to be done after fetching the options from the parents class
123
128
  params.reject! do |name, value|
124
129
  opts = self.class.get_config[name]
125
130
  opts.include?(:obsolete)
@@ -134,11 +139,6 @@ module LogStash::Config::Mixin
134
139
  instance_variable_set("@#{key}", value)
135
140
  end
136
141
 
137
- # now that we know the parameters are valid, we can obfuscate the original copy
138
- # of the parameters before storing them as an instance variable
139
- self.class.secure_params!(original_params)
140
- @original_params = original_params
141
-
142
142
  @config = params
143
143
  end # def config_init
144
144
 
@@ -3,6 +3,34 @@ require "spec_helper"
3
3
  require "logstash/config/mixin"
4
4
 
5
5
  describe LogStash::Config::Mixin do
6
+ context "when encountering a deprecated option" do
7
+ let(:password) { "sekret" }
8
+ let(:double_logger) { double("logger").as_null_object }
9
+
10
+ subject do
11
+ Class.new(LogStash::Filters::Base) do
12
+ include LogStash::Config::Mixin
13
+ config_name "test_deprecated"
14
+ milestone 1
15
+ config :old_opt, :validate => :string, :deprecated => "this is old school"
16
+ config :password, :validate => :password
17
+ end.new({
18
+ "old_opt" => "whut",
19
+ "password" => password
20
+ })
21
+ end
22
+
23
+ it "should not log the password" do
24
+ expect(LogStash::Logging::Logger).to receive(:new).with(anything).and_return(double_logger)
25
+ expect(double_logger).to receive(:warn) do |arg1,arg2|
26
+ message = 'You are using a deprecated config setting "old_opt" set in test_deprecated. Deprecated settings will continue to work, but are scheduled for removal from logstash in the future. this is old school If you have any questions about this, please visit the #logstash channel on freenode irc.'
27
+ expect(arg1).to eq(message)
28
+ expect(arg2[:plugin].to_s).to include('"password"=><password>')
29
+ end.once
30
+ subject
31
+ end
32
+ end
33
+
6
34
  context "when validating :bytes successfully" do
7
35
  subject do
8
36
  local_num_bytes = num_bytes # needs to be locally scoped :(
@@ -1,6 +1,6 @@
1
1
  ---
2
- logstash: 6.1.0
3
- logstash-core: 6.1.0
2
+ logstash: 6.1.1
3
+ logstash-core: 6.1.1
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
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.1.0
4
+ version: 6.1.1
5
5
  platform: java
6
6
  authors:
7
7
  - Elastic
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-12-12 00:00:00.000000000 Z
11
+ date: 2017-12-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  requirement: !ruby/object:Gem::Requirement