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
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: edceeb5ec4bd94dd580a56ed8a0ed0a71a31a8bd5c0b1f08dc96c7f8614d42b3
4
- data.tar.gz: 183c118e2861b420877c37dfc8f86643d8fd410f8c2abbb8d681cdd168956108
3
+ metadata.gz: 14253d5b4b5d91f3ab982f01967045ecdbe49003e4c992544315a2fd0fdc1827
4
+ data.tar.gz: 7c8e6561080375d1a8cc3d8f5e6ef36ab6c5a09ba15dd0585544e66768336a27
5
5
  SHA512:
6
- metadata.gz: 92bd31139ebf0bc508e0681c99c5f35b8b9c93b0a6f56fdf2fcdbfb1faa1c3fa80c2894d48ebc31ad8c4138af5df9548b3f65f87a33bb5ebbf5a873a8d696585
7
- data.tar.gz: 5b4f2fee1a99c4823ad1d0231624d6bf62794bff60bc27379c180b676439b88f89242813a2b306e44dde1946985114fa1190b1e67a22befdc089f41af520f759
6
+ metadata.gz: 20d7c5716b979647de9c84b0117ff17495ae55abc8d4ba20bc01d9deee37100335c0fc2a4a674ba4883f87c4fbcfa88e274da92aadc972c0385f6930c29db8f9
7
+ data.tar.gz: f41c9f8302517137811020d2337c2922de8b0cd471f3b744cf80b3ea3d4dad62d2c735305090d5f23912735b07840b92abf01ae2fb801b3b6b7f1e4139ebcccc
@@ -0,0 +1,15 @@
1
+ name: Rubocop
2
+
3
+ on: push
4
+
5
+ jobs:
6
+ rubocop:
7
+ runs-on: ubuntu-latest
8
+
9
+ steps:
10
+ - uses: actions/checkout@v2
11
+ - uses: ruby/setup-ruby@v1
12
+ with:
13
+ bundler-cache: true
14
+ - name: Run Rubocop
15
+ run: bundle exec rubocop
@@ -0,0 +1,15 @@
1
+ name: Test
2
+
3
+ on: push
4
+
5
+ jobs:
6
+ rspec:
7
+ runs-on: ubuntu-latest
8
+
9
+ steps:
10
+ - uses: actions/checkout@v2
11
+ - uses: ruby/setup-ruby@v1
12
+ with:
13
+ bundler-cache: true
14
+ - name: Run Tests
15
+ run: bundle exec rspec
data/.rubocop.yml CHANGED
@@ -1,61 +1,386 @@
1
- # This is project specific rubocop configuration file.
2
- # You can tweak project settings here
3
- inherit_from:
4
- - ./.rubocop.localch.yml
5
-
6
1
  AllCops:
7
- TargetRubyVersion: 2.3
2
+ DisplayCopNames: true
3
+ DisplayStyleGuide: true
4
+ TargetRubyVersion: '2.7'
5
+ NewCops: enable
6
+ SuggestExtensions: false
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
+ - vendor/**
20
+ - vendor/**/.*
21
+
22
+ require:
23
+ - rubocop-rspec
24
+ - rubocop-performance
25
+
26
+ Bundler/OrderedGems:
27
+ Enabled: false
28
+
29
+ Lint/SuppressedException:
30
+ Exclude:
31
+ - spec/**/*
32
+
33
+ Lint/UriEscapeUnescape:
34
+ Enabled: false
8
35
 
9
36
  Lint/IneffectiveAccessModifier:
10
37
  Enabled: false
11
38
 
12
- Rails:
39
+ Lint/ConstantDefinitionInBlock:
13
40
  Enabled: false
14
41
 
15
- RSpec/AnyInstance:
42
+ Lint/ToJSON:
16
43
  Enabled: false
17
44
 
18
- RSpec/DescribedClass:
45
+ Lint/NonDeterministicRequireOrder:
19
46
  Enabled: false
20
47
 
21
- RSpec/MultipleExpectations:
48
+ Lint/DeprecatedConstants: # (new in 1.8)
22
49
  Enabled: false
23
50
 
24
- RSpec/HookArgument:
51
+ Lint/EmptyBlock: # (new in 1.1)
25
52
  Enabled: false
26
53
 
