fluentd-json-size-limit 0.1.5 → 0.2.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.
data/.gitlab-ci.yml DELETED
@@ -1,178 +0,0 @@
1
- include:
2
- - project: 'gitlab/gitlab_includes'
3
- ref: 'master'
4
- file: '/trivy-repo-checks-template/.gitlab-ci.yml'
5
-
6
- default:
7
- tags:
8
- - k8s-tools-live
9
-
10
- stages:
11
- - start
12
- - validate
13
- - build
14
- - security-check
15
- - publish
16
- - final
17
-
18
- notify_on_start:
19
- variables:
20
- GIT_STRATEGY: none
21
- stage: start
22
- script:
23
- - |
24
- if [ ! -z "${CI_MERGE_REQUEST_TARGET_BRANCH_NAME}" ]; then
25
- slack_send "Starting pipeline for MR of *$CI_MERGE_REQUEST_SOURCE_BRANCH_NAME* branch into the *$CI_MERGE_REQUEST_TARGET_BRANCH_NAME* branch of the *$CI_PROJECT_NAME* docker image."
26
- elif [ ! -z "${CI_COMMIT_TAG}" ]; then
27
- slack_send "Starting pipeline for tag *$CI_COMMIT_TAG* of the *$CI_PROJECT_NAME* docker image."
28
- elif [ ! -z "${CI_COMMIT_BRANCH}" ]; then
29
- slack_send "Starting pipeline for branch *$CI_COMMIT_BRANCH* of the *$CI_PROJECT_NAME* docker image."
30
- else
31
- echo "Something went wront. Exiting..."
32
- exit 1
33
- fi
34
- artifacts:
35
- name: $CI_PIPELINE_ID
36
- paths:
37
- - slack_thread_ts
38
- expire_in: 60min
39
- when: always
40
- rules:
41
- - if: $CI_MERGE_REQUEST_TARGET_BRANCH_NAME == "master"
42
- when: always
43
- changes:
44
- - "*.gemsec"
45
- - "*.yaml"
46
- - "lib/fluent/plugin/*.rb"
47
- - "test/plugin/*.rb"
48
- - if: $CI_COMMIT_TAG =~ /^v\d{1,}\.\d{1,}\.\d{1,}$/ || $CI_COMMIT_BRANCH =~ /.*(\w{2,}-\d{1,}).*/
49
- when: always
50
- changes:
51
- - "*.gemsec"
52
- - "*.yaml"
53
- - "lib/fluent/plugin/*.rb"
54
- - "test/plugin/*.rb"
55
- - when: never
56
-
57
-
58
- validating:
59
- stage: validate
60
- script:
61
- - bundle config set --local path '~/gems'
62
- - bundle install
63
- - bundle exec rake test
64
- rules:
65
- - if: '$CI_MERGE_REQUEST_TARGET_BRANCH_NAME == "master" || $CI_COMMIT_BRANCH =~ /.*(\w{2,}-\d{1,}).*/'
66
- when: always
67
- changes:
68
- - "*.gemsec"
69
- - "*.yaml"
70
- - "lib/fluent/plugin/*.rb"
71
- - "test/plugin/*.rb"
72
- - when: never
73
-
74
- build:
75
- stage: build
76
- script:
77
- - gem build fluentd-json-size-limit.gemspec
78
- artifacts:
79
- paths:
80
- - fluentd-json-size-limit-*.gem
81
- expire_in: 60min
82
- rules:
83
- - if: '$CI_COMMIT_TAG'
84
- when: on_success
85
- changes:
86
- - "*.gemsec"
87
- - "*.yaml"
88
- - "lib/fluent/plugin/*.rb"
89
- - "test/plugin/*.rb"
90
-
91
- publish:
92
- stage: publish
93
- before_script:
94
- - AWS_CREDENTIALS=$(aws sts assume-role --role-arn arn:aws:iam::315805068186:role/SMR=rubygems-cicd-ci --role-session-name gitlab-secretsmanager-access)
95
- - export AWS_ACCESS_KEY_ID=$(echo $AWS_CREDENTIALS | jq .Credentials | jq -r .AccessKeyId)
96
- - export AWS_SECRET_ACCESS_KEY=$(echo $AWS_CREDENTIALS | jq .Credentials | jq -r .SecretAccessKey)
97
- - export AWS_SESSION_TOKEN=$(echo $AWS_CREDENTIALS | jq .Credentials | jq -r .SessionToken)
98
- - export GEM_HOST_API_KEY_SECRET=$(aws secretsmanager get-secret-value --secret-id rubygems/cicd/ci --region us-west-1)
99
- - export GEM_HOST_API_KEY=$(echo $GEM_HOST_API_KEY_SECRET | jq .SecretString | jq fromjson | jq -r .GEM_HOST_API_KEY)
100
- - unset AWS_ACCESS_KEY_ID
101
- - unset AWS_SECRET_ACCESS_KEY
102
- - unset AWS_SESSION_TOKEN
103
- script:
104
- - gem push fluentd-json-size-limit-*.gem
105
- rules:
106
- - if: '$CI_COMMIT_TAG'
107
- when: on_success
108
- changes:
109
- - "*.gemsec"
110
- - "*.yaml"
111
- - "lib/fluent/plugin/*.rb"
112
- - "test/plugin/*.rb"
113
-
114
- notify_on_success:
115
- variables:
116
- GIT_STRATEGY: none
117
- stage: final
118
- dependencies:
119
- - notify_on_start
120
- script:
121
- - |
122
- if [ ! -z "${CI_COMMIT_TAG}" ]; then
123
- slack_send "Pipeline for tag *$CI_COMMIT_TAG* of the *$CI_PROJECT_NAME* docker image succeeded" --status success
124
- elif [ ! -z "${CI_COMMIT_BRANCH}" ] || [ ! -z "${CI_MERGE_REQUEST_TARGET_BRANCH_NAME}" ]; then
125
- slack_send "Pipeline for branch *$CI_COMMIT_BRANCH$CI_MERGE_REQUEST_SOURCE_BRANCH_NAME* of the *$CI_PROJECT_NAME* docker image succeeded" --status success
126
- else
127
- echo "Something went wront. Exiting..."
128
- exit 1
129
- fi
130
- rules:
131
- - if: $CI_MERGE_REQUEST_TARGET_BRANCH_NAME == "master"
132
- when: on_success
133
- changes:
134
- - "*.gemsec"
135
- - "*.yaml"
136
- - "lib/fluent/plugin/*.rb"
137
- - "test/plugin/*.rb"
138
- - if: $CI_COMMIT_TAG =~ /^v\d{1,}\.\d{1,}\.\d{1,}$/ || $CI_COMMIT_BRANCH =~ /.*(\w{2,}-\d{1,}).*/
139
- when: on_success
140
- changes:
141
- - "*.gemsec"
142
- - "*.yaml"
143
- - "lib/fluent/plugin/*.rb"
144
- - "test/plugin/*.rb"
145
- - when: never
146
-
147
- notify_on_fail:
148
- variables:
149
- GIT_STRATEGY: none
150
- stage: final
151
- dependencies:
152
- - notify_on_start
153
- script:
154
- - |
155
- if [ ! -z "${CI_COMMIT_TAG}" ]; then
156
- slack_send "Pipeline for tag *$CI_COMMIT_TAG* of the *$CI_PROJECT_NAME* docker image failed" --status fail
157
- elif [ ! -z "${CI_COMMIT_BRANCH}" ] || [ ! -z "${CI_MERGE_REQUEST_TARGET_BRANCH_NAME}" ]; then
158
- slack_send "Pipeline for branch *$CI_COMMIT_BRANCH$CI_MERGE_REQUEST_SOURCE_BRANCH_NAME* of the *$CI_PROJECT_NAME* docker image failed" --status fail
159
- else
160
- echo "Something went wront. Exiting..."
161
- exit 1
162
- fi
163
- rules:
164
- - if: $CI_MERGE_REQUEST_TARGET_BRANCH_NAME == "master"
165
- when: on_failure
166
- changes:
167
- - "*.gemsec"
168
- - "*.yaml"
169
- - "lib/fluent/plugin/*.rb"
170
- - "test/plugin/*.rb"
171
- - if: $CI_COMMIT_TAG =~ /^v\d{1,}\.\d{1,}\.\d{1,}$/ || $CI_COMMIT_BRANCH =~ /.*(\w{2,}-\d{1,}).*/
172
- when: on_failure
173
- changes:
174
- - "*.gemsec"
175
- - "*.yaml"
176
- - "lib/fluent/plugin/*.rb"
177
- - "test/plugin/*.rb"
178
- - when: never
data/.trivyignore.yaml DELETED
@@ -1,7 +0,0 @@
1
- # https://aquasecurity.github.io/trivy/v0.49/docs/configuration/filtering/#trivyignoreyaml
2
- misconfigurations:
3
- # - id: AVD-DS-0000
4
- # paths:
5
- # - "*"
6
- # statement: *
7
-
data/Gemfile DELETED
@@ -1,3 +0,0 @@
1
- source "https://rubygems.org"
2
-
3
- gemspec
data/Gemfile.lock DELETED
@@ -1,107 +0,0 @@
1
- PATH
2
- remote: .
3
- specs:
4
- fluentd-json-size-limit (0.1.4)
5
- fluentd (>= 0.14.10, < 2)
6
-
7
- GEM
8
- remote: https://rubygems.org/
9
- specs:
10
- async (2.36.0)
11
- console (~> 1.29)
12
- fiber-annotation
13
- io-event (~> 1.11)
14
- metrics (~> 0.12)
15
- traces (~> 0.18)
16
- async-http (0.94.2)
17
- async (>= 2.10.2)
18
- async-pool (~> 0.11)
19
- io-endpoint (~> 0.14)
20
- io-stream (~> 0.6)
21
- metrics (~> 0.12)
22
- protocol-http (~> 0.58)
23
- protocol-http1 (~> 0.36)
24
- protocol-http2 (~> 0.22)
25
- protocol-url (~> 0.2)
26
- traces (~> 0.10)
27
- async-pool (0.11.1)
28
- async (>= 2.0)
29
- base64 (0.3.0)
30
- concurrent-ruby (1.3.6)
31
- console (1.34.2)
32
- fiber-annotation
33
- fiber-local (~> 1.1)
34
- json
35
- cool.io (1.9.1)
36
- csv (3.3.5)
37
- drb (2.2.3)
38
- fiber-annotation (0.2.0)
39
- fiber-local (1.1.0)
40
- fiber-storage
41
- fiber-storage (1.0.1)
42
- fluentd (1.19.1)
43
- async-http (~> 0.86)
44
- base64 (~> 0.2)
45
- bundler
46
- cool.io (>= 1.4.5, < 2.0.0)
47
- csv (~> 3.2)
48
- drb (~> 2.2)
49
- http_parser.rb (>= 0.5.1, < 0.9.0)
50
- logger (~> 1.6)
51
- msgpack (>= 1.3.1, < 2.0.0)
52
- serverengine (>= 2.3.2, < 3.0.0)
53
- sigdump (~> 0.2.5)
54
- strptime (>= 0.2.4, < 1.0.0)
55
- tzinfo (>= 1.0, < 3.0)
56
- tzinfo-data (~> 1.0)
57
- uri (~> 1.0, < 1.1.0)
58
- webrick (~> 1.4)
59
- yajl-ruby (~> 1.0)
60
- zstd-ruby (~> 1.5)
61
- http_parser.rb (0.8.1)
62
- io-endpoint (0.17.2)
63
- io-event (1.14.2)
64
- io-stream (0.11.1)
65
- json (2.18.0)
66
- logger (1.7.0)
67
- metrics (0.15.0)
68
- msgpack (1.8.0)
69
- power_assert (3.0.1)
70
- protocol-hpack (1.5.1)
71
- protocol-http (0.58.1)
72
- protocol-http1 (0.37.0)
73
- protocol-http (~> 0.58)
74
- protocol-http2 (0.24.0)
75
- protocol-hpack (~> 1.4)
76
- protocol-http (~> 0.47)
77
- protocol-url (0.4.0)
78
- rake (13.0.6)
79
- serverengine (2.4.0)
80
- base64 (~> 0.1)
81
- logger (~> 1.4)
82
- sigdump (~> 0.2.2)
83
- sigdump (0.2.5)
84
- strptime (0.2.5)
85
- test-unit (3.5.9)
86
- power_assert
87
- traces (0.18.2)
88
- tzinfo (2.0.6)
89
- concurrent-ruby (~> 1.0)
90
- tzinfo-data (1.2025.3)
91
- tzinfo (>= 1.0.0)
92
- uri (1.0.4)
93
- webrick (1.9.2)
94
- yajl-ruby (1.4.3)
95
- zstd-ruby (1.5.7.1)
96
-
97
- PLATFORMS
98
- aarch64-linux
99
-
100
- DEPENDENCIES
101
- bundler (~> 2.4.22)
102
- fluentd-json-size-limit!
103
- rake (~> 13.0.6)
104
- test-unit (~> 3.5.7)
105
-
106
- BUNDLED WITH
107
- 2.4.22
data/Rakefile DELETED
@@ -1,13 +0,0 @@
1
- require "bundler"
2
- Bundler::GemHelper.install_tasks
3
-
4
- require "rake/testtask"
5
-
6
- Rake::TestTask.new(:test) do |t|
7
- t.libs.push("lib", "test")
8
- t.test_files = FileList["test/**/test_*.rb"]
9
- t.verbose = true
10
- t.warning = true
11
- end
12
-
13
- task default: [:test]
data/test/helper.rb DELETED
@@ -1,7 +0,0 @@
1
- require "test-unit"
2
- require "fluent/test"
3
- require "fluent/test/driver/input"
4
- require "fluent/test/helpers"
5
-
6
- Test::Unit::TestCase.include(Fluent::Test::Helpers)
7
- Test::Unit::TestCase.extend(Fluent::Test::Helpers)
@@ -1,43 +0,0 @@
1
- require 'fluent/test'
2
- require 'fluent/test/helpers'
3
- require 'fluent/test/driver/filter'
4
- require "helper"
5
- require "fluent/plugin/filter_jsonsizelimit.rb"
6
- require 'test/unit'
7
-
8
- class JsonSizeLimitFilterTest < Test::Unit::TestCase
9
- include Fluent::Test::Helpers
10
-
11
- def setup
12
- Fluent::Test.setup
13
- @tag = 'test'
14
- @driver = Fluent::Test::Driver::Filter.new(Fluent::Plugin::JsonSizeLimitFilter).configure(config)
15
- end
16
-
17
- def config
18
- %(
19
- max_size 262000
20
- max_attempts 10
21
- )
22
- end
23
-
24
- test 'reduce large json size to within limits' do
25
- record = { 'large_field' => 'a' * 300000 }
26
- @driver.run do
27
- @driver.feed(@tag, Fluent::EventTime.now, record)
28
- end
29
- filtered_records = @driver.filtered_records
30
-
31
- assert_true filtered_records[0].to_json.bytesize <= 262000
32
- end
33
-
34
- test 'retain smaller json size' do
35
- record = { 'small_field' => 'Hello, world!' }
36
- @driver.run do
37
- @driver.feed(@tag, Fluent::EventTime.now, record)
38
- end
39
- filtered_records = @driver.filtered_records
40
-
41
- assert_equal record.to_json.bytesize, filtered_records[0].to_json.bytesize
42
- end
43
- end
data/trivy.yaml DELETED
@@ -1,8 +0,0 @@
1
- # https://aquasecurity.github.io/trivy/v0.49/docs/references/configuration/config-file/
2
-
3
- severity:
4
- - MEDIUM
5
- - HIGH
6
- - CRITICAL
7
- ignorefile: .trivyignore.yaml
8
- timeout: 60m