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
@@ -1,27 +0,0 @@
1
- rspec-active-support-v5:
2
- name: 'rspec with ActiveSupport v5'
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: '5'
17
-
18
- max_trials: 2
19
- dispatch_storm_delay_duration: 1 Seconds
20
- include:
21
- - cider-ci/task_components/ruby.yml
22
- - cider-ci/task_components/bundle.yml
23
- - cider-ci/task_components/rspec.yml
24
-
25
- tasks:
26
- all-rspec:
27
- name: All rspec tests, using ActiveSupport v5
@@ -1,28 +0,0 @@
1
- rspec-active-support-v6:
2
- name: 'rspec with ActiveSupport v6'
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: '6'
17
- RUBY: 'ruby-2.6.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 v6
@@ -1,18 +0,0 @@
1
- rubocop:
2
- name: 'Rubocop'
3
-
4
- run_when:
5
- 'some HEAD has been updated':
6
- type: branch
7
- include_match: ^.*$
8
-
9
- context:
10
-
11
- tasks:
12
-
13
- rubocop:
14
-
15
- include:
16
- - cider-ci/task_components/ruby.yml
17
- - cider-ci/task_components/bundle.yml
18
- - cider-ci/task_components/rubocop.yml
@@ -1,22 +0,0 @@
1
- traits:
2
- ruby-install: true
3
- Bash: true
4
-
5
- trial_attachments:
6
- gemfile:
7
- include_match: Gemfile
8
- content_type: text/plain
9
-
10
- environment_variables:
11
- BUNDLER: '_1.17.3_'
12
-
13
- scripts:
14
-
15
- bundle:
16
- exclusive_executor_resource: ruby-install_{{$RUBY}}
17
- timeout: 20 Minutes
18
- body: cider-ci/bin/bundle
19
- start_when:
20
- 'ruby installed':
21
- script_key: ruby-install
22
-
@@ -1,36 +0,0 @@
1
- ports:
2
- CAPYBARA_PORT:
3
- min: 8000
4
- max: 8999
5
- PHANTOMJS_PORT:
6
- min: 44600
7
- max: 44999
8
-
9
- environment_variables:
10
- RUBY:
11
- read_and_replace_with: .ruby-version
12
- RAILS_ENV: 'test'
13
-
14
- scripts:
15
- rspec:
16
- body: |
17
- #!/usr/bin/env bash
18
- set -eux
19
- mkdir -p tmp/cache
20
- export PATH=~/.rubies/$RUBY/bin:$PATH
21
- if [ ! -z ${ACTIVESUPPORT:-} ]; then BUNDLE_GEMFILE=Gemfile.activesupport$ACTIVESUPPORT bundle $BUNDLER exec rspec; else bundle exec rspec; fi
22
-
23
- start_when:
24
- 'bundled':
25
- script_key: bundle
26
-
27
- trial_attachments:
28
- logs:
29
- include_match: log\/.*\.log$
30
- content_type: text/plain
31
- image-screenshots:
32
- include_match: tmp\/capybara\/.*\.png$
33
- content_type: image/png
34
- html-screenshots:
35
- include_match: tmp\/capybara\/.*\.html$
36
- content_type: text/html
@@ -1,29 +0,0 @@
1
- trial_attachments:
2
- logs:
3
- include_match: tmp\/checkstyle.json$
4
- content_type: application/json
5
-
6
- tree_attachments:
7
- logs:
8
- include_match: tmp\/checkstyle.json$
9
- content_type: application/json
10
-
11
- environment_variables:
12
- RUBY:
13
- read_and_replace_with: .ruby-version
14
- RESULT_PATH: 'tmp/checkstyle.json'
15
-
16
- max_trials: 1
17
-
18
- scripts:
19
- rubocop:
20
- start_when:
21
- 'bundled':
22
- script_key: bundle
23
- body: |
24
- #!/usr/bin/env bash
25
- set -eux
26
- mkdir -p tmp/cache
27
- export PATH=~/.rubies/$RUBY/bin:$PATH
28
- bundle exec rubocop --config .rubocop.yml \
29
- --format json --out $RESULT_PATH --format progress
@@ -1,15 +0,0 @@
1
- environment_variables:
2
- RUBY:
3
- read_and_replace_with: .ruby-version
4
-
5
- scripts:
6
- ruby-version:
7
- body: cider-ci/bin/ruby_version
8
- ruby-install:
9
- exclusive_executor_resource: ruby-install_{{$RUBY}}
10
- timeout: 20 Minutes
11
- body: cider-ci/bin/ruby_install
12
- start_when:
13
- 'ruby version checked':
14
- script_key: ruby-version
15
-