lhc 13.0.0 → 15.0.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.
Files changed (63) 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/README.md +89 -0
  7. data/Rakefile +3 -3
  8. data/lhc.gemspec +3 -1
  9. data/lib/lhc.rb +70 -59
  10. data/lib/lhc/concerns/lhc/fix_invalid_encoding_concern.rb +1 -0
  11. data/lib/lhc/config.rb +16 -0
  12. data/lib/lhc/endpoint.rb +3 -0
  13. data/lib/lhc/error.rb +7 -4
  14. data/lib/lhc/interceptor.rb +4 -0
  15. data/lib/lhc/interceptors.rb +1 -0
  16. data/lib/lhc/interceptors/auth.rb +10 -5
  17. data/lib/lhc/interceptors/caching.rb +14 -3
  18. data/lib/lhc/interceptors/logging.rb +4 -2
  19. data/lib/lhc/interceptors/monitoring.rb +46 -11
  20. data/lib/lhc/interceptors/retry.rb +2 -0
  21. data/lib/lhc/interceptors/rollbar.rb +3 -2
  22. data/lib/lhc/interceptors/throttle.rb +7 -2
  23. data/lib/lhc/interceptors/zipkin.rb +2 -0
  24. data/lib/lhc/request.rb +37 -4
  25. data/lib/lhc/response.rb +1 -0
  26. data/lib/lhc/response/data.rb +1 -1
  27. data/lib/lhc/scrubber.rb +45 -0
  28. data/lib/lhc/scrubbers/auth_scrubber.rb +33 -0
  29. data/lib/lhc/scrubbers/body_scrubber.rb +28 -0
  30. data/lib/lhc/scrubbers/headers_scrubber.rb +38 -0
  31. data/lib/lhc/scrubbers/params_scrubber.rb +14 -0
  32. data/lib/lhc/version.rb +1 -1
  33. data/spec/config/scrubs_spec.rb +108 -0
  34. data/spec/error/to_s_spec.rb +13 -8
  35. data/spec/formats/multipart_spec.rb +2 -2
  36. data/spec/formats/plain_spec.rb +1 -1
  37. data/spec/interceptors/after_response_spec.rb +1 -1
  38. data/spec/interceptors/caching/main_spec.rb +2 -2
  39. data/spec/interceptors/caching/multilevel_cache_spec.rb +2 -1
  40. data/spec/interceptors/define_spec.rb +1 -0
  41. data/spec/interceptors/logging/main_spec.rb +21 -1
  42. data/spec/interceptors/monitoring/caching_spec.rb +66 -0
  43. data/spec/interceptors/response_competition_spec.rb +2 -2
  44. data/spec/interceptors/return_response_spec.rb +2 -2
  45. data/spec/interceptors/rollbar/main_spec.rb +27 -15
  46. data/spec/request/scrubbed_headers_spec.rb +101 -0
  47. data/spec/request/scrubbed_options_spec.rb +194 -0
  48. data/spec/request/scrubbed_params_spec.rb +35 -0
  49. data/spec/response/data_spec.rb +2 -2
  50. data/spec/support/zipkin_mock.rb +1 -0
  51. metadata +40 -21
  52. data/.rubocop.localch.yml +0 -325
  53. data/cider-ci.yml +0 -5
  54. data/cider-ci/bin/bundle +0 -51
  55. data/cider-ci/bin/ruby_install +0 -8
  56. data/cider-ci/bin/ruby_version +0 -25
  57. data/cider-ci/jobs/rspec-activesupport-5.yml +0 -27
  58. data/cider-ci/jobs/rspec-activesupport-6.yml +0 -28
  59. data/cider-ci/jobs/rubocop.yml +0 -18
  60. data/cider-ci/task_components/bundle.yml +0 -22
  61. data/cider-ci/task_components/rspec.yml +0 -36
  62. data/cider-ci/task_components/rubocop.yml +0 -29
  63. data/cider-ci/task_components/ruby.yml +0 -15
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 4795a0c91e246b2139465a030a8f98e0ba2deb07a48664632524b00ad2f02403
4
- data.tar.gz: 821adbc1157dbd699ad9a40f556a3ea7e94088aa8a320de6685b475a11596351
3
+ metadata.gz: 3a34aeee4fa910b8099acfdd73813103beb630400b92b449dbfbf4d87de4e041
4
+ data.tar.gz: 846b8cc9e24b9b0b9189b24d38c3e7b485096b4afd970cfc6fe48c8ee3a76d7e
5
5
  SHA512:
6
- metadata.gz: 9f8a0035d222617beeafce69dfadb17138d5eb31ea6fed900b6aca4582bbafb332b564e3557f42a1dbbcb287f2e6c55fe100c5e74f92e916f0686172b06f9f07
7
- data.tar.gz: '058260bffcbacc6edac359e9852a519c3b49fe902bf48a3c7635226c43c563f73c1308ca11fbf6096213ade013ffc40e22c22e4901e455628b19e0d87cc74c7d'
6
+ metadata.gz: 067d2e56385e931f00caa829411888881705ec19a702979332ad5074bf1a6515f0893e09111314b825fa7dd6d559518c997ac309f17e06eee245faffe93fcebd
7
+ data.tar.gz: 5284f04c83ca525e774775c41bd88d9f2dc8feeaf8f1fb47d3b9bde5677eeaad9bec6be6213597c4d1f34a2a22f8703b9f8e7fef0a4a09a58f24a6f72b2bf66b
@@ -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