logstash-output-http 5.7.0 → 6.0.0

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: ea9e1064040e6d7b09ea61a4f77de09bd1a56186d824ec6c26b870c2ac466975
4
- data.tar.gz: b1ae025edddfc791309aeb4edd7a0a93a2b961358b73484b83625ad029cfceb7
3
+ metadata.gz: db0ed1f5276a90d88d30a99169a07a55017f9743ecebafc71c76714ef11f5871
4
+ data.tar.gz: 677dce576d73352be645576d4599d1a89bc116b5094f1bb47d224a9627dc8180
5
5
  SHA512:
6
- metadata.gz: 2594c607190fcf16a6c6793a19ee2c14bab9d787f688f567ec1ec0a06669a771d7213e0189e5675ef211e9bc0d313b728a0cc613817bc2af554ea6ad04b4d554
7
- data.tar.gz: 74ae9117f75b81e93e706d2acefe4c8e42d15139521aa4cf5310a21a7a9f4756763fbfa242de552cc222ed0550a03501489c55ccc56a16e0c71658c5d8c9e66e
6
+ metadata.gz: 27ac44cdad0f1b1c3abebdbdd5105377b0e311af48b18b3da88dba28566a8d3932428475b6aea7487b9fcd2c3e03352be31bcf4483c4a11a803fad40792d1986
7
+ data.tar.gz: 8ae0110d539687581f8ad419b7a6d6e33e1a20234205eb39f438df6309c2d701eb683fcfdd98d40dc568b6d7427e3140c7892e5b092136a4e6fba9777f8a6eb7
data/CHANGELOG.md CHANGED
@@ -1,3 +1,20 @@
1
+ ## 6.0.0
2
+ - SSL settings that were marked deprecated in version `5.6.0` are now marked obsolete, and will prevent the plugin from starting.
3
+ - These settings are:
4
+ - `cacert`, which should be replaced by `ssl_certificate_authorities`
5
+ - `client_cert`, which should be replaced by `ssl_certificate`
6
+ - `client_key`, which should be replaced by `ssl_key`
7
+ - `keystore`, which should be replaced by `ssl_keystore_path`
8
+ - `keystore_password`, which should be replaced by `ssl_keystore_password`
9
+ - `keystore_type`, which should be replaced by `ssl_keystore_password`
10
+ - `truststore`, which should be replaced by `ssl_truststore_path>`
11
+ - `truststore_password`, which should be replaced by `ssl_truststore_password`
12
+ - `truststore_type`, which should be replaced by `ssl_truststore_type`
13
+ - [#147](https://github.com/logstash-plugins/logstash-output-http/pull/147)
14
+
15
+ ## 5.7.1
16
+ - Added new development `rackup` dependency to fix tests
17
+
1
18
  ## 5.7.0
2
19
  - Added new `ssl_enabled` setting for enabling/disabling the SSL configurations [#144](https://github.com/logstash-plugins/logstash-output-http/pull/144)
3
20
 
data/docs/index.asciidoc CHANGED
@@ -70,13 +70,13 @@ NOTE: The `retry_failed` option does not control the library level retry.
70
70
 
71
71
  This plugin supports the following configuration options plus the <<plugins-{type}s-{plugin}-common-options>> described later.
72
72
 
73
+ NOTE: As of version `6.0.0` of this plugin, a number of previously deprecated settings related to SSL have been removed.
74
+ Please check out <<plugins-{type}s-{plugin}-obsolete-options>> for details.
75
+
73
76
  [cols="<,<,<",options="header",]
74
77
  |=======================================================================
75
78
  |Setting |Input type|Required
76
79
  | <<plugins-{type}s-{plugin}-automatic_retries>> |<<number,number>>|No
77
- | <<plugins-{type}s-{plugin}-cacert>> |a valid filesystem path|__Deprecated__
78
- | <<plugins-{type}s-{plugin}-client_cert>> |a valid filesystem path|__Deprecated__
79
- | <<plugins-{type}s-{plugin}-client_key>> |a valid filesystem path|__Deprecated__
80
80
  | <<plugins-{type}s-{plugin}-connect_timeout>> |<<number,number>>|No
81
81
  | <<plugins-{type}s-{plugin}-content_type>> |<<string,string>>|No
82
82
  | <<plugins-{type}s-{plugin}-cookies>> |<<boolean,boolean>>|No
@@ -87,9 +87,6 @@ This plugin supports the following configuration options plus the <<plugins-{typ
87
87
  | <<plugins-{type}s-{plugin}-http_method>> |<<string,string>>, one of `["put", "post", "patch", "delete", "get", "head"]`|Yes
88
88
  | <<plugins-{type}s-{plugin}-ignorable_codes>> |<<number,number>>|No
89
89
  | <<plugins-{type}s-{plugin}-keepalive>> |<<boolean,boolean>>|No
90
- | <<plugins-{type}s-{plugin}-keystore>> |a valid filesystem path|__Deprecated__
91
- | <<plugins-{type}s-{plugin}-keystore_password>> |<<password,password>>|__Deprecated__
92
- | <<plugins-{type}s-{plugin}-keystore_type>> |<<string,string>>|__Deprecated__
93
90
  | <<plugins-{type}s-{plugin}-mapping>> |<<hash,hash>>|No
94
91
  | <<plugins-{type}s-{plugin}-message>> |<<string,string>>|No
95
92
  | <<plugins-{type}s-{plugin}-pool_max>> |<<number,number>>|No
@@ -112,9 +109,6 @@ This plugin supports the following configuration options plus the <<plugins-{typ
112
109
  | <<plugins-{type}s-{plugin}-ssl_truststore_path>> |<<path,path>>|No
113
110
  | <<plugins-{type}s-{plugin}-ssl_truststore_type>> |<<string,string>>|No
114
111
  | <<plugins-{type}s-{plugin}-ssl_verification_mode>> |<<string,string>>, one of `["full", "none"]`|No
115
- | <<plugins-{type}s-{plugin}-truststore>> |a valid filesystem path|__Deprecated__
116
- | <<plugins-{type}s-{plugin}-truststore_password>> |<<password,password>>|__Deprecated__
117
- | <<plugins-{type}s-{plugin}-truststore_type>> |<<string,string>>|__Deprecated__
118
112
  | <<plugins-{type}s-{plugin}-url>> |<<string,string>>|Yes
119
113
  | <<plugins-{type}s-{plugin}-validate_after_inactivity>> |<<number,number>>|No
120
114
  |=======================================================================
@@ -135,32 +129,6 @@ to a value other than zero if the <<plugins-{type}s-{plugin}-keepalive,`keepaliv
135
129
  Some servers incorrectly end keepalives early, requiring a retry.
136
130
  See <<plugins-{type}s-{plugin}-retry_policy,Retry Policy>> for more information.
137
131
 
138
- [id="plugins-{type}s-{plugin}-cacert"]
139
- ===== `cacert`
140
- deprecated[5.6.0, Replaced by <<plugins-{type}s-{plugin}-ssl_certificate_authorities>>]
141
-
142
- * Value type is <<path,path>>
143
- * There is no default value for this setting.
144
-
145
- If you need to use a custom X.509 CA (.pem certs) specify the path to that here
146
-
147
- [id="plugins-{type}s-{plugin}-client_cert"]
148
- ===== `client_cert`
149
- deprecated[5.6.0, Replaced by <<plugins-{type}s-{plugin}-ssl_certificate>>]
150
-
151
- * Value type is <<path,path>>
152
- * There is no default value for this setting.
153
-
154
- If you'd like to use a client certificate (note, most people don't want this) set the path to the x509 cert here
155
-
156
- [id="plugins-{type}s-{plugin}-client_key"]
157
- ===== `client_key`
158
- deprecated[5.6.0, Replaced by <<plugins-{type}s-{plugin}-ssl_key>>]
159
-
160
- * Value type is <<path,path>>
161
- * There is no default value for this setting.
162
-
163
- If you're using a client certificate specify the path to the encryption key here
164
132
 
165
133
  [id="plugins-{type}s-{plugin}-connect_timeout"]
166
134
  ===== `connect_timeout`
@@ -265,34 +233,6 @@ enumerate them here. Responses returning these codes will be considered successe
265
233
  Turn this on to enable HTTP keepalive support. We highly recommend setting `automatic_retries` to at least
266
234
  one with this to fix interactions with broken keepalive implementations.
267
235
 
268
- [id="plugins-{type}s-{plugin}-keystore"]
269
- ===== `keystore`
270
- deprecated[5.6.0, Replaced by <<plugins-{type}s-{plugin}-ssl_keystore_path>>]
271
-
272
- * Value type is <<path,path>>
273
- * There is no default value for this setting.
274
-
275
- If you need to use a custom keystore (`.jks`) specify that here. This does not work with .pem keys!
276
-
277
- [id="plugins-{type}s-{plugin}-keystore_password"]
278
- ===== `keystore_password`
279
- deprecated[5.6.0, Replaced by <<plugins-{type}s-{plugin}-ssl_keystore_password>>]
280
-
281
- * Value type is <<password,password>>
282
- * There is no default value for this setting.
283
-
284
- Specify the keystore password here.
285
- Note, most .jks files created with keytool require a password!
286
-
287
- [id="plugins-{type}s-{plugin}-keystore_type"]
288
- ===== `keystore_type`
289
- deprecated[5.6.0, Replaced by <<plugins-{type}s-{plugin}-ssl_keystore_type>>]
290
-
291
- * Value type is <<string,string>>
292
- * Default value is `"JKS"`
293
-
294
- Specify the keystore type here. One of `JKS` or `PKCS12`. Default is `JKS`
295
-
296
236
  [id="plugins-{type}s-{plugin}-mapping"]
297
237
  ===== `mapping`
298
238
 
@@ -523,34 +463,6 @@ This mode disables many of the security benefits of SSL/TLS and should only be u
523
463
  It is primarily intended as a temporary diagnostic mechanism when attempting to resolve TLS errors.
524
464
  Using `none` in production environments is strongly discouraged.
525
465
 
526
- [id="plugins-{type}s-{plugin}-truststore"]
527
- ===== `truststore`
528
- deprecated[5.6.0, Replaced by <<plugins-{type}s-{plugin}-ssl_truststore_path>>]
529
-
530
- * Value type is <<path,path>>
531
- * There is no default value for this setting.
532
-
533
- If you need to use a custom truststore (`.jks`) specify that here. This does not work with .pem certs!
534
-
535
- [id="plugins-{type}s-{plugin}-truststore_password"]
536
- ===== `truststore_password`
537
- deprecated[5.6.0, Replaced by <<plugins-{type}s-{plugin}-ssl_truststore_password>>]
538
-
539
- * Value type is <<password,password>>
540
- * There is no default value for this setting.
541
-
542
- Specify the truststore password here.
543
- Note, most .jks files created with keytool require a password!
544
-
545
- [id="plugins-{type}s-{plugin}-truststore_type"]
546
- ===== `truststore_type`
547
- deprecated[5.6.0, Replaced by <<plugins-{type}s-{plugin}-ssl_truststore_type>>]
548
-
549
- * Value type is <<string,string>>
550
- * Default value is `"JKS"`
551
-
552
- Specify the truststore type here. One of `JKS` or `PKCS12`. Default is `JKS`
553
-
554
466
  [id="plugins-{type}s-{plugin}-url"]
555
467
  ===== `url`
556
468
 
@@ -573,6 +485,27 @@ Quoting the Apache commons docs (this client is based Apache Commmons):
573
485
  See https://hc.apache.org/httpcomponents-client-ga/httpclient/apidocs/org/apache/http/impl/conn/PoolingHttpClientConnectionManager.html#setValidateAfterInactivity(int)[these docs for more info]
574
486
 
575
487
 
488
+ [id="plugins-{type}s-{plugin}-obsolete-options"]
489
+ ==== HTTP Output Obsolete Configuration Options
490
+
491
+ WARNING: As of version `6.0.0` of this plugin, some configuration options have been replaced.
492
+ The plugin will fail to start if it contains any of these obsolete options.
493
+
494
+
495
+ [cols="<,<",options="header",]
496
+ |=======================================================================
497
+ |Setting|Replaced by
498
+ | cacert |<<plugins-{type}s-{plugin}-ssl_certificate_authorities>>
499
+ | client_cert |<<plugins-{type}s-{plugin}-ssl_certificate>>
500
+ | client_key |<<plugins-{type}s-{plugin}-ssl_key>>
501
+ | keystore |<<plugins-{type}s-{plugin}-ssl_keystore_path>>
502
+ | keystore_password |<<plugins-{type}s-{plugin}-ssl_keystore_password>>
503
+ | keystore_type |<<plugins-{type}s-{plugin}-ssl_keystore_password>>
504
+ | truststore |<<plugins-{type}s-{plugin}-ssl_truststore_path>>
505
+ | truststore_password |<<plugins-{type}s-{plugin}-ssl_truststore_password>>
506
+ | truststore_type |<<plugins-{type}s-{plugin}-ssl_truststore_type>>
507
+ |=======================================================================
508
+
576
509
 
577
510
  [id="plugins-{type}s-{plugin}-common-options"]
578
511
  include::{include_path}/{type}.asciidoc[]
@@ -7,7 +7,7 @@ require "logstash/plugin_mixins/http_client"
7
7
  require "zlib"
8
8
 
9
9
  class LogStash::Outputs::Http < LogStash::Outputs::Base
10
- include LogStash::PluginMixins::HttpClient[:with_deprecated => true]
10
+ include LogStash::PluginMixins::HttpClient[:with_obsolete => true]
11
11
 
12
12
  concurrency :shared
13
13
 
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = 'logstash-output-http'
3
- s.version = '5.7.0'
3
+ s.version = '6.0.0'
4
4
  s.licenses = ['Apache License (2.0)']
5
5
  s.summary = "Sends events to a generic HTTP or HTTPS endpoint"
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"
@@ -20,9 +20,12 @@ Gem::Specification.new do |s|
20
20
 
21
21
  # Gem dependencies
22
22
  s.add_runtime_dependency "logstash-core-plugin-api", ">= 1.60", "<= 2.99"
23
- s.add_runtime_dependency "logstash-mixin-http_client", ">= 7.4.0", "< 8.0.0"
23
+ s.add_runtime_dependency "logstash-mixin-http_client", ">= 7.5.0", "< 8.0.0"
24
24
 
25
25
  s.add_development_dependency 'logstash-devutils'
26
26
  s.add_development_dependency 'sinatra'
27
27
  s.add_development_dependency 'webrick'
28
+
29
+ # Pin to avoid using new Fiber-based implementation that breaks tests here
30
+ s.add_development_dependency 'rackup', "< 2.1.0"
28
31
  end
@@ -20,6 +20,32 @@ describe LogStash::Outputs::Http do
20
20
  let(:url) { "http://localhost:#{port}/good" }
21
21
  let(:method) { "post" }
22
22
 
23
+ describe "obsolete settings" do
24
+ let(:config) { {"url" => url, "http_method" => "post"} }
25
+
26
+ [{:name => 'cacert', :canonical_name => 'ssl_certificate_authorities'},
27
+ {:name => 'client_cert', :canonical_name => 'ssl_certificate'},
28
+ {:name => 'client_key', :canonical_name => 'ssl_key'},
29
+ {:name => "keystore", :canonical_name => 'ssl_keystore_path'},
30
+ {:name => 'truststore', :canonical_name => 'ssl_truststore_path'},
31
+ {:name => "keystore_password", :canonical_name => "ssl_keystore_password"},
32
+ {:name => 'truststore_password', :canonical_name => "ssl_truststore_password"},
33
+ {:name => "keystore_type", :canonical_name => "ssl_keystore_type"},
34
+ {:name => 'truststore_type', :canonical_name => 'ssl_truststore_type'}
35
+ ].each do |settings|
36
+ context "with option #{settings[:name]}" do
37
+ let(:obsolete_config) { config.merge(settings[:name] => 'test_value') }
38
+
39
+ it "emits an error about the setting `#{settings[:name]}` now being obsolete and provides guidance to use `#{settings[:canonical_name]}`" do
40
+ error_text = /The setting `#{settings[:name]}` in plugin `http` is obsolete and is no longer available. Use `#{settings[:canonical_name]}` instead/i
41
+ expect { LogStash::Outputs::Http.new(obsolete_config) }.to raise_error LogStash::ConfigurationError, error_text
42
+ end
43
+
44
+ end
45
+ end
46
+ end
47
+
48
+
23
49
  shared_examples("verb behavior") do |method|
24
50
 
25
51
  shared_examples("failure log behaviour") do
@@ -255,7 +281,7 @@ describe LogStash::Outputs::Http do
255
281
  end
256
282
 
257
283
  let(:last_request) { TestApp.last_request }
258
- let(:body) { last_request.body.read }
284
+ let(:body) { read_last_request_body(last_request) }
259
285
  let(:content_type) { last_request.env["CONTENT_TYPE"] }
260
286
 
261
287
  it "should receive the request" do
@@ -458,7 +484,7 @@ RSpec.describe LogStash::Outputs::Http do # different block as we're starting we
458
484
  after { subject.close }
459
485
 
460
486
  let(:last_request) { TestApp.last_request }
461
- let(:last_request_body) { last_request.body.read }
487
+ let(:last_request_body) { read_last_request_body(last_request) }
462
488
 
463
489
  let(:event) { LogStash::Event.new("message" => "hello!") }
464
490
 
@@ -530,3 +556,10 @@ RSpec.describe LogStash::Outputs::Http do # different block as we're starting we
530
556
  end if tls_version_enabled_by_default?('TLSv1.3') && JOpenSSL::VERSION > '0.12' # due WEBrick uses OpenSSL
531
557
 
532
558
  end
559
+
560
+ # Pre-emptively rewind the retrieval of `last_request.body` - for form based endpoints, the body
561
+ # is placed in params, and body is empty, requiring a `rewind` for the body to be available for comparison
562
+ def read_last_request_body(last_request)
563
+ last_request.body.rewind
564
+ last_request.body.read
565
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: logstash-output-http
3
3
  version: !ruby/object:Gem::Version
4
- version: 5.7.0
4
+ version: 6.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Elastic
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-06-19 00:00:00.000000000 Z
11
+ date: 2024-11-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  requirement: !ruby/object:Gem::Requirement
@@ -20,8 +20,8 @@ dependencies:
20
20
  - !ruby/object:Gem::Version
21
21
  version: '2.99'
22
22
  name: logstash-core-plugin-api
23
- prerelease: false
24
23
  type: :runtime
24
+ prerelease: false
25
25
  version_requirements: !ruby/object:Gem::Requirement
26
26
  requirements:
27
27
  - - ">="
@@ -35,18 +35,18 @@ dependencies:
35
35
  requirements:
36
36
  - - ">="
37
37
  - !ruby/object:Gem::Version
38
- version: 7.4.0
38
+ version: 7.5.0
39
39
  - - "<"
40
40
  - !ruby/object:Gem::Version
41
41
  version: 8.0.0
42
42
  name: logstash-mixin-http_client
43
- prerelease: false
44
43
  type: :runtime
44
+ prerelease: false
45
45
  version_requirements: !ruby/object:Gem::Requirement
46
46
  requirements:
47
47
  - - ">="
48
48
  - !ruby/object:Gem::Version
49
- version: 7.4.0
49
+ version: 7.5.0
50
50
  - - "<"
51
51
  - !ruby/object:Gem::Version
52
52
  version: 8.0.0
@@ -57,8 +57,8 @@ dependencies:
57
57
  - !ruby/object:Gem::Version
58
58
  version: '0'
59
59
  name: logstash-devutils
60
- prerelease: false
61
60
  type: :development
61
+ prerelease: false
62
62
  version_requirements: !ruby/object:Gem::Requirement
63
63
  requirements:
64
64
  - - ">="
@@ -71,8 +71,8 @@ dependencies:
71
71
  - !ruby/object:Gem::Version
72
72
  version: '0'
73
73
  name: sinatra
74
- prerelease: false
75
74
  type: :development
75
+ prerelease: false
76
76
  version_requirements: !ruby/object:Gem::Requirement
77
77
  requirements:
78
78
  - - ">="
@@ -85,13 +85,27 @@ dependencies:
85
85
  - !ruby/object:Gem::Version
86
86
  version: '0'
87
87
  name: webrick
88
- prerelease: false
89
88
  type: :development
89
+ prerelease: false
90
90
  version_requirements: !ruby/object:Gem::Requirement
91
91
  requirements:
92
92
  - - ">="
93
93
  - !ruby/object:Gem::Version
94
94
  version: '0'
95
+ - !ruby/object:Gem::Dependency
96
+ requirement: !ruby/object:Gem::Requirement
97
+ requirements:
98
+ - - "<"
99
+ - !ruby/object:Gem::Version
100
+ version: 2.1.0
101
+ name: rackup
102
+ type: :development
103
+ prerelease: false
104
+ version_requirements: !ruby/object:Gem::Requirement
105
+ requirements:
106
+ - - "<"
107
+ - !ruby/object:Gem::Version
108
+ version: 2.1.0
95
109
  description: This gem is a Logstash plugin required to be installed on top of the
96
110
  Logstash core pipeline using $LS_HOME/bin/logstash-plugin install gemname. This
97
111
  gem is not a stand-alone program
@@ -133,7 +147,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
133
147
  - !ruby/object:Gem::Version
134
148
  version: '0'
135
149
  requirements: []
136
- rubygems_version: 3.2.33
150
+ rubygems_version: 3.3.26
137
151
  signing_key:
138
152
  specification_version: 4
139
153
  summary: Sends events to a generic HTTP or HTTPS endpoint