logstash-output-elasticsearch 5.3.2-java → 5.3.3-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
  SHA1:
3
- metadata.gz: dcf12a3d7775459fee8072e9ed5eaf77f9db915c
4
- data.tar.gz: 45c8df302d9e94e23e635307bfccf27ef601a2c9
3
+ metadata.gz: c7215cdc391fa36759ad34115ee7bc86675154ef
4
+ data.tar.gz: 17afbe84a16a218fd28163f68f3a023e1dbb12c4
5
5
  SHA512:
6
- metadata.gz: 143d8ea73ebe28155500c47fd1f583b3535e0283c4b9b92ba81a318c7bd9caceda4a872d7c46ce29122e366e5406cf355cc4dd85bd46d9b38a43c95aae5f87c6
7
- data.tar.gz: b39d159adcdeb10dc2d21ee62490c16b199015f429028c7cf7b3223063cd3a677903f3d267401d8503b0985788c5d8ddfe8fb985102427dfd39e77ed8bbae6e2
6
+ metadata.gz: 1dce858308979f22de3bcf8573ba06afb7b981dda3dc13d3ef0f6f12174bc3110f3d3b8a97b2daf334eafc4bf615e92a679da28d44087d379a51f2da43f7cd5c
7
+ data.tar.gz: e6ed3b5b4f45651965ea1cc4270869610cfe2c645b821a46cd6beb22eebd5c3093ab57b1a301274607eff7bf935626c5bf6fae2f97daaf4c87335383158f0865
data/CHANGELOG.md CHANGED
@@ -1,3 +1,6 @@
1
+ ## 5.3.3
2
+ - Hide user/password in connection pool
3
+
1
4
  ## 5.3.2
2
5
  - Use byte size, not char count for bulk operation size checks
3
6
 
@@ -261,7 +261,7 @@ module LogStash; module Outputs; class ElasticSearch; class HttpClient;
261
261
  new_urls.each do |url|
262
262
  # URI objects don't have real hash equality! So, since this isn't perf sensitive we do a linear scan
263
263
  unless @url_info.keys.include?(url)
264
- state_changes[:added] << url.to_s
264
+ state_changes[:added] << url
265
265
  add_url(url)
266
266
  end
267
267
  end
@@ -269,14 +269,24 @@ module LogStash; module Outputs; class ElasticSearch; class HttpClient;
269
269
  # Delete connections not in the new list
270
270
  @url_info.each do |url,_|
271
271
  unless new_urls.include?(url)
272
- state_changes[:removed] << url.to_s
272
+ state_changes[:removed] << url
273
273
  remove_url(url)
274
274
  end
275
275
  end
276
276
  end
277
277
 
278
278
  if state_changes[:removed].size > 0 || state_changes[:added].size > 0
279
- logger.info("Elasticsearch pool URLs updated", :changes => state_changes)
279
+ if logger.info?
280
+ logger.info("Elasticsearch pool URLs updated", :changes => safe_state_changes(state_changes))
281
+ end
282
+ end
283
+ end
284
+
285
+ def safe_state_changes(state_changes)
286
+ state_changes.reduce({}) do |acc, kv|
287
+ k,v = kv
288
+ acc[k] = v.map(&LogStash::Outputs::ElasticSearch::SafeURL.method(:without_credentials)).map(&:to_s)
289
+ acc
280
290
  end
281
291
  end
282
292
 
@@ -1,7 +1,7 @@
1
1
  Gem::Specification.new do |s|
2
2
 
3
3
  s.name = 'logstash-output-elasticsearch'
4
- s.version = '5.3.2'
4
+ s.version = '5.3.3'
5
5
  s.licenses = ['apache-2.0']
6
6
  s.summary = "Logstash Output to Elasticsearch"
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"
@@ -93,6 +93,21 @@ describe LogStash::Outputs::ElasticSearch::HttpClient::Pool do
93
93
  expect(subject).to have_received(:in_use_connections).twice
94
94
  end
95
95
  end
96
+
97
+ describe "safe_state_changes" do
98
+ let(:state_changes) do
99
+ {
100
+ :added => [URI.parse("http://sekretu:sekretp@foo1")],
101
+ :removed => [URI.parse("http://sekretu:sekretp@foo2")]
102
+ }
103
+ end
104
+ let(:processed) { subject.safe_state_changes(state_changes)}
105
+
106
+ it "should hide passwords" do
107
+ expect(processed[:added].any? {|p| p =~ /sekretp/ }).to be false
108
+ expect(processed[:removed].any? {|p| p =~ /sekretp/ }).to be false
109
+ end
110
+ end
96
111
 
97
112
  describe "connection management" do
98
113
  context "with only one URL in the list" do
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: logstash-output-elasticsearch
3
3
  version: !ruby/object:Gem::Version
4
- version: 5.3.2
4
+ version: 5.3.3
5
5
  platform: java
6
6
  authors:
7
7
  - Elastic
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-11-10 00:00:00.000000000 Z
11
+ date: 2016-11-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  requirement: !ruby/object:Gem::Requirement