fluentd 1.14.0.rc → 1.14.0
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of fluentd might be problematic. Click here for more details.
- checksums.yaml +4 -4
- data/.github/workflows/windows-test.yaml +3 -3
- data/CHANGELOG.md +44 -0
- data/lib/fluent/plugin/in_http.rb +21 -2
- data/lib/fluent/version.rb +1 -1
- data/test/plugin/test_in_http.rb +40 -0
- metadata +8 -8
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7d57a00fbe9b7fdbbac7ce75dfd9a4cf2a963b2cc4e5288dd37caf967fc5572f
|
4
|
+
data.tar.gz: b447f9876816029af978af3a27efd579a51794b991a79b2a57dfea3a65b0d234
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ae67626874b6294ec88fc20ebd61fd34e6b809199227624eb703e9a7010d4269b87a4d10d8cd02b689e82b6be175200ff7b7d1649bfd9b1df7e864834a6a16fd
|
7
|
+
data.tar.gz: cc3694e775abe4aba0223592f602f68be04367c5a0eb50e86129457d604c0bf8f557b5936e44fb550fafe849556687f84e75eba5dc44f2e806652c5694eb5804
|
@@ -18,7 +18,7 @@ jobs:
|
|
18
18
|
- windows-latest
|
19
19
|
experimental: [false]
|
20
20
|
include:
|
21
|
-
- ruby-version: '3.0.
|
21
|
+
- ruby-version: '3.0.2'
|
22
22
|
os: windows-latest
|
23
23
|
experimental: true
|
24
24
|
# On Ruby 3.0, we need to use fiddle 1.0.8 or later to retrieve correct
|
@@ -28,7 +28,7 @@ jobs:
|
|
28
28
|
# * https://github.com/ruby/fiddle/issues/72
|
29
29
|
# * https://bugs.ruby-lang.org/issues/17813
|
30
30
|
# * https://github.com/oneclick/rubyinstaller2/blob/8225034c22152d8195bc0aabc42a956c79d6c712/lib/ruby_installer/build/dll_directory.rb
|
31
|
-
ruby-lib-opt: RUBYLIB=%RUNNER_TOOL_CACHE%/Ruby/3.0.
|
31
|
+
ruby-lib-opt: RUBYLIB=%RUNNER_TOOL_CACHE%/Ruby/3.0.2/x64/lib/ruby/gems/3.0.0/gems/fiddle-1.0.8/lib
|
32
32
|
|
33
33
|
name: Unit testing with Ruby ${{ matrix.ruby-version }} on ${{ matrix.os }}
|
34
34
|
steps:
|
@@ -38,7 +38,7 @@ jobs:
|
|
38
38
|
with:
|
39
39
|
ruby-version: ${{ matrix.ruby-version }}
|
40
40
|
- name: Add Fiddle 1.0.8
|
41
|
-
if: ${{ matrix.ruby-version == '3.0.
|
41
|
+
if: ${{ matrix.ruby-version == '3.0.2' }}
|
42
42
|
run: gem install fiddle --version 1.0.8
|
43
43
|
- name: Install dependencies
|
44
44
|
run: ridk exec bundle install
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,47 @@
|
|
1
|
+
# v1.14.0
|
2
|
+
|
3
|
+
## Release v1.14.0 - 2021/08/30
|
4
|
+
|
5
|
+
### Enhancement
|
6
|
+
|
7
|
+
* Added `enable_input_metrics`, `enable_size_metrics` system
|
8
|
+
configuration parameter
|
9
|
+
This feature might need to pay higher CPU cost, so input event metrics
|
10
|
+
features are disabled by default. These features are also enabled by
|
11
|
+
`--enable-input-metrics`,`--enable-size-metrics` command line
|
12
|
+
option.
|
13
|
+
https://github.com/fluent/fluentd/pull/3440
|
14
|
+
* Added reserved word `@ROOT` for getting root router.
|
15
|
+
This is incompatible change. Do not use `@ROOT` for label name.
|
16
|
+
https://github.com/fluent/fluentd/pull/3358
|
17
|
+
* in_syslog: Added `send_keepalive_packet` option
|
18
|
+
https://github.com/fluent/fluentd/pull/3474
|
19
|
+
* in_http: Added `cors_allow_credentials` option.
|
20
|
+
This option tells browsers whether to expose the response to
|
21
|
+
frontend when the credentials mode is "include".
|
22
|
+
https://github.com/fluent/fluentd/pull/3481
|
23
|
+
https://github.com/fluent/fluentd/pull/3491
|
24
|
+
|
25
|
+
### Bug fix
|
26
|
+
|
27
|
+
* in_tail: Fixed a bug that deleted paths are not removed
|
28
|
+
from pos file by file compaction at start up
|
29
|
+
https://github.com/fluent/fluentd/pull/3467
|
30
|
+
* in_tail: Revived a warning message of retrying unaccessible file
|
31
|
+
https://github.com/fluent/fluentd/pull/3478
|
32
|
+
* TLSServer: Fixed a crash bug on logging peer host name errors
|
33
|
+
https://github.com/fluent/fluentd/pull/3483
|
34
|
+
|
35
|
+
### Misc
|
36
|
+
|
37
|
+
* Added metrics plugin mechanism
|
38
|
+
The implementations is changed to use metrics plugin.
|
39
|
+
In the future, 3rd party plugin will be able to handle these metrics.
|
40
|
+
https://github.com/fluent/fluentd/pull/3471
|
41
|
+
https://github.com/fluent/fluentd/pull/3473
|
42
|
+
https://github.com/fluent/fluentd/pull/3479
|
43
|
+
https://github.com/fluent/fluentd/pull/3484
|
44
|
+
|
1
45
|
# v1.13.3
|
2
46
|
|
3
47
|
## Release v1.13.3 - 2021/07/27
|
@@ -74,6 +74,8 @@ module Fluent::Plugin
|
|
74
74
|
config_param :blocking_timeout, :time, default: 0.5
|
75
75
|
desc 'Set a allow list of domains that can do CORS (Cross-Origin Resource Sharing)'
|
76
76
|
config_param :cors_allow_origins, :array, default: nil
|
77
|
+
desc 'Tells browsers whether to expose the response to frontend when the credentials mode is "include".'
|
78
|
+
config_param :cors_allow_credentials, :bool, default: false
|
77
79
|
desc 'Respond with empty gif image of 1x1 pixel.'
|
78
80
|
config_param :respond_with_empty_img, :bool, default: false
|
79
81
|
desc 'Respond status code with 204.'
|
@@ -112,6 +114,12 @@ module Fluent::Plugin
|
|
112
114
|
|
113
115
|
super
|
114
116
|
|
117
|
+
if @cors_allow_credentials
|
118
|
+
if @cors_allow_origins.nil? || @cors_allow_origins.include?('*')
|
119
|
+
raise Fluent::ConfigError, "Cannot enable cors_allow_credentials without specific origins"
|
120
|
+
end
|
121
|
+
end
|
122
|
+
|
115
123
|
m = if @parser_configs.first['@type'] == 'in_http'
|
116
124
|
@parser_msgpack = parser_create(usage: 'parser_in_http_msgpack', type: 'msgpack')
|
117
125
|
@parser_msgpack.time_key = nil
|
@@ -279,7 +287,10 @@ module Fluent::Plugin
|
|
279
287
|
private
|
280
288
|
|
281
289
|
def on_server_connect(conn)
|
282
|
-
handler = Handler.new(conn, @km, method(:on_request),
|
290
|
+
handler = Handler.new(conn, @km, method(:on_request),
|
291
|
+
@body_size_limit, @format_name, log,
|
292
|
+
@cors_allow_origins, @cors_allow_credentials,
|
293
|
+
@add_query_params)
|
283
294
|
|
284
295
|
conn.on(:data) do |data|
|
285
296
|
handler.on_read(data)
|
@@ -356,7 +367,8 @@ module Fluent::Plugin
|
|
356
367
|
class Handler
|
357
368
|
attr_reader :content_type
|
358
369
|
|
359
|
-
def initialize(io, km, callback, body_size_limit, format_name, log,
|
370
|
+
def initialize(io, km, callback, body_size_limit, format_name, log,
|
371
|
+
cors_allow_origins, cors_allow_credentials, add_query_params)
|
360
372
|
@io = io
|
361
373
|
@km = km
|
362
374
|
@callback = callback
|
@@ -365,6 +377,7 @@ module Fluent::Plugin
|
|
365
377
|
@format_name = format_name
|
366
378
|
@log = log
|
367
379
|
@cors_allow_origins = cors_allow_origins
|
380
|
+
@cors_allow_credentials = cors_allow_credentials
|
368
381
|
@idle = 0
|
369
382
|
@add_query_params = add_query_params
|
370
383
|
@km.add(self)
|
@@ -491,6 +504,9 @@ module Fluent::Plugin
|
|
491
504
|
send_response_and_close(RES_200_STATUS, header, "")
|
492
505
|
elsif include_cors_allow_origin
|
493
506
|
header["Access-Control-Allow-Origin"] = @origin
|
507
|
+
if @cors_allow_credentials
|
508
|
+
header["Access-Control-Allow-Credentials"] = true
|
509
|
+
end
|
494
510
|
send_response_and_close(RES_200_STATUS, header, "")
|
495
511
|
else
|
496
512
|
send_response_and_close(RES_403_STATUS, {}, "")
|
@@ -576,6 +592,9 @@ module Fluent::Plugin
|
|
576
592
|
header['Access-Control-Allow-Origin'] = '*'
|
577
593
|
elsif include_cors_allow_origin
|
578
594
|
header['Access-Control-Allow-Origin'] = @origin
|
595
|
+
if @cors_allow_credentials
|
596
|
+
header["Access-Control-Allow-Credentials"] = true
|
597
|
+
end
|
579
598
|
end
|
580
599
|
end
|
581
600
|
|
data/lib/fluent/version.rb
CHANGED
data/test/plugin/test_in_http.rb
CHANGED
@@ -856,6 +856,46 @@ class HttpInputTest < Test::Unit::TestCase
|
|
856
856
|
end
|
857
857
|
end
|
858
858
|
|
859
|
+
def test_cors_allow_credentials
|
860
|
+
d = create_driver(config + %[
|
861
|
+
cors_allow_origins ["http://foo.com"]
|
862
|
+
cors_allow_credentials
|
863
|
+
])
|
864
|
+
assert_equal true, d.instance.cors_allow_credentials
|
865
|
+
|
866
|
+
time = event_time("2011-01-02 13:14:15 UTC")
|
867
|
+
event = ["tag1", time, {"a"=>1}]
|
868
|
+
res_code = nil
|
869
|
+
res_header = nil
|
870
|
+
|
871
|
+
d.run do
|
872
|
+
res = post("/#{event[0]}", {"json"=>event[2].to_json, "time"=>time.to_i.to_s}, {"Origin"=>"http://foo.com"})
|
873
|
+
res_code = res.code
|
874
|
+
res_header = res["Access-Control-Allow-Credentials"]
|
875
|
+
end
|
876
|
+
assert_equal(
|
877
|
+
{
|
878
|
+
response_code: "200",
|
879
|
+
allow_credentials_header: "true",
|
880
|
+
events: [event]
|
881
|
+
},
|
882
|
+
{
|
883
|
+
response_code: res_code,
|
884
|
+
allow_credentials_header: res_header,
|
885
|
+
events: d.events
|
886
|
+
}
|
887
|
+
)
|
888
|
+
end
|
889
|
+
|
890
|
+
def test_cors_allow_credentials_for_wildcard_origins
|
891
|
+
assert_raise(Fluent::ConfigError) do
|
892
|
+
create_driver(config + %[
|
893
|
+
cors_allow_origins ["*"]
|
894
|
+
cors_allow_credentials
|
895
|
+
])
|
896
|
+
end
|
897
|
+
end
|
898
|
+
|
859
899
|
def test_content_encoding_gzip
|
860
900
|
d = create_driver
|
861
901
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fluentd
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.14.0
|
4
|
+
version: 1.14.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sadayuki Furuhashi
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-08-
|
11
|
+
date: 2021-08-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -929,7 +929,7 @@ homepage: https://www.fluentd.org/
|
|
929
929
|
licenses:
|
930
930
|
- Apache-2.0
|
931
931
|
metadata: {}
|
932
|
-
post_install_message:
|
932
|
+
post_install_message:
|
933
933
|
rdoc_options: []
|
934
934
|
require_paths:
|
935
935
|
- lib
|
@@ -940,12 +940,12 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
940
940
|
version: '2.4'
|
941
941
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
942
942
|
requirements:
|
943
|
-
- - "
|
943
|
+
- - ">="
|
944
944
|
- !ruby/object:Gem::Version
|
945
|
-
version:
|
945
|
+
version: '0'
|
946
946
|
requirements: []
|
947
|
-
rubygems_version: 3.
|
948
|
-
signing_key:
|
947
|
+
rubygems_version: 3.1.6
|
948
|
+
signing_key:
|
949
949
|
specification_version: 4
|
950
950
|
summary: Fluentd event collector
|
951
951
|
test_files:
|