logstash-mixin-http_client 7.3.0 → 7.4.0

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: cc464a55d52c603e85ea2660d4421e299cf84a876c0535b42e96eb7b6ab6a39c
4
- data.tar.gz: 147afafc098bc8b326a21200ac7354e80ecbbefb1736d7dbee2c49a50d9eba69
3
+ metadata.gz: 37d1b2f6c38db9be11cb37da743556d46e05f6f5e100239c18c9e0b56b8e9607
4
+ data.tar.gz: 1faae938aabfa08c0a958a5a74b4993917326caf4040beedb58dafe84af62ff4
5
5
  SHA512:
6
- metadata.gz: 966d167f986302dfb50b7c83ad4101c77c23ce08c998749a184339516c7021c96da5c6f389fa71b6c8a06869fc0ac66a72988ac3ba8666dd5defb070333d4ae5
7
- data.tar.gz: 8fe68d119b1ad22a102aaa810c39b364127911a7b2814e7330f7a04f70de36985b413c30a65a8d617edd9b8139c181dfe302777502efb8eaa579deecb1f9d553
6
+ metadata.gz: 283e5c0e7346f8b0051b387805ba379792a822adbf542b61c00fd2fab00de8e0e9e36121ba7234f5ba906fc7e1e6428f7343131cbaf1597e39b03004963004ee
7
+ data.tar.gz: 053f697103912ce7767f9d62797e002e9d7d6f468d34c66fffa43854cdaf7789d092563757bae1a566e4441ff11f3da468270ce16c457b17ee85b1731e727954
data/CHANGELOG.md CHANGED
@@ -1,3 +1,6 @@
1
+ ## 7.4.0
2
+ - Adds new `ssl_enabled` setting for enabling/disabling the SSL configurations [#44](https://github.com/logstash-plugins/logstash-mixin-http_client/pull/44)
3
+
1
4
  ## 7.3.0
2
5
  - Adds standardized SSL settings and deprecates their non-standard counterparts. Deprecated settings will continue to work, and will provide pipeline maintainers with guidance toward using their standardized counterparts [#42](https://github.com/logstash-plugins/logstash-mixin-http_client/pull/42)
3
6
  - Adds new `ssl_truststore_path`, `ssl_truststore_password`, and `ssl_truststore_type` settings for configuring SSL-trust using a PKCS-12 or JKS trust store, deprecating their `truststore`, `truststore_password`, and `truststore_type` counterparts.
@@ -75,6 +75,9 @@ module LogStash::PluginMixins::HttpClient
75
75
  # See https://hc.apache.org/httpcomponents-client-ga/httpclient/apidocs/org/apache/http/impl/conn/PoolingHttpClientConnectionManager.html#setValidateAfterInactivity(int)[these docs for more info]
76
76
  base.config :validate_after_inactivity, :validate => :number, :default => 200
77
77
 
78
+ # Enable/disable the SSL configurations
79
+ base.config :ssl_enabled, :validate => :boolean, :default => true
80
+
78
81
  # If you need to use a custom X.509 CA (.pem certs) specify the path to that here
79
82
  base.config :ssl_certificate_authorities, :validate => :path, :list => :true
80
83
 
@@ -188,6 +191,13 @@ module LogStash::PluginMixins::HttpClient
188
191
  def ssl_options
189
192
 
190
193
  options = {}
194
+
195
+ unless @ssl_enabled
196
+ ignored_ssl_settings = original_params.select { |k| k != 'ssl_enabled' && k.start_with?('ssl_') }
197
+ self.logger.warn("Configured SSL settings are not used when `ssl_enabled` is set to `false`: #{ignored_ssl_settings.keys}") if ignored_ssl_settings.any?
198
+ return options
199
+ end
200
+
191
201
  if @ssl_certificate_authorities&.any?
192
202
  raise LogStash::ConfigurationError, 'Multiple values on `ssl_certificate_authorities` are not supported by this plugin' if @ssl_certificate_authorities.size > 1
193
203
 
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = 'logstash-mixin-http_client'
3
- s.version = '7.3.0'
3
+ s.version = '7.4.0'
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"
@@ -339,6 +339,32 @@ shared_examples 'a client with standardized ssl options' do
339
339
  end
340
340
  end
341
341
  end
342
+
343
+ describe 'with ssl_enabled' do
344
+ context 'set to false' do
345
+ let(:basic_config) { super().merge('ssl_enabled' => false) }
346
+ let(:plugin) { plugin_class.new(basic_config) }
347
+
348
+ it 'should not configure the client :ssl' do
349
+ expect(plugin.client_config[:ssl]).to eq({})
350
+ end
351
+
352
+ context 'and another ssl_* config set' do
353
+ let(:basic_config) { super().merge('ssl_verification_mode' => 'none') }
354
+ let(:logger_mock) { double('logger') }
355
+
356
+ before(:each) do
357
+ allow(plugin).to receive(:logger).and_return(logger_mock)
358
+ end
359
+
360
+ it 'should log a warn message' do
361
+ allow(logger_mock).to receive(:warn)
362
+ plugin.client_config
363
+ expect(logger_mock).to have_received(:warn).with('Configured SSL settings are not used when `ssl_enabled` is set to `false`: ["ssl_verification_mode"]')
364
+ end
365
+ end
366
+ end
367
+ end
342
368
  end
343
369
  end
344
370
 
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: 7.3.0
4
+ version: 7.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Elastic
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-08-30 00:00:00.000000000 Z
11
+ date: 2024-06-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  requirement: !ruby/object:Gem::Requirement