27
- RSpec/ExampleLength:
54
+ Lint/EmptyClass: # (new in 1.3)
55
+ Enabled: false
56
+
57
+ Lint/OrAssignmentToConstant: # (new in 1.9)
58
+ Enabled: false
59
+
60
+ Lint/SymbolConversion: # (new in 1.9)
61
+ Enabled: false
62
+
63
+ Metrics/AbcSize:
64
+ Enabled: false
65
+
66
+ Metrics/MethodLength:
67
+ Enabled: false
68
+
69
+ Metrics/CyclomaticComplexity:
70
+ Enabled: false
71
+
72
+ Metrics/PerceivedComplexity:
73
+ Enabled: false
74
+
75
+ Metrics/ClassLength:
76
+ Enabled: false
77
+
78
+ Metrics/ModuleLength:
79
+ Enabled: false
80
+
81
+ Metrics/BlockLength:
82
+ Enabled: false
83
+
84
+ Metrics/ParameterLists:
85
+ Enabled: false
86
+
87
+ Metrics/BlockNesting:
88
+ Enabled: false
89
+
90
+ Layout/MultilineOperationIndentation:
91
+ EnforcedStyle: indented
92
+
93
+ Layout/DotPosition:
94
+ EnforcedStyle: leading
95
+
96
+ Layout/ParameterAlignment:
97
+ Enabled: false
98
+
99
+ Layout/EmptyLinesAroundClassBody:
100
+ Enabled: false
101
+
102
+ Layout/FirstArrayElementIndentation:
103
+ EnforcedStyle: consistent
104
+
105
+ Layout/MultilineMethodCallIndentation:
106
+ EnforcedStyle: indented
107
+
108
+ Layout/MultilineMethodCallBraceLayout:
109
+ EnforcedStyle: symmetrical
110
+
111
+ Layout/EmptyLinesAroundBlockBody:
112
+ EnforcedStyle: no_empty_lines
113
+
114
+ Layout/HeredocIndentation:
115
+ Enabled: false
116
+
117
+ Layout/MultilineArrayBraceLayout:
118
+ EnforcedStyle: symmetrical
119
+
120
+ Layout/MultilineHashBraceLayout:
121
+ EnforcedStyle: symmetrical
122
+
123
+ Layout/LineLength:
124
+ Enabled: false
125
+
126
+ Style/RescueStandardError:
127
+ Enabled: false
128
+
129
+ Style/StringLiterals:
130
+ Enabled: false
131
+
132
+ Style/NumericLiterals:
133
+ Enabled: false
134
+
135
+ Style/WordArray:
136
+ Enabled: false
137
+
138
+ Style/Next:
139
+ Enabled: false
140
+
141
+ Style/PercentLiteralDelimiters:
142
+ Enabled: false
143
+
144
+ Style/GlobalVars:
145
+ Enabled: false
146
+
147
+ Style/CommentAnnotation:
148
+ Enabled: false
149
+
150
+ Style/SymbolProc:
151
+ Enabled: false
152
+
153
+ Style/DoubleNegation:
154
+ Enabled: false
155
+
156
+ Style/FormatString:
157
+ Enabled: false
158
+
159
+ Style/AsciiComments:
160
+ Enabled: false
161
+
162
+ Style/BarePercentLiterals:
163
+ Enabled: false
164
+
165
+ Style/SingleLineBlockParams:
166
+ Enabled: false
167
+
168
+ Style/MultilineBlockChain:
169
+ Enabled: false
170
+
171
+ Style/RedundantCapitalW:
172
+ Enabled: false
173
+
174
+ Style/RedundantPercentQ:
175
+ Enabled: false
176
+
177
+ Style/BlockDelimiters:
178
+ Exclude:
179
+ - spec/**/*
180
+
181
+ Style/IfUnlessModifier:
182
+ Enabled: false
183
+
184
+ Style/ClassAndModuleChildren:
185
+ Enabled: false
186
+
187
+ Style/Documentation:
188
+ Enabled: false
189
+
190
+ Style/GuardClause:
191
+ Enabled: false
192
+
193
+
194
+ Style/NegatedIf:
195
+ Enabled: false
196
+
197
+ Style/MutableConstant:
198
+ Enabled: false
199
+
200
+ Style/ConditionalAssignment:
28
201
  Enabled: false
29
202
 
30
203
  Style/Lambda:
31
204
  Enabled: false
32
205
 
33
- RSpec/NestedGroups:
206
+ Style/SymbolArray:
34
207
  Enabled: false
35
208
 
36
- RSpec/VerifiedDoubles:
209
+ Style/HashSyntax:
210
+ EnforcedStyle: ruby19
211
+
212
+ Style/FormatStringToken:
213
+ Enabled: false
214
+
215
+ Style/TernaryParentheses:
216
+ EnforcedStyle: require_parentheses_when_complex
217
+
218
+ Style/PerlBackrefs:
219
+ Enabled: false
220
+
221
+ Style/RegexpLiteral:
222
+ AllowInnerSlashes: false
223
+ Exclude:
224
+ - spec/**/*
225
+
226
+ Style/BlockComments:
227
+ Enabled: false
228
+
229
+ Style/RedundantParentheses:
230
+ Enabled: false
231
+
232
+ Style/NumericPredicate:
37
233
  Enabled: false
