logstash-mixin-http_client 4.0.2 → 4.0.3

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: 7f2cad331c64dce7e457f0de8672443dd8d82adc
4
- data.tar.gz: e59d7aae81af6bf2eec2f19131fefa502b8636b5
3
+ metadata.gz: 997861fb27c7f41617d640e9526db40c9750fc27
4
+ data.tar.gz: becffe860628916c9829ac650fff941067a35009
5
5
  SHA512:
6
- metadata.gz: eac146c522b541b1a6dc01d1d1118b8d1467e0d147bb83db9adf93ae15c23a363149ac42e76cd14ff3915c46f9cdd034df783e9e627998e30c904e051ff01987
7
- data.tar.gz: 133ca719c78d2cf33b8f02a6d009036ceead3e3f106c1ca95f71a9587ebde7b621f6aed84a5d7c52b5a1a04b8342b29f77c4323469c7235fa7a21ffad5c24e4d
6
+ metadata.gz: 51baa92d069a19d4885fd97755da05aa3e2b409536ce4d8d68fb32e33777d1dd9d7e4729e6bb41f1c458e6615d098162fb8c4fc82dfb68c98abf9932cefd045f
7
+ data.tar.gz: 2415d592ecaa660f4fbc1f0e5f0706881377ad52909f58f66d1b8c9efe7ebf24b03ef6a641ce11d7b964f078ab8c83db3bc8d79fa3646fc3d3d1af134b6b97e6
@@ -1,3 +1,6 @@
1
+ ## 4.0.3
2
+ - Raise configuration error when user supplies a trust/keystore without a password
3
+
1
4
  ## 4.0.2
2
5
  - Relax constraint on logstash-core-plugin-api to >= 1.60 <= 2.99
3
6
 
@@ -19,7 +22,7 @@
19
22
  * Default `automatic_retries` to 1 to fix connections to hosts with broken keepalive
20
23
  * Add `non_idempotent_retries` option
21
24
  # 2.0.0
22
- * Plugins were updated to follow the new shutdown semantic, this mainly allows Logstash to instruct input plugins to terminate gracefully,
25
+ * Plugins were updated to follow the new shutdown semantic, this mainly allows Logstash to instruct input plugins to terminate gracefully,
23
26
  instead of using Thread.raise on the plugins' threads. Ref: https://github.com/elastic/logstash/pull/3895
24
27
  * Dependency on logstash-core update to 2.0
25
28
  # 1.0.2
@@ -127,24 +127,24 @@ module LogStash::PluginMixins::HttpClient
127
127
  if @truststore
128
128
  c[:ssl].merge!(
129
129
  :truststore => @truststore,
130
- :truststore_type => @truststore_type
130
+ :truststore_type => @truststore_type,
131
+ :truststore_password => @truststore_password.value
131
132
  )
132
-
133
- # JKS files have optional passwords if programatically created
134
- if (@truststore_password)
135
- c[:ssl].merge!(truststore_password: @truststore_password.value)
133
+
134
+ if c[:ssl][:truststore_password].nil?
135
+ raise LogStash::ConfigurationError, "Truststore declared without a password! This is not valid, please set the 'truststore_password' option"
136
136
  end
137
137
  end
138
138
 
139
139
  if @keystore
140
140
  c[:ssl].merge!(
141
141
  :keystore => @keystore,
142
- :keystore_type => @keystore_type
142
+ :keystore_type => @keystore_type,
143
+ :keystore_password => @keystore_password.value
143
144
  )
144
145
 
145
- # JKS files have optional passwords if programatically created
146
- if keystore_password
147
- c[:ssl].merge!(keystore_password: @keystore_password.value)
146
+ if c[:ssl][:keystore_password].nil?
147
+ raise LogStash::ConfigurationError, "Keystore declared without a password! This is not valid, please set the 'keystore_password' option"
148
148
  end
149
149
  end
150
150
 
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = 'logstash-mixin-http_client'
3
- s.version = '4.0.2'
3
+ s.version = '4.0.3'
4
4
  s.licenses = ['Apache License (2.0)']
5
5
  s.summary = "AWS mixins to provide a unified interface for Amazon Webservice"
6
6
  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"
@@ -85,21 +85,33 @@ describe LogStash::PluginMixins::HttpClient do
85
85
  end
86
86
  end
87
87
 
88
- describe "with a custom keystore" do
89
- let(:file) { Stud::Temporary.file }
90
- let(:path) { file.path }
91
- let(:password) { "foo" }
92
- after { File.unlink(path)}
88
+ ["keystore", "truststore"].each do |store|
89
+ describe "with a custom #{store}" do
90
+ let(:file) { Stud::Temporary.file }
91
+ let(:path) { file.path }
92
+ let(:password) { "foo" }
93
+ after { File.unlink(path)}
93
94
 
94
- let(:conf) {
95
- basic_config.merge(
96
- "keystore" => path,
97
- "keystore_password" => "foo",
98
- "keystore_type" => "jks"
99
- )
100
- }
95
+ let(:conf) {
96
+ basic_config.merge(
97
+ store => path,
98
+ "#{store}_password" => password,
99
+ "#{store}_type" => "jks"
100
+ )
101
+ }
102
+
103
+ include_examples("setting ca bundles", store.to_sym, :jks)
101
104
 
102
- include_examples("setting ca bundles", :keystore, :jks)
105
+ context "with no password set" do
106
+ let(:password) { nil }
107
+
108
+ it "should raise an error" do
109
+ expect do
110
+ Dummy.new(conf).client_config
111
+ end.to raise_error(LogStash::ConfigurationError)
112
+ end
113
+ end
114
+ end
103
115
  end
104
116
 
105
117
  describe "with a client cert" do
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: logstash-mixin-http_client
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.0.2
4
+ version: 4.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Elastic
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-07-14 00:00:00.000000000 Z
11
+ date: 2016-07-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  requirement: !ruby/object:Gem::Requirement
@@ -126,7 +126,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
126
126
  version: '0'
127
127
  requirements: []
128
128
  rubyforge_project:
129
- rubygems_version: 2.6.3
129
+ rubygems_version: 2.4.8
130
130
  signing_key:
131
131
  specification_version: 4
132
132
  summary: AWS mixins to provide a unified interface for Amazon Webservice