logstash-input-http 3.5.0-java → 3.5.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: 6aa25c7162af258a659215d8a560a89a84828ee3e6818453e81972840a857b7e
4
- data.tar.gz: 7cc02b9c2e3c0759124b18203f6ef0a4819b70598374e525b7b26649a3ceb3ed
3
+ metadata.gz: 57c80d7659006a5cbaa321016046be88431d7df9ab7aff47c2b6e22670e420aa
4
+ data.tar.gz: fbf35768bf5bfc1bddeb2fab860ca5dd6e7d76eee6e5b03590ea6239ebb0935a
5
5
  SHA512:
6
- metadata.gz: 556bbf56d66417ffa1b41256c3bf3f38bcac34857ba1d35a94e9c97975fe313b8961571e5d93512f30d1e7f148e1b6afe5d18cdffc2453acd9566d59e57d35e2
7
- data.tar.gz: 8868526ad0737dc84aca959ff7694603d11296a0d5627dceccb17378ac4dbc021f775e9ab3811418b42b1d5559ef38e693aec00b23f591300d0c5621bb65d678
6
+ metadata.gz: 6474b6cf869b1e9c07f43ddf7c7903496d38d366f02f3a5c4217c16011eb008dcee940bc87d1f77a885c5c92c0f440ea207e56c677431df65d04f9cb3fcafb82
7
+ data.tar.gz: 5ddf0b72e016873e9bce678f74f8052dbad329819fadcfcf431af0d2126251a33901f5033b0948eff2e18f08dd0d107c092f505cabd63b5731c2679a3c13e0af
data/CHANGELOG.md CHANGED
@@ -1,3 +1,6 @@
1
+ ## 3.5.1
2
+ - Fix: codecs provided with `additional_codecs` now correctly run in the pipeline's context, which means that they respect the `pipeline.ecs_compatibility` setting [#152](https://github.com/logstash-plugins/logstash-input-http/pull/152)
3
+
1
4
  ## 3.5.0