38
234
 
39
235
  Style/RedundantReturn:
40
236
  Enabled: false
41
237
 
42
- RSpec/InstanceVariable:
238
+ Style/EmptyMethod:
239
+ EnforcedStyle: compact
240
+
241
+ Style/ExpandPathArguments:
43
242
  Enabled: false
44
243
 
45
244
  Style/FrozenStringLiteralComment:
46
245
  Enabled: true
47
246
 
48
- Naming/MemoizedInstanceVariableName:
247
+ Style/RedundantBegin:
248
+ Enabled: false
249
+
250
+ Style/RedundantAssignment:
251
+ Enabled: false
252
+
253
+ Style/SingleArgumentDig:
254
+ Enabled: false
255
+
256
+ Style/OptionalBooleanParameter:
257
+ Enabled: false
258
+
259
+ Style/CaseLikeIf:
260
+ Enabled: false
261
+
262
+ Style/HashEachMethods:
263
+ Enabled: false
264
+
265
+ Style/HashConversion: # (new in 1.10)
266
+ Enabled: false
267
+
268
+ Style/NilLambda: # (new in 1.3)
269
+ Enabled: false
270
+
271
+ RSpec/DescribeClass:
272
+ Exclude:
273
+ - spec/views/**/*
274
+ - spec/routing/**/*
275
+ - spec/requests/**/*
276
+ - spec/features/**/*
277
+
278
+ RSpec/FilePath:
279
+ Enabled: false
280
+
281
+ RSpec/NamedSubject:
282
+ Enabled: false
283
+
284
+ RSpec/LeadingSubject:
285
+ Enabled: false
286
+
287
+ RSpec/ExpectInHook:
288
+ Enabled: false
289
+
290
+ RSpec/ReturnFromStub:
291
+ Enabled: false
292
+
293
+ RSpec/SubjectStub:
294
+ Enabled: false
295
+
296
+ RSpec/EmptyLineAfterSubject:
297
+ Enabled: false
298
+
299
+ RSpec/LetSetup:
300
+ Enabled: false
301
+
302
+ RSpec/ImplicitExpect:
303
+ EnforcedStyle: is_expected
304
+
305
+ RSpec/ScatteredLet:
306
+ Enabled: false
307
+
308
+ RSpec/ContextWording:
309
+ Enabled: false
310
+
311
+ RSpec/AnyInstance:
312
+ Enabled: false
313
+
314
+ RSpec/DescribedClass:
315
+ Enabled: false
316
+
317
+ RSpec/MultipleExpectations:
318
+ Enabled: false
319
+
320
+ RSpec/HookArgument:
321
+ Enabled: false
322
+
323
+ RSpec/ExampleLength:
324
+ Enabled: false
325
+
326
+ RSpec/NestedGroups:
327
+ Enabled: false
328
+
329
+ RSpec/VerifiedDoubles:
330
+ Enabled: false
331
+
332
+ RSpec/InstanceVariable:
49
333
  Enabled: false
50
334
 
51
335
  RSpec/MessageSpies:
52
336
  Enabled: false
53
337
 
54
- RSpec/BeforeAfterAll:
338
+ RSpec/FactoryBot/CreateList:
55
339
  Enabled: false
56
340
 
57
- Style/EmptyMethod:
58
- EnforcedStyle: compact
341
+ RSpec/BeforeAfterAll:
342
+ Enabled: false
59
343
 
60
344
  RSpec/RepeatedExample:
61
345
  Enabled: false
346
+
347
+ Naming/FileName:
348
+ Exclude:
349
+ - Gemfile
350
+ - Brewfile
351
+ - Guardfile
352
+
353
+ Naming/AccessorMethodName:
354
+ Exclude:
355
+ - spec/support/pages/**/*
356
+
357
+ Naming/VariableNumber:
358
+ Enabled: false
359
+
360
+ Naming/MethodParameterName:
361
+ Enabled: false
362
+
363
+ Naming/MemoizedInstanceVariableName:
364
+ Enabled: false
365
+
366
+
367
+ Performance/StringReplacement:
368
+ Enabled: false
369
+
370
+ Performance/TimesMap:
371
+ Enabled: false
372
+
373
+ Performance/RedundantBlockCall:
374
+ Enabled: false
375
+
376
+ Performance/RedundantMatch:
377
+ Enabled: false
378
+
379
+ Performance/RedundantMerge:
380
+ Enabled: false
381
+
382
+ Performance/Casecmp:
383
+ Enabled: false
384
+
385
+ Performance/StringInclude: # (new in 1.7)
386
+ Enabled: false