lhc 12.3.0 → 13.4.0.pre.pro1766.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/rubocop.yml +15 -0
- data/.github/workflows/test.yml +15 -0
- data/.rubocop.yml +344 -19
- data/.ruby-version +1 -1
- data/Gemfile.activesupport5 +1 -1
- data/Gemfile.activesupport6 +1 -1
- data/README.md +102 -2
- data/Rakefile +3 -3
- data/lhc.gemspec +6 -3
- data/lib/lhc.rb +70 -59
- data/lib/lhc/concerns/lhc/fix_invalid_encoding_concern.rb +1 -0
- data/lib/lhc/config.rb +16 -0
- data/lib/lhc/endpoint.rb +3 -0
- data/lib/lhc/error.rb +7 -3
- data/lib/lhc/interceptor.rb +4 -0
- data/lib/lhc/interceptors.rb +1 -0
- data/lib/lhc/interceptors/auth.rb +10 -5
- data/lib/lhc/interceptors/caching.rb +70 -44
- data/lib/lhc/interceptors/logging.rb +4 -2
- data/lib/lhc/interceptors/monitoring.rb +46 -11
- data/lib/lhc/interceptors/retry.rb +2 -0
- data/lib/lhc/interceptors/rollbar.rb +3 -2
- data/lib/lhc/interceptors/throttle.rb +7 -2
- data/lib/lhc/interceptors/zipkin.rb +2 -0
- data/lib/lhc/railtie.rb +0 -1
- data/lib/lhc/request.rb +37 -4
- data/lib/lhc/response.rb +1 -0
- data/lib/lhc/response/data.rb +1 -1
- data/lib/lhc/rspec.rb +1 -2
- data/lib/lhc/scrubber.rb +45 -0
- data/lib/lhc/scrubbers/auth_scrubber.rb +32 -0
- data/lib/lhc/scrubbers/body_scrubber.rb +30 -0
- data/lib/lhc/scrubbers/headers_scrubber.rb +40 -0
- data/lib/lhc/scrubbers/params_scrubber.rb +14 -0
- data/lib/lhc/version.rb +1 -1
- data/spec/config/scrubs_spec.rb +108 -0
- data/spec/error/to_s_spec.rb +13 -8
- data/spec/formats/multipart_spec.rb +2 -2
- data/spec/formats/plain_spec.rb +1 -1
- data/spec/interceptors/after_response_spec.rb +1 -1
- data/spec/interceptors/caching/main_spec.rb +2 -2
- data/spec/interceptors/caching/multilevel_cache_spec.rb +139 -0
- data/spec/interceptors/caching/options_spec.rb +0 -11
- data/spec/interceptors/define_spec.rb +1 -0
- data/spec/interceptors/logging/main_spec.rb +21 -1
- data/spec/interceptors/monitoring/caching_spec.rb +66 -0
- data/spec/interceptors/response_competition_spec.rb +2 -2
- data/spec/interceptors/return_response_spec.rb +2 -2
- data/spec/interceptors/rollbar/main_spec.rb +27 -15
- data/spec/request/scrubbed_headers_spec.rb +101 -0
- data/spec/request/scrubbed_options_spec.rb +185 -0
- data/spec/request/scrubbed_params_spec.rb +25 -0
- data/spec/response/data_spec.rb +2 -2
- data/spec/spec_helper.rb +1 -0
- data/spec/support/zipkin_mock.rb +1 -0
- metadata +59 -26
- data/.rubocop.localch.yml +0 -325
- data/Gemfile.activesupport4 +0 -4
- data/cider-ci.yml +0 -6
- data/cider-ci/bin/bundle +0 -51
- data/cider-ci/bin/ruby_install +0 -8
- data/cider-ci/bin/ruby_version +0 -25
- data/cider-ci/jobs/rspec-activesupport-4.yml +0 -28
- data/cider-ci/jobs/rspec-activesupport-5.yml +0 -27
- data/cider-ci/jobs/rspec-activesupport-6.yml +0 -28
- data/cider-ci/jobs/rubocop.yml +0 -18
- data/cider-ci/task_components/bundle.yml +0 -22
- data/cider-ci/task_components/rspec.yml +0 -36
- data/cider-ci/task_components/rubocop.yml +0 -29
- data/cider-ci/task_components/ruby.yml +0 -15
@@ -0,0 +1,101 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'rails_helper'
|
4
|
+
|
5
|
+
describe LHC::Request do
|
6
|
+
let(:headers) { { private_key: 'xyz-123' } }
|
7
|
+
let(:response) { LHC.get(:local, headers: headers) }
|
8
|
+
let(:auth) { {} }
|
9
|
+
|
10
|
+
before :each do
|
11
|
+
LHC.config.endpoint(:local, 'http://local.ch', auth: auth)
|
12
|
+
stub_request(:get, 'http://local.ch').with(headers: headers)
|
13
|
+
end
|
14
|
+
|
15
|
+
it 'scrubs "private_key"' do
|
16
|
+
LHC.config.scrubs[:headers] << 'private_key'
|
17
|
+
expect(response.request.scrubbed_headers).to include(private_key: LHC::Scrubber::SCRUB_DISPLAY)
|
18
|
+
end
|
19
|
+
|
20
|
+
it 'does not add a new attribute when a non existing header should be scrubbed' do
|
21
|
+
LHC.config.scrubs[:headers] << 'anything'
|
22
|
+
expect(response.request.scrubbed_headers).not_to include('anything' => LHC::Scrubber::SCRUB_DISPLAY)
|
23
|
+
end
|
24
|
+
|
25
|
+
context 'when strings instead of symbols are provided' do
|
26
|
+
let(:headers) { { 'private_key' => 'xyz-123' } }
|
27
|
+
|
28
|
+
it 'scrubs "private_key"' do
|
29
|
+
LHC.config.scrubs[:headers] << 'private_key'
|
30
|
+
expect(response.request.scrubbed_headers).to include('private_key' => LHC::Scrubber::SCRUB_DISPLAY)
|
31
|
+
end
|
32
|
+
end
|
33
|
+
|
34
|
+
context 'other authentication strategy' do
|
35
|
+
let(:api_key) { '123456' }
|
36
|
+
let(:authorization_header) { { 'Authorization' => "Apikey #{api_key}" } }
|
37
|
+
let(:headers) { authorization_header }
|
38
|
+
|
39
|
+
it 'provides srubbed Authorization header' do
|
40
|
+
LHC.config.scrubs[:headers] << 'Authorization'
|
41
|
+
expect(response.request.scrubbed_headers).to include('Authorization' => LHC::Scrubber::SCRUB_DISPLAY)
|
42
|
+
expect(response.request.headers).to include(authorization_header)
|
43
|
+
end
|
44
|
+
end
|
45
|
+
|
46
|
+
describe 'auth' do
|
47
|
+
before :each do
|
48
|
+
LHC.config.interceptors = [LHC::Auth]
|
49
|
+
stub_request(:get, 'http://local.ch').with(headers: authorization_header)
|
50
|
+
end
|
51
|
+
|
52
|
+
let(:request) do
|
53
|
+
response = LHC.get(:local)
|
54
|
+
response.request
|
55
|
+
end
|
56
|
+
|
57
|
+
context 'bearer authentication' do
|
58
|
+
let(:bearer_token) { '123456' }
|
59
|
+
let(:authorization_header) { { 'Authorization' => "Bearer #{bearer_token}" } }
|
60
|
+
let(:auth) { { bearer: -> { bearer_token } } }
|
61
|
+
|
62
|
+
it 'provides srubbed request headers' do
|
63
|
+
expect(request.scrubbed_headers).to include('Authorization' => "Bearer #{LHC::Scrubber::SCRUB_DISPLAY}")
|
64
|
+
expect(request.headers).to include(authorization_header)
|
65
|
+
end
|
66
|
+
|
67
|
+
context 'when nothing should get scrubbed' do
|
68
|
+
before :each do
|
69
|
+
LHC.config.scrubs = {}
|
70
|
+
end
|
71
|
+
|
72
|
+
it 'does not filter beaerer auth' do
|
73
|
+
expect(request.scrubbed_headers).to include(authorization_header)
|
74
|
+
end
|
75
|
+
end
|
76
|
+
end
|
77
|
+
|
78
|
+
context 'basic authentication' do
|
79
|
+
let(:username) { 'steve' }
|
80
|
+
let(:password) { 'abcdefg' }
|
81
|
+
let(:credentials_base_64_codiert) { Base64.strict_encode64("#{username}:#{password}").chomp }
|
82
|
+
let(:authorization_header) { { 'Authorization' => "Basic #{credentials_base_64_codiert}" } }
|
83
|
+
let(:auth) { { basic: { username: username, password: password } } }
|
84
|
+
|
85
|
+
it 'provides srubbed request headers' do
|
86
|
+
expect(request.scrubbed_headers).to include('Authorization' => "Basic #{LHC::Scrubber::SCRUB_DISPLAY}")
|
87
|
+
expect(request.headers).to include(authorization_header)
|
88
|
+
end
|
89
|
+
|
90
|
+
context 'when nothing should get scrubbed' do
|
91
|
+
before :each do
|
92
|
+
LHC.config.scrubs = {}
|
93
|
+
end
|
94
|
+
|
95
|
+
it 'does not filter basic auth' do
|
96
|
+
expect(request.scrubbed_headers).to include(authorization_header)
|
97
|
+
end
|
98
|
+
end
|
99
|
+
end
|
100
|
+
end
|
101
|
+
end
|
@@ -0,0 +1,185 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'rails_helper'
|
4
|
+
|
5
|
+
describe LHC::Request do
|
6
|
+
before :each do
|
7
|
+
LHC.config.interceptors = [LHC::Auth]
|
8
|
+
LHC.config.endpoint(:local, 'http://local.ch', auth: auth)
|
9
|
+
LHC.config.scrubs[:params] << 'api_key'
|
10
|
+
LHC.config.scrubs[:headers] << 'private_key'
|
11
|
+
LHC.config.scrubs[:body] << 'user_token'
|
12
|
+
stub_request(:post, "http://local.ch?#{params.to_query}").with(headers: authorization_header.merge(headers), body: body.to_json)
|
13
|
+
end
|
14
|
+
|
15
|
+
let(:bearer_token) { '123456' }
|
16
|
+
let(:authorization_header) { { 'Authorization' => "Bearer #{bearer_token}" } }
|
17
|
+
let(:auth) { { bearer: -> { bearer_token } } }
|
18
|
+
let(:params) { { api_key: 'api-key-params' } }
|
19
|
+
let(:headers) { { private_key: 'private-key-header' } }
|
20
|
+
let(:body) { { user_token: 'user-token-body' } }
|
21
|
+
|
22
|
+
let(:request) do
|
23
|
+
response = LHC.post(:local, params: params, headers: headers, body: body)
|
24
|
+
response.request
|
25
|
+
end
|
26
|
+
|
27
|
+
it 'provides srubbed request options' do
|
28
|
+
expect(request.scrubbed_options[:params]).to include(api_key: LHC::Scrubber::SCRUB_DISPLAY)
|
29
|
+
expect(request.scrubbed_options[:headers]).to include(private_key: LHC::Scrubber::SCRUB_DISPLAY)
|
30
|
+
expect(request.scrubbed_options[:body]).to include(user_token: LHC::Scrubber::SCRUB_DISPLAY)
|
31
|
+
expect(request.scrubbed_options[:auth][:bearer_token]).to eq(LHC::Scrubber::SCRUB_DISPLAY)
|
32
|
+
expect(request.scrubbed_options[:auth][:basic]).to be nil
|
33
|
+
end
|
34
|
+
|
35
|
+
context 'when options do not have auth' do
|
36
|
+
let(:authorization_header) { {} }
|
37
|
+
let(:auth) { nil }
|
38
|
+
|
39
|
+
it 'provides srubbed request options' do
|
40
|
+
expect(request.scrubbed_options[:params]).to include(api_key: LHC::Scrubber::SCRUB_DISPLAY)
|
41
|
+
expect(request.scrubbed_options[:headers]).to include(private_key: LHC::Scrubber::SCRUB_DISPLAY)
|
42
|
+
expect(request.scrubbed_options[:body]).to include(user_token: LHC::Scrubber::SCRUB_DISPLAY)
|
43
|
+
expect(request.scrubbed_options[:auth]).to be nil
|
44
|
+
end
|
45
|
+
end
|
46
|
+
|
47
|
+
context 'when body data is nested' do
|
48
|
+
let(:body) do
|
49
|
+
{
|
50
|
+
data: {
|
51
|
+
attributes: {
|
52
|
+
employee: {
|
53
|
+
name: 'Muster',
|
54
|
+
surname: 'Hans',
|
55
|
+
password: 'test-1234',
|
56
|
+
password_confirmation: 'test-1234'
|
57
|
+
}
|
58
|
+
}
|
59
|
+
}
|
60
|
+
}
|
61
|
+
end
|
62
|
+
|
63
|
+
it 'srubbes nested attributes' do
|
64
|
+
expect(request.scrubbed_options[:params]).to include(api_key: LHC::Scrubber::SCRUB_DISPLAY)
|
65
|
+
expect(request.scrubbed_options[:headers]).to include(private_key: LHC::Scrubber::SCRUB_DISPLAY)
|
66
|
+
expect(request.scrubbed_options[:body][:data][:attributes][:employee]).to include(password: LHC::Scrubber::SCRUB_DISPLAY)
|
67
|
+
expect(request.scrubbed_options[:body][:data][:attributes][:employee]).to include(password_confirmation: LHC::Scrubber::SCRUB_DISPLAY)
|
68
|
+
expect(request.scrubbed_options[:auth][:bearer_token]).to eq(LHC::Scrubber::SCRUB_DISPLAY)
|
69
|
+
expect(request.scrubbed_options[:auth][:basic]).to be nil
|
70
|
+
end
|
71
|
+
end
|
72
|
+
|
73
|
+
context 'basic authentication' do
|
74
|
+
let(:username) { 'steve' }
|
75
|
+
let(:password) { 'abcdefg' }
|
76
|
+
let(:credentials_base_64_codiert) { Base64.strict_encode64("#{username}:#{password}").chomp }
|
77
|
+
let(:authorization_header) { { 'Authorization' => "Basic #{credentials_base_64_codiert}" } }
|
78
|
+
let(:auth) { { basic: { username: username, password: password } } }
|
79
|
+
|
80
|
+
it 'provides srubbed request headers' do
|
81
|
+
expect(request.scrubbed_options[:auth][:basic][:username]).to eq(LHC::Scrubber::SCRUB_DISPLAY)
|
82
|
+
expect(request.scrubbed_options[:auth][:basic][:password]).to eq(LHC::Scrubber::SCRUB_DISPLAY)
|
83
|
+
expect(request.scrubbed_options[:auth][:basic][:base_64_encoded_credentials]).to eq(LHC::Scrubber::SCRUB_DISPLAY)
|
84
|
+
expect(request.scrubbed_options[:auth][:bearer]).to be nil
|
85
|
+
end
|
86
|
+
end
|
87
|
+
|
88
|
+
context 'when nothing should get scrubbed' do
|
89
|
+
before :each do
|
90
|
+
LHC.config.scrubs = {}
|
91
|
+
end
|
92
|
+
|
93
|
+
it 'does not filter anything' do
|
94
|
+
expect(request.scrubbed_options[:params]).not_to include(api_key: LHC::Scrubber::SCRUB_DISPLAY)
|
95
|
+
expect(request.scrubbed_options[:headers]).not_to include(private_key: LHC::Scrubber::SCRUB_DISPLAY)
|
96
|
+
expect(request.scrubbed_options[:body]).not_to include(user_token: LHC::Scrubber::SCRUB_DISPLAY)
|
97
|
+
expect(request.scrubbed_options[:auth][:bearer_token]).not_to eq(LHC::Scrubber::SCRUB_DISPLAY)
|
98
|
+
end
|
99
|
+
end
|
100
|
+
|
101
|
+
context 'custom data structures that respond to as_json (like LHS data or record)' do
|
102
|
+
before do
|
103
|
+
class CustomStructure
|
104
|
+
|
105
|
+
def initialize(data)
|
106
|
+
@data = data
|
107
|
+
end
|
108
|
+
|
109
|
+
def as_json
|
110
|
+
@data.as_json
|
111
|
+
end
|
112
|
+
|
113
|
+
def to_json
|
114
|
+
as_json.to_json
|
115
|
+
end
|
116
|
+
end
|
117
|
+
|
118
|
+
stub_request(:post, 'http://local.ch').with(body: custom_structure.to_json)
|
119
|
+
end
|
120
|
+
|
121
|
+
let(:custom_structure) do
|
122
|
+
CustomStructure.new(user_token: '12345')
|
123
|
+
end
|
124
|
+
|
125
|
+
let(:request) do
|
126
|
+
response = LHC.post(:local, body: custom_structure)
|
127
|
+
response.request
|
128
|
+
end
|
129
|
+
|
130
|
+
it 'provides srubbed request options' do
|
131
|
+
expect(request.scrubbed_options[:body]).to include('user_token' => LHC::Scrubber::SCRUB_DISPLAY)
|
132
|
+
end
|
133
|
+
end
|
134
|
+
|
135
|
+
context 'encoded data hash' do
|
136
|
+
let(:body) { { user_token: 'user-token-body' } }
|
137
|
+
|
138
|
+
let(:request) do
|
139
|
+
response = LHC.post(:local, body: body.to_json)
|
140
|
+
response.request
|
141
|
+
end
|
142
|
+
|
143
|
+
before :each do
|
144
|
+
stub_request(:post, 'http://local.ch').with(body: body.to_json)
|
145
|
+
end
|
146
|
+
|
147
|
+
it 'provides srubbed request options' do
|
148
|
+
expect(request.scrubbed_options[:body]).to include('user_token' => LHC::Scrubber::SCRUB_DISPLAY)
|
149
|
+
end
|
150
|
+
end
|
151
|
+
|
152
|
+
context 'array' do
|
153
|
+
let(:body) { [{ user_token: 'user-token-body' }] }
|
154
|
+
|
155
|
+
let(:request) do
|
156
|
+
response = LHC.post(:local, body: body)
|
157
|
+
response.request
|
158
|
+
end
|
159
|
+
|
160
|
+
before :each do
|
161
|
+
stub_request(:post, 'http://local.ch').with(body: body.to_json)
|
162
|
+
end
|
163
|
+
|
164
|
+
it 'provides srubbed request options' do
|
165
|
+
expect(request.scrubbed_options[:body]).to eq([user_token: LHC::Scrubber::SCRUB_DISPLAY])
|
166
|
+
end
|
167
|
+
end
|
168
|
+
|
169
|
+
context 'encoded array' do
|
170
|
+
let(:body) { [{ user_token: 'user-token-body' }] }
|
171
|
+
|
172
|
+
let(:request) do
|
173
|
+
response = LHC.post(:local, body: body.to_json)
|
174
|
+
response.request
|
175
|
+
end
|
176
|
+
|
177
|
+
before :each do
|
178
|
+
stub_request(:post, 'http://local.ch').with(body: body.to_json)
|
179
|
+
end
|
180
|
+
|
181
|
+
it 'provides srubbed request options' do
|
182
|
+
expect(request.scrubbed_options[:body]).to eq(['user_token' => LHC::Scrubber::SCRUB_DISPLAY])
|
183
|
+
end
|
184
|
+
end
|
185
|
+
end
|
@@ -0,0 +1,25 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'rails_helper'
|
4
|
+
|
5
|
+
describe LHC::Request do
|
6
|
+
let(:params) { { api_key: 'xyz-123', secret_key: '123-xyz' } }
|
7
|
+
let(:response) { LHC.get(:local, params: params) }
|
8
|
+
|
9
|
+
before :each do
|
10
|
+
LHC.config.endpoint(:local, 'http://local.ch')
|
11
|
+
stub_request(:get, "http://local.ch?#{params.to_query}")
|
12
|
+
end
|
13
|
+
|
14
|
+
it 'scrubs "api_key"' do
|
15
|
+
LHC.config.scrubs[:params] << 'api_key'
|
16
|
+
expect(response.request.scrubbed_params).to include(api_key: LHC::Scrubber::SCRUB_DISPLAY)
|
17
|
+
expect(response.request.scrubbed_params).to include(secret_key: '123-xyz')
|
18
|
+
end
|
19
|
+
|
20
|
+
it 'scrubs "api_key" and "secret_key"' do
|
21
|
+
LHC.config.scrubs[:params].push('api_key', 'secret_key')
|
22
|
+
expect(response.request.scrubbed_params).to include(api_key: LHC::Scrubber::SCRUB_DISPLAY)
|
23
|
+
expect(response.request.scrubbed_params).to include(secret_key: LHC::Scrubber::SCRUB_DISPLAY)
|
24
|
+
end
|
25
|
+
end
|
data/spec/response/data_spec.rb
CHANGED
@@ -75,9 +75,9 @@ describe LHC::Response do
|
|
75
75
|
it 'does not throw a stack level to deep issue when accessing data in a rescue context' do
|
76
76
|
begin
|
77
77
|
LHC.get('http://listings')
|
78
|
-
rescue LHC::Error =>
|
78
|
+
rescue LHC::Error => e
|
79
79
|
expect(
|
80
|
-
|
80
|
+
e.response.request.response.data.meta.errors.detect { |item| item.code == 2000 }.msg
|
81
81
|
).to eq 'I like to hide error messages (this is meta).'
|
82
82
|
end
|
83
83
|
end
|
data/spec/spec_helper.rb
CHANGED
data/spec/support/zipkin_mock.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: lhc
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 13.4.0.pre.pro1766.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- https://github.com/local-ch/lhc/contributors
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2021-05-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|
@@ -16,14 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - ">="
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: '
|
19
|
+
version: '5.2'
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - ">="
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: '
|
26
|
+
version: '5.2'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: addressable
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -100,14 +100,28 @@ dependencies:
|
|
100
100
|
requirements:
|
101
101
|
- - ">="
|
102
102
|
- !ruby/object:Gem::Version
|
103
|
-
version: '
|
103
|
+
version: '5.2'
|
104
104
|
type: :development
|
105
105
|
prerelease: false
|
106
106
|
version_requirements: !ruby/object:Gem::Requirement
|
107
107
|
requirements:
|
108
108
|
- - ">="
|
109
109
|
- !ruby/object:Gem::Version
|
110
|
-
version: '
|
110
|
+
version: '5.2'
|
111
|
+
- !ruby/object:Gem::Dependency
|
112
|
+
name: redis
|
113
|
+
requirement: !ruby/object:Gem::Requirement
|
114
|
+
requirements:
|
115
|
+
- - ">="
|
116
|
+
- !ruby/object:Gem::Version
|
117
|
+
version: '0'
|
118
|
+
type: :development
|
119
|
+
prerelease: false
|
120
|
+
version_requirements: !ruby/object:Gem::Requirement
|
121
|
+
requirements:
|
122
|
+
- - ">="
|
123
|
+
- !ruby/object:Gem::Version
|
124
|
+
version: '0'
|
111
125
|
- !ruby/object:Gem::Dependency
|
112
126
|
name: rspec-rails
|
113
127
|
requirement: !ruby/object:Gem::Requirement
|
@@ -128,14 +142,28 @@ dependencies:
|
|
128
142
|
requirements:
|
129
143
|
- - "~>"
|
130
144
|
- !ruby/object:Gem::Version
|
131
|
-
version: 0
|
145
|
+
version: '1.0'
|
132
146
|
type: :development
|
133
147
|
prerelease: false
|
134
148
|
version_requirements: !ruby/object:Gem::Requirement
|
135
149
|
requirements:
|
136
150
|
- - "~>"
|
137
151
|
- !ruby/object:Gem::Version
|
138
|
-
version: 0
|
152
|
+
version: '1.0'
|
153
|
+
- !ruby/object:Gem::Dependency
|
154
|
+
name: rubocop-performance
|
155
|
+
requirement: !ruby/object:Gem::Requirement
|
156
|
+
requirements:
|
157
|
+
- - "~>"
|
158
|
+
- !ruby/object:Gem::Version
|
159
|
+
version: '1.0'
|
160
|
+
type: :development
|
161
|
+
prerelease: false
|
162
|
+
version_requirements: !ruby/object:Gem::Requirement
|
163
|
+
requirements:
|
164
|
+
- - "~>"
|
165
|
+
- !ruby/object:Gem::Version
|
166
|
+
version: '1.0'
|
139
167
|
- !ruby/object:Gem::Dependency
|
140
168
|
name: rubocop-rspec
|
141
169
|
requirement: !ruby/object:Gem::Requirement
|
@@ -188,29 +216,17 @@ executables: []
|
|
188
216
|
extensions: []
|
189
217
|
extra_rdoc_files: []
|
190
218
|
files:
|
219
|
+
- ".github/workflows/rubocop.yml"
|
220
|
+
- ".github/workflows/test.yml"
|
191
221
|
- ".gitignore"
|
192
|
-
- ".rubocop.localch.yml"
|
193
222
|
- ".rubocop.yml"
|
194
223
|
- ".ruby-version"
|
195
224
|
- Gemfile
|
196
|
-
- Gemfile.activesupport4
|
197
225
|
- Gemfile.activesupport5
|
198
226
|
- Gemfile.activesupport6
|
199
227
|
- LICENSE
|
200
228
|
- README.md
|
201
229
|
- Rakefile
|
202
|
-
- cider-ci.yml
|
203
|
-
- cider-ci/bin/bundle
|
204
|
-
- cider-ci/bin/ruby_install
|
205
|
-
- cider-ci/bin/ruby_version
|
206
|
-
- cider-ci/jobs/rspec-activesupport-4.yml
|
207
|
-
- cider-ci/jobs/rspec-activesupport-5.yml
|
208
|
-
- cider-ci/jobs/rspec-activesupport-6.yml
|
209
|
-
- cider-ci/jobs/rubocop.yml
|
210
|
-
- cider-ci/task_components/bundle.yml
|
211
|
-
- cider-ci/task_components/rspec.yml
|
212
|
-
- cider-ci/task_components/rubocop.yml
|
213
|
-
- cider-ci/task_components/ruby.yml
|
214
230
|
- friday.yml
|
215
231
|
- lhc.gemspec
|
216
232
|
- lib/core_ext/hash/deep_transform_values.rb
|
@@ -254,6 +270,11 @@ files:
|
|
254
270
|
- lib/lhc/response/data/collection.rb
|
255
271
|
- lib/lhc/response/data/item.rb
|
256
272
|
- lib/lhc/rspec.rb
|
273
|
+
- lib/lhc/scrubber.rb
|
274
|
+
- lib/lhc/scrubbers/auth_scrubber.rb
|
275
|
+
- lib/lhc/scrubbers/body_scrubber.rb
|
276
|
+
- lib/lhc/scrubbers/headers_scrubber.rb
|
277
|
+
- lib/lhc/scrubbers/params_scrubber.rb
|
257
278
|
- lib/lhc/test/cache_helper.rb
|
258
279
|
- lib/lhc/version.rb
|
259
280
|
- script/ci/build.sh
|
@@ -265,6 +286,7 @@ files:
|
|
265
286
|
- spec/basic_methods/request_without_rails_spec.rb
|
266
287
|
- spec/config/endpoints_spec.rb
|
267
288
|
- spec/config/placeholders_spec.rb
|
289
|
+
- spec/config/scrubs_spec.rb
|
268
290
|
- spec/core_ext/hash/deep_transform_values_spec.rb
|
269
291
|
- spec/dummy/README.rdoc
|
270
292
|
- spec/dummy/Rakefile
|
@@ -335,6 +357,7 @@ files:
|
|
335
357
|
- spec/interceptors/caching/hydra_spec.rb
|
336
358
|
- spec/interceptors/caching/main_spec.rb
|
337
359
|
- spec/interceptors/caching/methods_spec.rb
|
360
|
+
- spec/interceptors/caching/multilevel_cache_spec.rb
|
338
361
|
- spec/interceptors/caching/options_spec.rb
|
339
362
|
- spec/interceptors/caching/parameters_spec.rb
|
340
363
|
- spec/interceptors/caching/response_status_spec.rb
|
@@ -344,6 +367,7 @@ files:
|
|
344
367
|
- spec/interceptors/define_spec.rb
|
345
368
|
- spec/interceptors/dup_spec.rb
|
346
369
|
- spec/interceptors/logging/main_spec.rb
|
370
|
+
- spec/interceptors/monitoring/caching_spec.rb
|
347
371
|
- spec/interceptors/monitoring/main_spec.rb
|
348
372
|
- spec/interceptors/prometheus_spec.rb
|
349
373
|
- spec/interceptors/response_competition_spec.rb
|
@@ -364,6 +388,9 @@ files:
|
|
364
388
|
- spec/request/parallel_requests_spec.rb
|
365
389
|
- spec/request/params_encoding_spec.rb
|
366
390
|
- spec/request/request_without_rails_spec.rb
|
391
|
+
- spec/request/scrubbed_headers_spec.rb
|
392
|
+
- spec/request/scrubbed_options_spec.rb
|
393
|
+
- spec/request/scrubbed_params_spec.rb
|
367
394
|
- spec/request/url_patterns_spec.rb
|
368
395
|
- spec/request/user_agent_spec.rb
|
369
396
|
- spec/request/user_agent_without_rails_spec.rb
|
@@ -397,15 +424,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
397
424
|
requirements:
|
398
425
|
- - ">="
|
399
426
|
- !ruby/object:Gem::Version
|
400
|
-
version: '
|
427
|
+
version: '2.7'
|
401
428
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
402
429
|
requirements:
|
403
|
-
- - "
|
430
|
+
- - ">"
|
404
431
|
- !ruby/object:Gem::Version
|
405
|
-
version:
|
432
|
+
version: 1.3.1
|
406
433
|
requirements:
|
407
434
|
- Ruby >= 2.0.0
|
408
|
-
rubygems_version: 3.
|
435
|
+
rubygems_version: 3.1.4
|
409
436
|
signing_key:
|
410
437
|
specification_version: 4
|
411
438
|
summary: Advanced HTTP Client for Ruby, fueled with interceptors
|
@@ -418,6 +445,7 @@ test_files:
|
|
418
445
|
- spec/basic_methods/request_without_rails_spec.rb
|
419
446
|
- spec/config/endpoints_spec.rb
|
420
447
|
- spec/config/placeholders_spec.rb
|
448
|
+
- spec/config/scrubs_spec.rb
|
421
449
|
- spec/core_ext/hash/deep_transform_values_spec.rb
|
422
450
|
- spec/dummy/README.rdoc
|
423
451
|
- spec/dummy/Rakefile
|
@@ -488,6 +516,7 @@ test_files:
|
|
488
516
|
- spec/interceptors/caching/hydra_spec.rb
|
489
517
|
- spec/interceptors/caching/main_spec.rb
|
490
518
|
- spec/interceptors/caching/methods_spec.rb
|
519
|
+
- spec/interceptors/caching/multilevel_cache_spec.rb
|
491
520
|
- spec/interceptors/caching/options_spec.rb
|
492
521
|
- spec/interceptors/caching/parameters_spec.rb
|
493
522
|
- spec/interceptors/caching/response_status_spec.rb
|
@@ -497,6 +526,7 @@ test_files:
|
|
497
526
|
- spec/interceptors/define_spec.rb
|
498
527
|
- spec/interceptors/dup_spec.rb
|
499
528
|
- spec/interceptors/logging/main_spec.rb
|
529
|
+
- spec/interceptors/monitoring/caching_spec.rb
|
500
530
|
- spec/interceptors/monitoring/main_spec.rb
|
501
531
|
- spec/interceptors/prometheus_spec.rb
|
502
532
|
- spec/interceptors/response_competition_spec.rb
|
@@ -517,6 +547,9 @@ test_files:
|
|
517
547
|
- spec/request/parallel_requests_spec.rb
|
518
548
|
- spec/request/params_encoding_spec.rb
|
519
549
|
- spec/request/request_without_rails_spec.rb
|
550
|
+
- spec/request/scrubbed_headers_spec.rb
|
551
|
+
- spec/request/scrubbed_options_spec.rb
|
552
|
+
- spec/request/scrubbed_params_spec.rb
|
520
553
|
- spec/request/url_patterns_spec.rb
|
521
554
|
- spec/request/user_agent_spec.rb
|
522
555
|
- spec/request/user_agent_without_rails_spec.rb
|