2
5
  - Feat: TLSv1.3 support [#146](https://github.com/logstash-plugins/logstash-input-http/pull/146)
3
6
 
data/VERSION CHANGED
@@ -1 +1 @@
1
- 3.5.0
1
+ 3.5.1
data/docs/index.asciidoc CHANGED
@@ -136,9 +136,10 @@ and no codec for the request's content-type is found
136
136
  * Value type is <<array,array>>
137
137
  * Default value is `[TLS_AES_128_GCM_SHA256, TLS_AES_256_GCM_SHA384, TLS_CHACHA20_POLY1305_SHA256, TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384, TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384, TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305_SHA256, TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305_SHA256, TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256, TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256, TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA384, TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384, TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256, TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256]`
138
138
 
139
- The list of ciphers suite to use, listed by priorities.
140
- The default values applies for OpenJDK 11.0.14 and higher, for older versions the list does not include suites
141
- not supported by the JDK, such as the ChaCha20 family of ciphers.
139
+ The list of cipher suites to use, listed by priorities.
140
+ This default list applies for OpenJDK 11.0.14 and higher.
141
+ For older JDK versions, the default list includes only suites supported by that version.
142
+ For example, the ChaCha20 family of ciphers is not supported in older versions.
142
143
 
143
144
  [id="plugins-{type}s-{plugin}-ecs_compatibility"]
144
145
  ===== `ecs_compatibility`
@@ -127,6 +127,8 @@ class LogStash::Inputs::Http < LogStash::Inputs::Base
127
127
  config :verify_mode, :validate => ['none', 'peer', 'force_peer'], :default => 'none',
128
128
  :deprecated => "Set 'ssl_verify_mode' instead."
129
129
 
130
+ attr_reader :codecs
131
+
130
132
  public
131
133
  def register
132
134
 
@@ -140,7 +142,7 @@ class LogStash::Inputs::Http < LogStash::Inputs::Base
140
142
  @codecs = Hash.new
141
143
 
142
144
  @additional_codecs.each do |content_type, codec|
143
- @codecs[content_type] = LogStash::Plugin.lookup("codec", codec).new
145
+ @codecs[content_type] = initialize_codec(codec)
144
146
  end
145
147
 
146
148
  require "logstash/inputs/http/message_handler"
@@ -333,4 +335,13 @@ class LogStash::Inputs::Http < LogStash::Inputs::Base
333
335
  error_details
334
336
  end
335
337
 
338
+ def initialize_codec(codec_name)
339
+ codec_klass = LogStash::Plugin.lookup("codec", codec_name)
340
+ if defined?(::LogStash::Plugins::Contextualizer)
341
+ ::LogStash::Plugins::Contextualizer.initialize_plugin(execution_context, codec_klass)
342
+ else
343
+ codec_klass.new
344
+ end
345
+ end
346
+
336
347
  end # class LogStash::Inputs::Http
@@ -2,4 +2,4 @@
2
2
 
3
3
  require 'jar_dependencies'
4
4
  require_jar('io.netty', 'netty-all', '4.1.65.Final')
5
- require_jar('org.logstash.plugins.input.http', 'logstash-input-http', '3.5.0')
5
+ require_jar('org.logstash.plugins.input.http', 'logstash-input-http', '3.5.1')
@@ -656,4 +656,68 @@ describe LogStash::Inputs::Http do
656
656
 
657
657
  end
658
658
  end
659
+ end if false
660
+
661
+ # If we have a setting called `pipeline.ecs_compatibility`, we need to
662
+ # ensure that our additional_codecs are instantiated with the proper
663
+ # execution context in order to ensure that the pipeline setting is
664
+ # respected.
665
+ if LogStash::SETTINGS.registered?('pipeline.ecs_compatibility')
666
+
667
+ def with_setting(name, value, &block)
668
+ setting = LogStash::SETTINGS.get_setting(name)
669
+ was_set, orignial_value = setting.set?, setting.value
670
+ setting.set(value)
671
+
672
+ yield(true)
673
+
674
+ ensure
675
+ was_set ? setting.set(orignial_value) : setting.reset
676
+ end
677
+
678
+ def setting_value_supported?(name, value)
679
+ with_setting(name, value) { true }
680
+ rescue
681
+ false
682
+ end
683
+
684
+ describe LogStash::Inputs::Http do
685
+ context 'additional_codecs' do
686
+ let(:port) { rand(1025...5000) }
687
+
688
+ %w(disabled v1 v8).each do |spec|
689
+ if setting_value_supported?('pipeline.ecs_compatibility', spec)
690
+ context "with `pipeline.ecs_compatibility: #{spec}`" do
691
+ around(:each) { |example| with_setting('pipeline.ecs_compatibility', spec, &example) }
692
+
693
+ it 'propagates the ecs_compatibility pipeline setting to the additional_codecs' do
694
+ input("input { http { port => #{port} additional_codecs => { 'application/json' => 'json' 'text/plain' => 'plain' } } }") do |pipeline, queue|
695
+ http_input = pipeline.inputs.first
696
+ expect(http_input).to be_a_kind_of(described_class) # precondition
697
+
698
+ http_input.codecs.each do |key, value|
699
+ aggregate_failures("Codec for `#{key}`") do
700
+ expect(value.ecs_compatibility).to eq(spec.to_sym)
701
+ end
702
+ end
703
+ end
704
+ end
705
+ end
706
+ end
707
+ end
708
+
709
+ it 'propagates the execution context from the input to the codecs' do
710
+ input("input { http { port => #{port} } }") do |pipeline, queue|
711
+ http_input = pipeline.inputs.first
712
+ expect(http_input).to be_a_kind_of(described_class) # precondition
713
+
714
+ http_input.codecs.each do |key, value|
715
+ aggregate_failures("Codec for `#{key}`") do
716
+ expect(value.execution_context).to be http_input.execution_context
717
+ end
718
+ end
719
+ end
720
+ end
721
+ end
722
+ end
659
723
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: logstash-input-http
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.5.0
4
+ version: 3.5.1
5
5
  platform: java
6
6
  authors:
7
7
  - Elastic
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-03-17 00:00:00.000000000 Z
11
+ date: 2022-04-12 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
- type: :runtime
24
23
  prerelease: false
24
+ type: :runtime
25
25
  version_requirements: !ruby/object:Gem::Requirement
26
26
  requirements:
27
27
  - - ">="
@@ -37,8 +37,8 @@ dependencies:
37
37
  - !ruby/object:Gem::Version
38
38
  version: '0'
39
39
  name: logstash-codec-plain
40
- type: :runtime
41
40
  prerelease: false
41
+ type: :runtime
42
42
  version_requirements: !ruby/object:Gem::Requirement
43
43
  requirements:
44
44
  - - ">="
@@ -54,8 +54,8 @@ dependencies:
54
54
  - !ruby/object:Gem::Version
55
55
  version: 0.3.4
56
56
  name: jar-dependencies
57
- type: :runtime
58
57
  prerelease: false
58
+ type: :runtime
59
59
  version_requirements: !ruby/object:Gem::Requirement
60
60
  requirements:
61
61
  - - "~>"
@@ -71,8 +71,8 @@ dependencies:
71
71
  - !ruby/object:Gem::Version
72
72
  version: '1.2'
73
73
  name: logstash-mixin-ecs_compatibility_support
74
- type: :runtime
75
74
  prerelease: false
75
+ type: :runtime
76
76
  version_requirements: !ruby/object:Gem::Requirement
77
77
  requirements:
78
78
  - - "~>"
@@ -85,8 +85,8 @@ dependencies:
85
85
  - !ruby/object:Gem::Version
86
86
  version: '0'
87
87
  name: logstash-devutils
88
- type: :development
89
88
  prerelease: false
89
+ type: :development
90
90
  version_requirements: !ruby/object:Gem::Requirement
91
91
  requirements:
92
92
  - - ">="
@@ -99,8 +99,8 @@ dependencies:
99
99
  - !ruby/object:Gem::Version
100
100
  version: '0'
101
101
  name: logstash-codec-json
102
- type: :development
103
102
  prerelease: false
103
+ type: :development
104
104
  version_requirements: !ruby/object:Gem::Requirement
105
105
  requirements:
106
106
  - - ">="
@@ -113,8 +113,8 @@ dependencies:
113
113
  - !ruby/object:Gem::Version
114
114
  version: '0'
115
115
  name: logstash-codec-json_lines
116
- type: :development
117
116
  prerelease: false
117
+ type: :development
118
118
  version_requirements: !ruby/object:Gem::Requirement
119
119
  requirements:
120
120
  - - ">="
@@ -127,8 +127,8 @@ dependencies:
127
127
  - !ruby/object:Gem::Version
128
128
  version: '0'
129
129
  name: manticore
130
- type: :development
131
130
  prerelease: false
131
+ type: :development
132
132
  version_requirements: !ruby/object:Gem::Requirement
133
133
  requirements:
134
134
  - - ">="
@@ -173,7 +173,7 @@ files:
173
173
  - spec/fixtures/certs/openssl.cnf
174
174
  - spec/inputs/http_spec.rb
175
175
  - vendor/jar-dependencies/io/netty/netty-all/4.1.65.Final/netty-all-4.1.65.Final.jar
176
- - vendor/jar-dependencies/org/logstash/plugins/input/http/logstash-input-http/3.5.0/logstash-input-http-3.5.0.jar
176
+ - vendor/jar-dependencies/org/logstash/plugins/input/http/logstash-input-http/3.5.1/logstash-input-http-3.5.1.jar
177
177
  homepage: http://www.elastic.co/guide/en/logstash/current/index.html
178
178
  licenses:
179
179
  - Apache License (2.0)
@@ -196,7 +196,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
196
196
  - !ruby/object:Gem::Version
197
197
  version: '0'
198
198
  requirements: []
199
- rubygems_version: 3.0.6
199
+ rubygems_version: 3.1.6
200
200
  signing_key:
201
201
  specification_version: 4
202
202
  summary: Receives events over HTTP or HTTPS