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.
Files changed (71) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/rubocop.yml +15 -0
  3. data/.github/workflows/test.yml +15 -0
  4. data/.rubocop.yml +344 -19
  5. data/.ruby-version +1 -1
  6. data/Gemfile.activesupport5 +1 -1
  7. data/Gemfile.activesupport6 +1 -1
  8. data/README.md +102 -2
  9. data/Rakefile +3 -3
  10. data/lhc.gemspec +6 -3
  11. data/lib/lhc.rb +70 -59
  12. data/lib/lhc/concerns/lhc/fix_invalid_encoding_concern.rb +1 -0
  13. data/lib/lhc/config.rb +16 -0
  14. data/lib/lhc/endpoint.rb +3 -0
  15. data/lib/lhc/error.rb +7 -3
  16. data/lib/lhc/interceptor.rb +4 -0
  17. data/lib/lhc/interceptors.rb +1 -0
  18. data/lib/lhc/interceptors/auth.rb +10 -5
  19. data/lib/lhc/interceptors/caching.rb +70 -44
  20. data/lib/lhc/interceptors/logging.rb +4 -2
  21. data/lib/lhc/interceptors/monitoring.rb +46 -11
  22. data/lib/lhc/interceptors/retry.rb +2 -0
  23. data/lib/lhc/interceptors/rollbar.rb +3 -2
  24. data/lib/lhc/interceptors/throttle.rb +7 -2
  25. data/lib/lhc/interceptors/zipkin.rb +2 -0
  26. data/lib/lhc/railtie.rb +0 -1
  27. data/lib/lhc/request.rb +37 -4
  28. data/lib/lhc/response.rb +1 -0
  29. data/lib/lhc/response/data.rb +1 -1
  30. data/lib/lhc/rspec.rb +1 -2
  31. data/lib/lhc/scrubber.rb +45 -0
  32. data/lib/lhc/scrubbers/auth_scrubber.rb +32 -0
  33. data/lib/lhc/scrubbers/body_scrubber.rb +30 -0
  34. data/lib/lhc/scrubbers/headers_scrubber.rb +40 -0
  35. data/lib/lhc/scrubbers/params_scrubber.rb +14 -0
  36. data/lib/lhc/version.rb +1 -1
  37. data/spec/config/scrubs_spec.rb +108 -0
  38. data/spec/error/to_s_spec.rb +13 -8
  39. data/spec/formats/multipart_spec.rb +2 -2
  40. data/spec/formats/plain_spec.rb +1 -1
  41. data/spec/interceptors/after_response_spec.rb +1 -1
  42. data/spec/interceptors/caching/main_spec.rb +2 -2
  43. data/spec/interceptors/caching/multilevel_cache_spec.rb +139 -0
  44. data/spec/interceptors/caching/options_spec.rb +0 -11
  45. data/spec/interceptors/define_spec.rb +1 -0
  46. data/spec/interceptors/logging/main_spec.rb +21 -1
  47. data/spec/interceptors/monitoring/caching_spec.rb +66 -0
  48. data/spec/interceptors/response_competition_spec.rb +2 -2
  49. data/spec/interceptors/return_response_spec.rb +2 -2
  50. data/spec/interceptors/rollbar/main_spec.rb +27 -15
  51. data/spec/request/scrubbed_headers_spec.rb +101 -0
  52. data/spec/request/scrubbed_options_spec.rb +185 -0
  53. data/spec/request/scrubbed_params_spec.rb +25 -0
  54. data/spec/response/data_spec.rb +2 -2
  55. data/spec/spec_helper.rb +1 -0
  56. data/spec/support/zipkin_mock.rb +1 -0
  57. metadata +59 -26
  58. data/.rubocop.localch.yml +0 -325
  59. data/Gemfile.activesupport4 +0 -4
  60. data/cider-ci.yml +0 -6
  61. data/cider-ci/bin/bundle +0 -51
  62. data/cider-ci/bin/ruby_install +0 -8
  63. data/cider-ci/bin/ruby_version +0 -25
  64. data/cider-ci/jobs/rspec-activesupport-4.yml +0 -28
  65. data/cider-ci/jobs/rspec-activesupport-5.yml +0 -27
  66. data/cider-ci/jobs/rspec-activesupport-6.yml +0 -28
  67. data/cider-ci/jobs/rubocop.yml +0 -18
  68. data/cider-ci/task_components/bundle.yml +0 -22
  69. data/cider-ci/task_components/rspec.yml +0 -36
  70. data/cider-ci/task_components/rubocop.yml +0 -29
  71. data/cider-ci/task_components/ruby.yml +0 -15
