lhc 10.1.2 → 10.1.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rubocop.yml +1 -1
- data/Gemfile +2 -0
- data/README.md +1 -1
- data/lhc.gemspec +2 -0
- data/lib/lhc.rb +2 -0
- data/lib/lhc/concerns/lhc/basic_methods_concern.rb +2 -0
- data/lib/lhc/concerns/lhc/configuration_concern.rb +2 -0
- data/lib/lhc/concerns/lhc/formats_concern.rb +2 -0
- data/lib/lhc/concerns/lhc/request/user_agent_concern.rb +2 -0
- data/lib/lhc/config.rb +2 -0
- data/lib/lhc/endpoint.rb +2 -0
- data/lib/lhc/error.rb +3 -1
- data/lib/lhc/errors/client_error.rb +2 -0
- data/lib/lhc/errors/parser_error.rb +2 -0
- data/lib/lhc/errors/server_error.rb +2 -0
- data/lib/lhc/errors/timeout.rb +2 -0
- data/lib/lhc/errors/unknown_error.rb +2 -0
- data/lib/lhc/format.rb +2 -0
- data/lib/lhc/formats.rb +2 -0
- data/lib/lhc/formats/json.rb +2 -0
- data/lib/lhc/formats/multipart.rb +2 -0
- data/lib/lhc/formats/plain.rb +2 -0
- data/lib/lhc/interceptor.rb +2 -0
- data/lib/lhc/interceptors.rb +2 -0
- data/lib/lhc/interceptors/auth.rb +2 -0
- data/lib/lhc/interceptors/caching.rb +2 -0
- data/lib/lhc/interceptors/default_timeout.rb +2 -0
- data/lib/lhc/interceptors/logging.rb +2 -0
- data/lib/lhc/interceptors/monitoring.rb +2 -0
- data/lib/lhc/interceptors/prometheus.rb +2 -0
- data/lib/lhc/interceptors/retry.rb +2 -0
- data/lib/lhc/interceptors/rollbar.rb +2 -0
- data/lib/lhc/interceptors/zipkin.rb +8 -6
- data/lib/lhc/railtie.rb +2 -0
- data/lib/lhc/request.rb +2 -0
- data/lib/lhc/response.rb +2 -0
- data/lib/lhc/response/data.rb +2 -0
- data/lib/lhc/response/data/base.rb +2 -0
- data/lib/lhc/response/data/collection.rb +2 -0
- data/lib/lhc/response/data/item.rb +2 -0
- data/lib/lhc/test/cache_helper.rb +2 -0
- data/lib/lhc/version.rb +3 -1
- data/spec/basic_methods/delete_spec.rb +2 -0
- data/spec/basic_methods/get_spec.rb +2 -0
- data/spec/basic_methods/post_spec.rb +2 -0
- data/spec/basic_methods/put_spec.rb +2 -0
- data/spec/basic_methods/request_spec.rb +2 -0
- data/spec/basic_methods/request_without_rails_spec.rb +2 -0
- data/spec/config/endpoints_spec.rb +2 -0
- data/spec/config/placeholders_spec.rb +2 -0
- data/spec/dummy/Rakefile +2 -0
- data/spec/dummy/app/controllers/application_controller.rb +2 -0
- data/spec/dummy/app/helpers/application_helper.rb +2 -0
- data/spec/dummy/bin/bundle +2 -0
- data/spec/dummy/bin/rails +2 -0
- data/spec/dummy/bin/rake +2 -0
- data/spec/dummy/config.ru +2 -0
- data/spec/dummy/config/application.rb +2 -0
- data/spec/dummy/config/boot.rb +2 -0
- data/spec/dummy/config/environment.rb +2 -0
- data/spec/dummy/config/environments/development.rb +2 -0
- data/spec/dummy/config/environments/production.rb +2 -0
- data/spec/dummy/config/environments/test.rb +2 -0
- data/spec/dummy/config/initializers/assets.rb +2 -0
- data/spec/dummy/config/initializers/backtrace_silencers.rb +2 -0
- data/spec/dummy/config/initializers/cookies_serializer.rb +2 -0
- data/spec/dummy/config/initializers/filter_parameter_logging.rb +2 -0
- data/spec/dummy/config/initializers/inflections.rb +2 -0
- data/spec/dummy/config/initializers/mime_types.rb +2 -0
- data/spec/dummy/config/initializers/session_store.rb +2 -0
- data/spec/dummy/config/initializers/wrap_parameters.rb +2 -0
- data/spec/dummy/config/routes.rb +2 -0
- data/spec/endpoint/compile_spec.rb +2 -0
- data/spec/endpoint/match_spec.rb +2 -0
- data/spec/endpoint/placeholders_spec.rb +2 -0
- data/spec/endpoint/remove_interpolated_params_spec.rb +2 -0
- data/spec/endpoint/values_as_params_spec.rb +2 -0
- data/spec/error/dup_spec.rb +2 -0
- data/spec/error/find_spec.rb +2 -0
- data/spec/error/response_spec.rb +2 -0
- data/spec/error/timeout_spec.rb +2 -0
- data/spec/error/to_s_spec.rb +4 -2
- data/spec/formats/json_spec.rb +2 -0
- data/spec/formats/multipart_spec.rb +5 -8
- data/spec/formats/plain_spec.rb +6 -9
- data/spec/interceptors/after_request_spec.rb +2 -0
- data/spec/interceptors/after_response_spec.rb +2 -0
- data/spec/interceptors/auth/basic_auth_spec.rb +2 -0
- data/spec/interceptors/auth/bearer_spec.rb +2 -0
- data/spec/interceptors/auth/reauthentication_configuration_spec.rb +2 -0
- data/spec/interceptors/auth/reauthentication_spec.rb +2 -0
- data/spec/interceptors/before_request_spec.rb +2 -0
- data/spec/interceptors/before_response_spec.rb +2 -0
- data/spec/interceptors/caching/hydra_spec.rb +2 -0
- data/spec/interceptors/caching/main_spec.rb +2 -0
- data/spec/interceptors/caching/methods_spec.rb +2 -0
- data/spec/interceptors/caching/options_spec.rb +2 -0
- data/spec/interceptors/caching/parameters_spec.rb +2 -0
- data/spec/interceptors/caching/response_status_spec.rb +2 -0
- data/spec/interceptors/caching/to_cache_spec.rb +2 -0
- data/spec/interceptors/default_interceptors_spec.rb +2 -0
- data/spec/interceptors/default_timeout/main_spec.rb +2 -0
- data/spec/interceptors/define_spec.rb +2 -0
- data/spec/interceptors/dup_spec.rb +2 -0
- data/spec/interceptors/logging/main_spec.rb +2 -0
- data/spec/interceptors/monitoring/main_spec.rb +2 -0
- data/spec/interceptors/prometheus_spec.rb +2 -0
- data/spec/interceptors/response_competition_spec.rb +2 -0
- data/spec/interceptors/retry/main_spec.rb +2 -0
- data/spec/interceptors/return_response_spec.rb +2 -0
- data/spec/interceptors/rollbar/main_spec.rb +2 -0
- data/spec/interceptors/zipkin/distributed_tracing_spec.rb +2 -0
- data/spec/rails_helper.rb +2 -0
- data/spec/request/body_spec.rb +2 -0
- data/spec/request/encoding_spec.rb +2 -0
- data/spec/request/error_handling_spec.rb +2 -0
- data/spec/request/headers_spec.rb +2 -0
- data/spec/request/ignore_errors_spec.rb +2 -0
- data/spec/request/option_dup_spec.rb +2 -0
- data/spec/request/parallel_requests_spec.rb +2 -0
- data/spec/request/params_encoding_spec.rb +2 -0
- data/spec/request/request_without_rails_spec.rb +2 -0
- data/spec/request/url_patterns_spec.rb +2 -0
- data/spec/request/user_agent_spec.rb +2 -0
- data/spec/request/user_agent_without_rails_spec.rb +2 -0
- data/spec/response/body_spec.rb +2 -0
- data/spec/response/code_spec.rb +2 -0
- data/spec/response/data_accessor_spec.rb +2 -0
- data/spec/response/data_spec.rb +2 -0
- data/spec/response/effective_url_spec.rb +2 -0
- data/spec/response/headers_spec.rb +2 -0
- data/spec/response/options_spec.rb +2 -0
- data/spec/response/success_spec.rb +2 -0
- data/spec/response/time_spec.rb +2 -0
- data/spec/spec_helper.rb +2 -0
- data/spec/support/load_json.rb +2 -0
- data/spec/support/reset_config.rb +2 -0
- data/spec/support/zipkin_mock.rb +10 -8
- data/spec/timeouts/no_signal_spec.rb +2 -0
- data/spec/timeouts/timings_spec.rb +2 -0
- metadata +2 -2
data/spec/dummy/config/routes.rb
CHANGED
data/spec/endpoint/match_spec.rb
CHANGED
data/spec/error/dup_spec.rb
CHANGED
data/spec/error/find_spec.rb
CHANGED
data/spec/error/response_spec.rb
CHANGED
data/spec/error/timeout_spec.rb
CHANGED
data/spec/error/to_s_spec.rb
CHANGED
@@ -1,8 +1,10 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
require 'rails_helper'
|
2
4
|
|
3
5
|
describe LHC::Error do
|
4
6
|
context 'to_s' do
|
5
|
-
let(:invalid) { "in\xc3lid".force_encoding('ASCII-8BIT') }
|
7
|
+
let(:invalid) { (+"in\xc3lid").force_encoding('ASCII-8BIT') }
|
6
8
|
let(:valid) { "vælid" }
|
7
9
|
|
8
10
|
context 'check assumptions' do
|
@@ -68,7 +70,7 @@ describe LHC::Error do
|
|
68
70
|
Options: {:followlocation=>true, :auth=>{:bearer=>"aaaaaaaa-bbbb-cccc-dddd-eeee"}, :params=>{:limit=>20}, :url=>"http://example.com/sessions"}
|
69
71
|
Headers: {"Bearer Token"=>"aaaaaaaa-bbbb-cccc-dddd-eeee"}
|
70
72
|
Response Code: 500 (internal_error)
|
71
|
-
|
73
|
+
Response Options: {:return_code=>:internal_error, :response_headers=>""}
|
72
74
|
{"status":500,"message":"undefined"}
|
73
75
|
The error message
|
74
76
|
MSG
|
data/spec/formats/json_spec.rb
CHANGED
@@ -1,15 +1,12 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
require 'rails_helper'
|
2
4
|
|
3
5
|
describe LHC do
|
6
|
+
include ActionDispatch::TestProcess
|
7
|
+
|
4
8
|
context 'multipart' do
|
5
|
-
let(:file)
|
6
|
-
ActionDispatch::Http::UploadedFile.new(
|
7
|
-
tempfile: Tempfile.new,
|
8
|
-
filename: 'image.jpg',
|
9
|
-
type: 'image/jpeg',
|
10
|
-
head: %q{Content-Disposition: form-data; name="files[]"; filename="image.jpg"\r\nContent-Type: image/jpeg\r\n}
|
11
|
-
)
|
12
|
-
end
|
9
|
+
let(:file) { fixture_file_upload(Tempfile.new, 'image/jpeg') }
|
13
10
|
let(:body) { { size: 2231 }.to_json }
|
14
11
|
let(:location) { 'http://local.ch/uploads/image.jpg' }
|
15
12
|
|
data/spec/formats/plain_spec.rb
CHANGED
@@ -1,19 +1,16 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
require 'rails_helper'
|
2
4
|
|
3
5
|
describe LHC do
|
6
|
+
include ActionDispatch::TestProcess
|
7
|
+
|
4
8
|
context 'plain' do
|
5
|
-
let(:file)
|
6
|
-
ActionDispatch::Http::UploadedFile.new(
|
7
|
-
tempfile: Tempfile.new,
|
8
|
-
filename: 'image.jpg',
|
9
|
-
type: 'image/jpeg',
|
10
|
-
head: %q{Content-Disposition: form-data; name="files[]"; filename="image.jpg"\r\nContent-Type: image/jpeg\r\n}
|
11
|
-
)
|
12
|
-
end
|
9
|
+
let(:file) { fixture_file_upload(Tempfile.new, 'image/jpeg') }
|
13
10
|
|
14
11
|
it 'leaves plains requests unformatted' do
|
15
12
|
stub_request(:post, 'http://local.ch/')
|
16
|
-
.with(body: /file=%23%
|
13
|
+
.with(body: /file=%23%3CRack%3A%3ATest%3A%3AUploadedFile%3.*%3E&type=Image/)
|
17
14
|
.to_return do |request|
|
18
15
|
expect(request.headers['Content-Type']).to be_blank
|
19
16
|
|
data/spec/rails_helper.rb
CHANGED
data/spec/request/body_spec.rb
CHANGED