data/.rubocop.localch.yml DELETED
@@ -1,325 +0,0 @@
1
- # This is master rubocop configuration.
2
- # DO NOT EDIT THIS FILE - it WILL be overwriten on every config update
3
- AllCops:
4
- TargetRubyVersion: 2.3
5
- DisplayCopNames: true
6
- DisplayStyleGuide: true
7
- Exclude:
8
- - 'db/**/*'
9
- - 'script/**/*'
10
- - 'vendor/bundle/**/*'
11
- - 'vendor/assets/**/*'
12
- - 'bin/**/*'
13
- - 'config/unicorn.rb'
14
- - 'config/compass.rb'
15
- - 'Rakefile'
16
- - 'app/controllers/error_trap_controller.rb'
17
- - 'app/controllers/hsts_controller.rb'
18
- - 'spec/lib/util_spec.rb'
19
-
20
- Rails:
21
- Enabled: true
22
-
23
- require:
24
- - rubocop-rspec
25
-
26
- Bundler/OrderedGems:
27
- Enabled: false
28
-
29
- Lint/HandleExceptions:
30
- Exclude:
31
- - spec/**/*
32
-
33
- Lint/UriEscapeUnescape:
34
- Enabled: false
35
-
36
- Style/RescueStandardError:
37
- Enabled: false
38
-
39
- Metrics/LineLength:
40
- Enabled: false
41
-
42
- Metrics/AbcSize:
43
- Enabled: false
44
-
45
- Metrics/MethodLength:
46
- Enabled: false
47
-
48
- Metrics/CyclomaticComplexity:
49
- Enabled: false
50
-
51
- Metrics/PerceivedComplexity:
52
- Enabled: false
53
-
54
- Metrics/ClassLength:
55
- Enabled: false
56
-
57
- Metrics/ModuleLength:
58
- Enabled: false
59
-
60
- Metrics/BlockLength:
61
- Enabled: false
62
-
63
- Metrics/ParameterLists:
64
- Enabled: false
65
-
66
- Metrics/BlockNesting:
67
- Enabled: false
68
-
69
- Performance/StringReplacement:
70
- Enabled: false
71
-
72
- Performance/TimesMap:
73
- Enabled: false
74
-
75
- Performance/RedundantBlockCall:
76
- Enabled: false
77
-
78
- Performance/RedundantMatch:
79
- Enabled: false
80
-
81
- Performance/RedundantMerge:
82
- Enabled: false
83
-
84
- Performance/Casecmp:
85
- Enabled: false
86
-
87
- Layout/MultilineOperationIndentation:
88
- EnforcedStyle: indented
89
-
90
- Layout/DotPosition:
91
- EnforcedStyle: leading
92
-
93
- Layout/AlignParameters:
94
- Enabled: false
95
-
96
- Layout/EmptyLinesAroundClassBody:
97
- Enabled: false
98
-
99
- Layout/IndentArray:
100
- EnforcedStyle: consistent
101
-
102
- Layout/MultilineMethodCallIndentation:
103
- EnforcedStyle: indented
104
-
105
- Layout/MultilineMethodCallBraceLayout:
106
- EnforcedStyle: symmetrical
107
-
108
- Layout/EmptyLinesAroundBlockBody:
109
- EnforcedStyle: no_empty_lines
110
-
111
- Layout/IndentHeredoc:
112
- Enabled: false
113
-
114
- Layout/MultilineArrayBraceLayout:
115
- EnforcedStyle: symmetrical
116
-
117
- Layout/MultilineHashBraceLayout:
118
- EnforcedStyle: symmetrical
119
-
120
- Style/StringLiterals:
121
- Enabled: false
122
-
123
- Style/RegexpLiteral:
124
- Exclude:
125
- - spec/**/*
126
-
127
- Style/NumericLiterals:
128
- Enabled: false
129
-
130
- Style/WordArray:
131
- Enabled: false
132
-
133
- Style/Next:
134
- Enabled: false
135
-
136
- Style/PercentLiteralDelimiters:
137
- Enabled: false
138
-
139
- Style/GlobalVars:
140
- Enabled: false
141
-
142
- Style/CommentAnnotation:
143
- Enabled: false
144
-
145
- Style/SymbolProc:
146
- Enabled: false
147
-
148
- Style/DoubleNegation:
149
- Enabled: false
150
-
151
- Style/FormatString:
152
- Enabled: false
153
-
154
- Style/AsciiComments:
155
- Enabled: false
156
-
157
- Style/BarePercentLiterals:
158
- Enabled: false
159
-
160
- Style/SingleLineBlockParams:
161
- Enabled: false
162
-
163
- Style/MultilineBlockChain:
164
- Enabled: false
165
-
166
- Style/UnneededCapitalW:
167
- Enabled: false
168
-
169
- Style/UnneededPercentQ:
170
- Enabled: false
171
-
172
- Style/BlockDelimiters:
173
- Exclude:
174
- - spec/**/*
175
-
176
- Style/BracesAroundHashParameters:
177
- EnforcedStyle: context_dependent
178
-
179
- Style/IfUnlessModifier:
180
- Enabled: false
181
-
182
- Style/ClassAndModuleChildren:
183
- Enabled: false
184
-
185
- Style/Documentation:
186
- Enabled: false
187
-
188
- Style/GuardClause:
189
- Enabled: false
190
-
191
- Naming/AccessorMethodName:
192
- Exclude:
193
- - spec/support/pages/**/*
194
-
195
- Style/NegatedIf:
196
- Enabled: false
197
-
198
- Style/MutableConstant:
199
- Enabled: false
200
-
201
- Style/ConditionalAssignment:
202
- Enabled: false
203
-
204
- Style/Lambda:
205
- Enabled: false
206
-
207
- Style/FrozenStringLiteralComment:
208
- Enabled: false
209
-
210
- Style/SymbolArray:
211
- Enabled: false
212
-
213
- Style/HashSyntax:
214
- EnforcedStyle: ruby19
215
-
216
- Style/FormatStringToken:
217
- Enabled: false
218
-
219
- Style/EmptyMethod:
220
- EnforcedStyle: expanded
221
-
222
- Style/TernaryParentheses:
223
- EnforcedStyle: require_parentheses_when_complex
224
-
225
- Naming/VariableNumber:
226
- Enabled: false
227
-
228
- Style/PerlBackrefs:
229
- Enabled: false
230
-
231
- Style/RegexpLiteral:
232
- AllowInnerSlashes: false
233
-
234
- Style/BlockComments:
235
- Enabled: false
236
-
237
- Style/RedundantParentheses:
238
- Enabled: false
239
-
240
- Naming/FileName:
241
- Exclude:
242
- - Gemfile
243
- - Brewfile
244
- - Guardfile
245
-
246
- Style/NumericPredicate:
247
- Enabled: false
248
-
249
- RSpec/DescribeClass:
250
- Exclude:
251
- - spec/views/**/*
252
- - spec/routing/**/*
253
- - spec/requests/**/*
254
- - spec/features/**/*
255
-
256
- RSpec/FilePath:
257
- Enabled: false
258
-
259
- RSpec/NamedSubject:
260
- Enabled: false
261
-
262
- RSpec/MultipleExpectations:
263
- Enabled: false
264
-
265
- RSpec/ExampleLength:
266
- Enabled: false
267
-
268
- RSpec/HookArgument:
269
- EnforcedStyle: implicit
270
-
271
- RSpec/MessageSpies:
272
- EnforcedStyle: receive
273
-
274
- RSpec/NestedGroups:
275
- Enabled: false
276
-
277
- RSpec/VerifiedDoubles:
278
- Enabled: false
279
-
280
- RSpec/LeadingSubject:
281
- Enabled: false
282
-
283
- RSpec/ExpectInHook:
284
- Enabled: false
285
-
286
- RSpec/ReturnFromStub:
287
- Enabled: false
288
-
289
- RSpec/SubjectStub:
290
- Enabled: false
291
-
292
- RSpec/EmptyLineAfterSubject:
293
- Enabled: false
294
-
295
- RSpec/LetSetup:
296
- Enabled: false
297
-
298
- RSpec/ImplicitExpect:
299
- EnforcedStyle: is_expected
300
-
301
- RSpec/ScatteredLet:
302
- Enabled: false
303
-
304
- RSpec/ContextWording:
305
- Enabled: false
306
-
307
- Rails/Output:
308
- Exclude:
309
- - 'config/application.rb'
310
- - 'config/initializers/asset_manifest_warning.rb'
311
-
312
- Rails/DynamicFindBy:
313
- Enabled: false
314
-
315
- Rails/Presence:
316
- Enabled: false
317
-
318
- Capybara/CurrentPathExpectation:
319
- Enabled: false
320
-
321
- Naming/UncommunicativeMethodParamName:
322
- Enabled: false
323
-
324
- Style/ExpandPathArguments:
325
- Enabled: false
@@ -1,4 +0,0 @@
1
- source 'https://rubygems.org/'
2
-
3
- gemspec
4
- gem 'activesupport', '~> 4.2.11'
data/cider-ci.yml DELETED
@@ -1,6 +0,0 @@
1
- jobs:
2
- include:
3
- - cider-ci/jobs/rspec-activesupport-4.yml
4
- - cider-ci/jobs/rspec-activesupport-5.yml
5
- - cider-ci/jobs/rspec-activesupport-6.yml
6
- - cider-ci/jobs/rubocop.yml
data/cider-ci/bin/bundle DELETED
@@ -1,51 +0,0 @@
1
- #!/usr/bin/env bash
2
- set -eux
3
-
4
- export PATH=~/.rubies/$RUBY/bin:$PATH
5
- rm -f .bundle/config
6
-
7
- if [ ! -f ~/.rubies/$RUBY/bin/bundle ]; then
8
- gem install bundler
9
- fi
10
-
11
- # install bundler v. 1.17.3 in order to be able to run the tests with
12
- # ACTIVESUPPORT=4 because rails (= 4.2.0) depends on bundler (< 2.0, >= 1.3.0)
13
- gem install bundler:1.17.3
14
-
15
- sed "s/^source 'https:\/\/rubygems\.intra\.local\.ch'*/source 'http\:\/\/52.29.7.59:9292'/g" Gemfile > Gemfile.tmp
16
- mv Gemfile.tmp Gemfile
17
-
18
- DIGEST=$(git ls-tree HEAD --\
19
- cider-ci.yml cider-ci Gemfile.lock \
20
- | openssl dgst -sha1 | cut -d ' ' -f 2)
21
-
22
- if [ ! -z ${ACTIVESUPPORT:-} ]; then
23
- DIGEST=$(echo "$DIGEST $ACTIVESUPPORT")
24
- fi
25
-
26
- DIGEST=$(echo "$DIGEST $PATH" \
27
- | openssl dgst -sha1 | cut -d ' ' -f 2)
28
-
29
- echo "DIGEST"
30
- echo "${DIGEST}"
31
-
32
- CACHE_SIGNATURE_FILE="/tmp/bundle_cache_signature_${DIGEST}"
33
-
34
- if [ ! -f $CACHE_SIGNATURE_FILE ] ; then
35
- if [ ! -z ${ACTIVESUPPORT:-} ]; then
36
- if [ ! -z ${BUNDLER:-} ]; then
37
- echo "BUNDLE_GEMFILE=Gemfile.activesupport$ACTIVESUPPORT bundle $BUNDLER install"
38
- BUNDLE_GEMFILE=Gemfile.activesupport$ACTIVESUPPORT bundle $BUNDLER install
39
- else
40
- echo "BUNDLE_GEMFILE=Gemfile.activesupport$ACTIVESUPPORT bundle install"
41
- BUNDLE_GEMFILE=Gemfile.activesupport$ACTIVESUPPORT bundle install
42
- fi
43
- else
44
- echo "bundle install"
45
- bundle $BUNDLER install
46
- fi
47
- touch $CACHE_SIGNATURE_FILE
48
- fi
49
-
50
- echo "bundle install"
51
- bundle $BUNDLER install
@@ -1,8 +0,0 @@
1
- #!/usr/bin/env bash
2
- set -eux
3
-
4
- export PATH=~/.rubies/$RUBY/bin:$PATH
5
-
6
- if [ ! -d ~/.rubies/$RUBY ]; then
7
- ruby-install --no-install-deps $RUBY
8
- fi
@@ -1,25 +0,0 @@
1
- #!/usr/bin/env bash
2
- set -eux
3
-
4
- if [ -f ./.ruby-version ]; then
5
- echo ".ruby-version file found"
6
- fi
7
-
8
- if [ ! -f ./.ruby-version ]; then
9
- echo ".ruby-version file not found"
10
- exit 1
11
- fi
12
-
13
- IFS='-' read -ra EXPLODED_RUBY <<< "$RUBY"
14
-
15
- if [ "${#EXPLODED_RUBY[@]}" == "1" ]; then
16
- echo 'No engine/version separator "-" found in .ruby-version file.'
17
- exit 1
18
- fi
19
-
20
- if [ "${#EXPLODED_RUBY[@]}" != "1" ] && [ "${#EXPLODED_RUBY[@]}" != "2" ]; then
21
- echo "Unknown format of .ruby-version file"
22
- exit 1
23
- fi
24
-
25
- echo $RUBY
@@ -1,28 +0,0 @@
1
- rspec-active-support-v4:
2
- name: 'rspec with ActiveSupport v4'
3
-
4
- run_when:
5
- 'some HEAD has been updated':
6
- type: branch
7
- include_match: ^.*$
8
-
9
- context:
10
-
11
- script_defaults:
12
- template_environment_variables: true
13
-
14
- task_defaults:
15
- environment_variables:
16
- ACTIVESUPPORT: '4'
17
- BUNDLER: '_1.17.3_'
18
-
19
- max_trials: 2
20
- dispatch_storm_delay_duration: 1 Seconds
21
- include:
22
- - cider-ci/task_components/ruby.yml
23
- - cider-ci/task_components/bundle.yml
24
- - cider-ci/task_components/rspec.yml
25
-
26
- tasks:
27
- all-rspec:
28
- name: All rspec tests, using ActiveSupport v4