passbase 1.0.1 → 1.3.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.
- checksums.yaml +4 -4
- data/Gemfile.lock +15 -3
- data/README.md +16 -15
- data/docs/Cursor.md +8 -7
- data/docs/Identity.md +24 -17
- data/docs/IdentityApi.md +204 -61
- data/docs/IdentityOwner.md +22 -0
- data/docs/IdentityResource.md +10 -9
- data/docs/PaginatedIdentities.md +10 -9
- data/docs/PaginatedResources.md +10 -9
- data/docs/ProjectApi.md +29 -12
- data/docs/ProjectSettings.md +18 -17
- data/docs/ProjectSettingsCustomizations.md +12 -11
- data/docs/ProjectSettingsVerificationSteps.md +10 -9
- data/docs/Resource.md +18 -17
- data/docs/ResourceFile.md +14 -13
- data/docs/ResourceInput.md +16 -15
- data/docs/User.md +12 -11
- data/docs/WatchlistResponse.md +16 -15
- data/lib/passbase.rb +2 -1
- data/lib/passbase/api/identity_api.rb +109 -30
- data/lib/passbase/api/project_api.rb +5 -4
- data/lib/passbase/api_client.rb +42 -51
- data/lib/passbase/api_error.rb +1 -1
- data/lib/passbase/configuration.rb +42 -13
- data/lib/passbase/models/cursor.rb +18 -8
- data/lib/passbase/models/identity.rb +48 -9
- data/lib/passbase/models/identity_owner.rb +239 -0
- data/lib/passbase/models/identity_resource.rb +18 -8
- data/lib/passbase/models/paginated_identities.rb +18 -8
- data/lib/passbase/models/paginated_resources.rb +18 -8
- data/lib/passbase/models/project_settings.rb +19 -9
- data/lib/passbase/models/project_settings_customizations.rb +18 -42
- data/lib/passbase/models/project_settings_verification_steps.rb +18 -8
- data/lib/passbase/models/resource.rb +18 -8
- data/lib/passbase/models/resource_file.rb +18 -8
- data/lib/passbase/models/resource_input.rb +18 -8
- data/lib/passbase/models/user.rb +18 -8
- data/lib/passbase/models/watchlist_response.rb +18 -8
- data/lib/passbase/version.rb +3 -3
- data/passbase.gemspec +4 -4
- data/spec/api/identity_api_spec.rb +21 -7
- data/spec/api/project_api_spec.rb +1 -1
- data/spec/api_client_spec.rb +1 -1
- data/spec/configuration_spec.rb +4 -4
- data/spec/models/cursor_spec.rb +4 -11
- data/spec/models/identity_owner_spec.rb +46 -0
- data/spec/models/identity_resource_spec.rb +4 -11
- data/spec/models/identity_spec.rb +23 -12
- data/spec/models/paginated_identities_spec.rb +4 -11
- data/spec/models/paginated_resources_spec.rb +4 -11
- data/spec/models/project_settings_customizations_spec.rb +4 -15
- data/spec/models/project_settings_spec.rb +5 -12
- data/spec/models/project_settings_verification_steps_spec.rb +4 -11
- data/spec/models/resource_file_spec.rb +4 -11
- data/spec/models/resource_input_spec.rb +4 -11
- data/spec/models/resource_spec.rb +5 -12
- data/spec/models/user_spec.rb +4 -11
- data/spec/models/watchlist_response_spec.rb +4 -11
- data/spec/spec_helper.rb +1 -1
- data/vendor/bundle/ruby/2.7.0/bin/htmldiff +1 -1
- data/vendor/bundle/ruby/2.7.0/bin/ldiff +1 -1
- data/vendor/bundle/ruby/2.7.0/cache/faraday-1.4.2.gem +0 -0
- data/vendor/bundle/ruby/2.7.0/cache/faraday-em_http-1.0.0.gem +0 -0
- data/vendor/bundle/ruby/2.7.0/cache/faraday-em_synchrony-1.0.0.gem +0 -0
- data/vendor/bundle/ruby/2.7.0/cache/faraday-excon-1.1.0.gem +0 -0
- data/vendor/bundle/ruby/2.7.0/cache/faraday-net_http-1.0.1.gem +0 -0
- data/vendor/bundle/ruby/2.7.0/cache/faraday-net_http_persistent-1.1.0.gem +0 -0
- data/vendor/bundle/ruby/2.7.0/cache/ruby2_keywords-0.0.4.gem +0 -0
- data/vendor/bundle/ruby/2.7.0/extensions/x86_64-linux/2.7.0/byebug-11.1.3/byebug/byebug.so +0 -0
- data/vendor/bundle/ruby/2.7.0/extensions/x86_64-linux/{2.7.0-static → 2.7.0}/byebug-11.1.3/gem.build_complete +0 -0
- data/vendor/bundle/ruby/2.7.0/extensions/x86_64-linux/{2.7.0-static → 2.7.0}/byebug-11.1.3/gem_make.out +2 -2
- data/vendor/bundle/ruby/2.7.0/extensions/x86_64-linux/{2.7.0-static → 2.7.0}/jaro_winkler-1.5.4/gem.build_complete +0 -0
- data/vendor/bundle/ruby/2.7.0/extensions/x86_64-linux/2.7.0/jaro_winkler-1.5.4/gem_make.out +67 -0
- data/vendor/bundle/ruby/2.7.0/extensions/x86_64-linux/2.7.0/jaro_winkler-1.5.4/jaro_winkler/jaro_winkler_ext.so +0 -0
- data/vendor/bundle/ruby/2.7.0/extensions/x86_64-linux/{2.7.0-static → 2.7.0}/psych-3.2.0/gem.build_complete +0 -0
- data/vendor/bundle/ruby/2.7.0/extensions/x86_64-linux/{2.7.0-static → 2.7.0}/psych-3.2.0/gem_make.out +2 -2
- data/vendor/bundle/ruby/2.7.0/extensions/x86_64-linux/2.7.0/psych-3.2.0/mkmf.log +196 -0
- data/vendor/bundle/ruby/2.7.0/extensions/x86_64-linux/2.7.0/psych-3.2.0/psych.so +0 -0
- data/vendor/bundle/ruby/2.7.0/gems/byebug-11.1.3/ext/byebug/Makefile +13 -13
- data/vendor/bundle/ruby/2.7.0/gems/byebug-11.1.3/ext/byebug/breakpoint.o +0 -0
- data/vendor/bundle/ruby/2.7.0/gems/byebug-11.1.3/ext/byebug/byebug.o +0 -0
- data/vendor/bundle/ruby/2.7.0/gems/byebug-11.1.3/ext/byebug/byebug.so +0 -0
- data/vendor/bundle/ruby/2.7.0/gems/byebug-11.1.3/ext/byebug/context.o +0 -0
- data/vendor/bundle/ruby/2.7.0/gems/byebug-11.1.3/ext/byebug/locker.o +0 -0
- data/vendor/bundle/ruby/2.7.0/gems/byebug-11.1.3/ext/byebug/threads.o +0 -0
- data/vendor/bundle/ruby/2.7.0/gems/byebug-11.1.3/lib/byebug/byebug.so +0 -0
- data/vendor/bundle/ruby/2.7.0/gems/{faraday-1.0.1 → faraday-1.4.2}/CHANGELOG.md +104 -0
- data/vendor/bundle/ruby/2.7.0/gems/{faraday-1.0.1 → faraday-1.4.2}/LICENSE.md +1 -1
- data/vendor/bundle/ruby/2.7.0/gems/{faraday-1.0.1 → faraday-1.4.2}/README.md +3 -5
- data/vendor/bundle/ruby/2.7.0/gems/{faraday-1.0.1 → faraday-1.4.2}/Rakefile +0 -0
- data/vendor/bundle/ruby/2.7.0/gems/{faraday-1.0.1 → faraday-1.4.2}/examples/client_spec.rb +1 -1
- data/vendor/bundle/ruby/2.7.0/gems/{faraday-1.0.1 → faraday-1.4.2}/examples/client_test.rb +0 -0
- data/vendor/bundle/ruby/2.7.0/gems/{faraday-1.0.1 → faraday-1.4.2}/lib/faraday.rb +55 -41
- data/vendor/bundle/ruby/2.7.0/gems/{faraday-1.0.1 → faraday-1.4.2}/lib/faraday/adapter.rb +1 -8
- data/vendor/bundle/ruby/2.7.0/gems/{faraday-1.0.1 → faraday-1.4.2}/lib/faraday/adapter/httpclient.rb +0 -0
- data/vendor/bundle/ruby/2.7.0/gems/{faraday-1.0.1 → faraday-1.4.2}/lib/faraday/adapter/patron.rb +0 -0
- data/vendor/bundle/ruby/2.7.0/gems/{faraday-1.0.1 → faraday-1.4.2}/lib/faraday/adapter/rack.rb +0 -0
- data/vendor/bundle/ruby/2.7.0/gems/{faraday-1.0.1 → faraday-1.4.2}/lib/faraday/adapter/test.rb +0 -0
- data/vendor/bundle/ruby/2.7.0/gems/{faraday-1.0.1 → faraday-1.4.2}/lib/faraday/adapter/typhoeus.rb +0 -0
- data/vendor/bundle/ruby/2.7.0/gems/{faraday-1.0.1 → faraday-1.4.2}/lib/faraday/adapter_registry.rb +0 -0
- data/vendor/bundle/ruby/2.7.0/gems/{faraday-1.0.1 → faraday-1.4.2}/lib/faraday/autoload.rb +1 -6
- data/vendor/bundle/ruby/2.7.0/gems/{faraday-1.0.1 → faraday-1.4.2}/lib/faraday/connection.rb +11 -4
- data/vendor/bundle/ruby/2.7.0/gems/{faraday-1.0.1 → faraday-1.4.2}/lib/faraday/dependency_loader.rb +0 -0
- data/vendor/bundle/ruby/2.7.0/gems/{faraday-1.0.1 → faraday-1.4.2}/lib/faraday/encoders/flat_params_encoder.rb +9 -2
- data/vendor/bundle/ruby/2.7.0/gems/{faraday-1.0.1 → faraday-1.4.2}/lib/faraday/encoders/nested_params_encoder.rb +7 -2
- data/vendor/bundle/ruby/2.7.0/gems/{faraday-1.0.1 → faraday-1.4.2}/lib/faraday/error.rb +20 -0
- data/vendor/bundle/ruby/2.7.0/gems/{faraday-1.0.1 → faraday-1.4.2}/lib/faraday/file_part.rb +0 -0
- data/vendor/bundle/ruby/2.7.0/gems/{faraday-1.0.1 → faraday-1.4.2}/lib/faraday/logging/formatter.rb +0 -0
- data/vendor/bundle/ruby/2.7.0/gems/faraday-1.4.2/lib/faraday/methods.rb +6 -0
- data/vendor/bundle/ruby/2.7.0/gems/faraday-1.4.2/lib/faraday/middleware.rb +31 -0
- data/vendor/bundle/ruby/2.7.0/gems/{faraday-1.0.1 → faraday-1.4.2}/lib/faraday/middleware_registry.rb +0 -0
- data/vendor/bundle/ruby/2.7.0/gems/{faraday-1.0.1 → faraday-1.4.2}/lib/faraday/options.rb +4 -8
- data/vendor/bundle/ruby/2.7.0/gems/{faraday-1.0.1 → faraday-1.4.2}/lib/faraday/options/connection_options.rb +0 -0
- data/vendor/bundle/ruby/2.7.0/gems/{faraday-1.0.1 → faraday-1.4.2}/lib/faraday/options/env.rb +0 -0
- data/vendor/bundle/ruby/2.7.0/gems/{faraday-1.0.1 → faraday-1.4.2}/lib/faraday/options/proxy_options.rb +4 -0
- data/vendor/bundle/ruby/2.7.0/gems/{faraday-1.0.1 → faraday-1.4.2}/lib/faraday/options/request_options.rb +0 -0
- data/vendor/bundle/ruby/2.7.0/gems/{faraday-1.0.1 → faraday-1.4.2}/lib/faraday/options/ssl_options.rb +0 -0
- data/vendor/bundle/ruby/2.7.0/gems/{faraday-1.0.1 → faraday-1.4.2}/lib/faraday/param_part.rb +0 -0
- data/vendor/bundle/ruby/2.7.0/gems/{faraday-1.0.1 → faraday-1.4.2}/lib/faraday/parameters.rb +0 -0
- data/vendor/bundle/ruby/2.7.0/gems/{faraday-1.0.1 → faraday-1.4.2}/lib/faraday/rack_builder.rb +13 -12
- data/vendor/bundle/ruby/2.7.0/gems/{faraday-1.0.1 → faraday-1.4.2}/lib/faraday/request.rb +20 -10
- data/vendor/bundle/ruby/2.7.0/gems/{faraday-1.0.1 → faraday-1.4.2}/lib/faraday/request/authorization.rb +0 -0
- data/vendor/bundle/ruby/2.7.0/gems/{faraday-1.0.1 → faraday-1.4.2}/lib/faraday/request/basic_authentication.rb +0 -0
- data/vendor/bundle/ruby/2.7.0/gems/{faraday-1.0.1 → faraday-1.4.2}/lib/faraday/request/instrumentation.rb +0 -0
- data/vendor/bundle/ruby/2.7.0/gems/{faraday-1.0.1 → faraday-1.4.2}/lib/faraday/request/multipart.rb +9 -2
- data/vendor/bundle/ruby/2.7.0/gems/{faraday-1.0.1 → faraday-1.4.2}/lib/faraday/request/retry.rb +2 -2
- data/vendor/bundle/ruby/2.7.0/gems/{faraday-1.0.1 → faraday-1.4.2}/lib/faraday/request/token_authentication.rb +0 -0
- data/vendor/bundle/ruby/2.7.0/gems/{faraday-1.0.1 → faraday-1.4.2}/lib/faraday/request/url_encoded.rb +0 -0
- data/vendor/bundle/ruby/2.7.0/gems/{faraday-1.0.1 → faraday-1.4.2}/lib/faraday/response.rb +0 -6
- data/vendor/bundle/ruby/2.7.0/gems/{faraday-1.0.1 → faraday-1.4.2}/lib/faraday/response/logger.rb +0 -0
- data/vendor/bundle/ruby/2.7.0/gems/{faraday-1.0.1 → faraday-1.4.2}/lib/faraday/response/raise_error.rb +12 -1
- data/vendor/bundle/ruby/2.7.0/gems/{faraday-1.0.1 → faraday-1.4.2}/lib/faraday/utils.rb +2 -2
- data/vendor/bundle/ruby/2.7.0/gems/{faraday-1.0.1 → faraday-1.4.2}/lib/faraday/utils/headers.rb +2 -2
- data/vendor/bundle/ruby/2.7.0/gems/{faraday-1.0.1 → faraday-1.4.2}/lib/faraday/utils/params_hash.rb +0 -0
- data/vendor/bundle/ruby/2.7.0/gems/faraday-1.4.2/lib/faraday/version.rb +5 -0
- data/vendor/bundle/ruby/2.7.0/gems/{faraday-1.0.1 → faraday-1.4.2}/spec/external_adapters/faraday_specs_setup.rb +0 -0
- data/vendor/bundle/ruby/2.7.0/gems/{faraday-1.0.1 → faraday-1.4.2}/spec/faraday/adapter/em_http_spec.rb +0 -0
- data/vendor/bundle/ruby/2.7.0/gems/{faraday-1.0.1 → faraday-1.4.2}/spec/faraday/adapter/em_synchrony_spec.rb +0 -0
- data/vendor/bundle/ruby/2.7.0/gems/{faraday-1.0.1 → faraday-1.4.2}/spec/faraday/adapter/excon_spec.rb +0 -0
- data/vendor/bundle/ruby/2.7.0/gems/{faraday-1.0.1 → faraday-1.4.2}/spec/faraday/adapter/httpclient_spec.rb +0 -0
- data/vendor/bundle/ruby/2.7.0/gems/{faraday-1.0.1 → faraday-1.4.2}/spec/faraday/adapter/net_http_spec.rb +0 -0
- data/vendor/bundle/ruby/2.7.0/gems/{faraday-1.0.1 → faraday-1.4.2}/spec/faraday/adapter/patron_spec.rb +0 -0
- data/vendor/bundle/ruby/2.7.0/gems/{faraday-1.0.1 → faraday-1.4.2}/spec/faraday/adapter/rack_spec.rb +0 -0
- data/vendor/bundle/ruby/2.7.0/gems/faraday-1.4.2/spec/faraday/adapter/test_spec.rb +260 -0
- data/vendor/bundle/ruby/2.7.0/gems/{faraday-1.0.1 → faraday-1.4.2}/spec/faraday/adapter/typhoeus_spec.rb +0 -0
- data/vendor/bundle/ruby/2.7.0/gems/{faraday-1.0.1 → faraday-1.4.2}/spec/faraday/adapter_registry_spec.rb +0 -0
- data/vendor/bundle/ruby/2.7.0/gems/{faraday-1.0.1 → faraday-1.4.2}/spec/faraday/adapter_spec.rb +0 -0
- data/vendor/bundle/ruby/2.7.0/gems/{faraday-1.0.1 → faraday-1.4.2}/spec/faraday/composite_read_io_spec.rb +0 -0
- data/vendor/bundle/ruby/2.7.0/gems/{faraday-1.0.1 → faraday-1.4.2}/spec/faraday/connection_spec.rb +38 -0
- data/vendor/bundle/ruby/2.7.0/gems/{faraday-1.0.1 → faraday-1.4.2}/spec/faraday/error_spec.rb +15 -0
- data/vendor/bundle/ruby/2.7.0/gems/faraday-1.4.2/spec/faraday/middleware_spec.rb +52 -0
- data/vendor/bundle/ruby/2.7.0/gems/{faraday-1.0.1 → faraday-1.4.2}/spec/faraday/options/env_spec.rb +0 -0
- data/vendor/bundle/ruby/2.7.0/gems/{faraday-1.0.1 → faraday-1.4.2}/spec/faraday/options/options_spec.rb +0 -0
- data/vendor/bundle/ruby/2.7.0/gems/{faraday-1.0.1 → faraday-1.4.2}/spec/faraday/options/proxy_options_spec.rb +7 -0
- data/vendor/bundle/ruby/2.7.0/gems/{faraday-1.0.1 → faraday-1.4.2}/spec/faraday/options/request_options_spec.rb +0 -0
- data/vendor/bundle/ruby/2.7.0/gems/{faraday-1.0.1 → faraday-1.4.2}/spec/faraday/params_encoders/flat_spec.rb +8 -0
- data/vendor/bundle/ruby/2.7.0/gems/{faraday-1.0.1 → faraday-1.4.2}/spec/faraday/params_encoders/nested_spec.rb +8 -0
- data/vendor/bundle/ruby/2.7.0/gems/{faraday-1.0.1 → faraday-1.4.2}/spec/faraday/rack_builder_spec.rb +149 -0
- data/vendor/bundle/ruby/2.7.0/gems/{faraday-1.0.1 → faraday-1.4.2}/spec/faraday/request/authorization_spec.rb +2 -2
- data/vendor/bundle/ruby/2.7.0/gems/{faraday-1.0.1 → faraday-1.4.2}/spec/faraday/request/instrumentation_spec.rb +0 -0
- data/vendor/bundle/ruby/2.7.0/gems/{faraday-1.0.1 → faraday-1.4.2}/spec/faraday/request/multipart_spec.rb +41 -13
- data/vendor/bundle/ruby/2.7.0/gems/{faraday-1.0.1 → faraday-1.4.2}/spec/faraday/request/retry_spec.rb +1 -1
- data/vendor/bundle/ruby/2.7.0/gems/{faraday-1.0.1 → faraday-1.4.2}/spec/faraday/request/url_encoded_spec.rb +0 -0
- data/vendor/bundle/ruby/2.7.0/gems/{faraday-1.0.1 → faraday-1.4.2}/spec/faraday/request_spec.rb +16 -5
- data/vendor/bundle/ruby/2.7.0/gems/{faraday-1.0.1 → faraday-1.4.2}/spec/faraday/response/logger_spec.rb +0 -0
- data/vendor/bundle/ruby/2.7.0/gems/{faraday-1.0.1 → faraday-1.4.2}/spec/faraday/response/middleware_spec.rb +0 -0
- data/vendor/bundle/ruby/2.7.0/gems/{faraday-1.0.1 → faraday-1.4.2}/spec/faraday/response/raise_error_spec.rb +63 -0
- data/vendor/bundle/ruby/2.7.0/gems/{faraday-1.0.1 → faraday-1.4.2}/spec/faraday/response_spec.rb +0 -0
- data/vendor/bundle/ruby/2.7.0/gems/{faraday-1.0.1 → faraday-1.4.2}/spec/faraday/utils/headers_spec.rb +0 -0
- data/vendor/bundle/ruby/2.7.0/gems/{faraday-1.0.1 → faraday-1.4.2}/spec/faraday/utils_spec.rb +0 -0
- data/vendor/bundle/ruby/2.7.0/gems/{faraday-1.0.1 → faraday-1.4.2}/spec/faraday_spec.rb +0 -0
- data/vendor/bundle/ruby/2.7.0/gems/{faraday-1.0.1 → faraday-1.4.2}/spec/spec_helper.rb +0 -0
- data/vendor/bundle/ruby/2.7.0/gems/{faraday-1.0.1 → faraday-1.4.2}/spec/support/disabling_stub.rb +0 -0
- data/vendor/bundle/ruby/2.7.0/gems/{faraday-1.0.1 → faraday-1.4.2}/spec/support/fake_safe_buffer.rb +0 -0
- data/vendor/bundle/ruby/2.7.0/gems/{faraday-1.0.1 → faraday-1.4.2}/spec/support/helper_methods.rb +0 -0
- data/vendor/bundle/ruby/2.7.0/gems/{faraday-1.0.1 → faraday-1.4.2}/spec/support/shared_examples/adapter.rb +2 -1
- data/vendor/bundle/ruby/2.7.0/gems/{faraday-1.0.1 → faraday-1.4.2}/spec/support/shared_examples/params_encoder.rb +0 -0
- data/vendor/bundle/ruby/2.7.0/gems/{faraday-1.0.1 → faraday-1.4.2}/spec/support/shared_examples/request_method.rb +39 -11
- data/vendor/bundle/ruby/2.7.0/gems/{faraday-1.0.1 → faraday-1.4.2}/spec/support/streaming_response_checker.rb +0 -0
- data/vendor/bundle/ruby/2.7.0/gems/{faraday-1.0.1 → faraday-1.4.2}/spec/support/webmock_rack_app.rb +0 -0
- data/vendor/bundle/ruby/2.7.0/gems/faraday-em_http-1.0.0/LICENSE.md +21 -0
- data/vendor/bundle/ruby/2.7.0/gems/faraday-em_http-1.0.0/README.md +61 -0
- data/vendor/bundle/ruby/2.7.0/gems/{faraday-1.0.1 → faraday-em_http-1.0.0}/lib/faraday/adapter/em_http.rb +23 -20
- data/vendor/bundle/ruby/2.7.0/gems/{faraday-1.0.1 → faraday-em_http-1.0.0}/lib/faraday/adapter/em_http_ssl_patch.rb +0 -0
- data/vendor/bundle/ruby/2.7.0/gems/faraday-em_http-1.0.0/lib/faraday/em_http.rb +11 -0
- data/vendor/bundle/ruby/2.7.0/gems/faraday-em_http-1.0.0/lib/faraday/em_http/version.rb +7 -0
- data/vendor/bundle/ruby/2.7.0/gems/faraday-em_synchrony-1.0.0/LICENSE.md +21 -0
- data/vendor/bundle/ruby/2.7.0/gems/faraday-em_synchrony-1.0.0/README.md +65 -0
- data/vendor/bundle/ruby/2.7.0/gems/{faraday-1.0.1 → faraday-em_synchrony-1.0.0}/lib/faraday/adapter/em_synchrony.rb +16 -13
- data/vendor/bundle/ruby/2.7.0/gems/{faraday-1.0.1 → faraday-em_synchrony-1.0.0}/lib/faraday/adapter/em_synchrony/parallel_manager.rb +0 -0
- data/vendor/bundle/ruby/2.7.0/gems/faraday-em_synchrony-1.0.0/lib/faraday/em_synchrony.rb +12 -0
- data/vendor/bundle/ruby/2.7.0/gems/faraday-em_synchrony-1.0.0/lib/faraday/em_synchrony/version.rb +7 -0
- data/vendor/bundle/ruby/2.7.0/gems/faraday-excon-1.1.0/LICENSE.md +21 -0
- data/vendor/bundle/ruby/2.7.0/gems/faraday-excon-1.1.0/README.md +61 -0
- data/vendor/bundle/ruby/2.7.0/gems/{faraday-1.0.1 → faraday-excon-1.1.0}/lib/faraday/adapter/excon.rb +2 -2
- data/vendor/bundle/ruby/2.7.0/gems/faraday-excon-1.1.0/lib/faraday/excon.rb +11 -0
- data/vendor/bundle/ruby/2.7.0/gems/faraday-excon-1.1.0/lib/faraday/excon/version.rb +7 -0
- data/vendor/bundle/ruby/2.7.0/gems/faraday-net_http-1.0.1/LICENSE.md +21 -0
- data/vendor/bundle/ruby/2.7.0/gems/faraday-net_http-1.0.1/README.md +57 -0
- data/vendor/bundle/ruby/2.7.0/gems/{faraday-1.0.1 → faraday-net_http-1.0.1}/lib/faraday/adapter/net_http.rb +21 -27
- data/vendor/bundle/ruby/2.7.0/gems/faraday-net_http-1.0.1/lib/faraday/net_http.rb +10 -0
- data/vendor/bundle/ruby/2.7.0/gems/faraday-net_http-1.0.1/lib/faraday/net_http/version.rb +7 -0
- data/vendor/bundle/ruby/2.7.0/gems/faraday-net_http_persistent-1.1.0/LICENSE.md +21 -0
- data/vendor/bundle/ruby/2.7.0/gems/faraday-net_http_persistent-1.1.0/README.md +73 -0
- data/vendor/bundle/ruby/2.7.0/gems/{faraday-1.0.1 → faraday-net_http_persistent-1.1.0}/lib/faraday/adapter/net_http_persistent.rb +11 -11
- data/vendor/bundle/ruby/2.7.0/gems/faraday-net_http_persistent-1.1.0/lib/faraday/net_http_persistent.rb +17 -0
- data/vendor/bundle/ruby/2.7.0/gems/faraday-net_http_persistent-1.1.0/lib/faraday/net_http_persistent/version.rb +7 -0
- data/vendor/bundle/ruby/2.7.0/gems/jaro_winkler-1.5.4/ext/jaro_winkler/Makefile +14 -14
- data/vendor/bundle/ruby/2.7.0/gems/jaro_winkler-1.5.4/ext/jaro_winkler/adj_matrix.o +0 -0
- data/vendor/bundle/ruby/2.7.0/gems/jaro_winkler-1.5.4/ext/jaro_winkler/codepoints.o +0 -0
- data/vendor/bundle/ruby/2.7.0/gems/jaro_winkler-1.5.4/ext/jaro_winkler/jaro.o +0 -0
- data/vendor/bundle/ruby/2.7.0/gems/jaro_winkler-1.5.4/ext/jaro_winkler/jaro_winkler.o +0 -0
- data/vendor/bundle/ruby/2.7.0/gems/jaro_winkler-1.5.4/ext/jaro_winkler/jaro_winkler_ext.so +0 -0
- data/vendor/bundle/ruby/2.7.0/gems/jaro_winkler-1.5.4/lib/jaro_winkler/jaro_winkler_ext.so +0 -0
- data/vendor/bundle/ruby/2.7.0/gems/psych-3.2.0/ext/psych/Makefile +14 -14
- data/vendor/bundle/ruby/2.7.0/gems/psych-3.2.0/ext/psych/api.o +0 -0
- data/vendor/bundle/ruby/2.7.0/gems/psych-3.2.0/ext/psych/dumper.o +0 -0
- data/vendor/bundle/ruby/2.7.0/gems/psych-3.2.0/ext/psych/emitter.o +0 -0
- data/vendor/bundle/ruby/2.7.0/gems/psych-3.2.0/ext/psych/loader.o +0 -0
- data/vendor/bundle/ruby/2.7.0/gems/psych-3.2.0/ext/psych/parser.o +0 -0
- data/vendor/bundle/ruby/2.7.0/gems/psych-3.2.0/ext/psych/psych.o +0 -0
- data/vendor/bundle/ruby/2.7.0/gems/psych-3.2.0/ext/psych/psych_emitter.o +0 -0
- data/vendor/bundle/ruby/2.7.0/gems/psych-3.2.0/ext/psych/psych_parser.o +0 -0
- data/vendor/bundle/ruby/2.7.0/gems/psych-3.2.0/ext/psych/psych_to_ruby.o +0 -0
- data/vendor/bundle/ruby/2.7.0/gems/psych-3.2.0/ext/psych/psych_yaml_tree.o +0 -0
- data/vendor/bundle/ruby/2.7.0/gems/psych-3.2.0/ext/psych/reader.o +0 -0
- data/vendor/bundle/ruby/2.7.0/gems/psych-3.2.0/ext/psych/scanner.o +0 -0
- data/vendor/bundle/ruby/2.7.0/gems/psych-3.2.0/ext/psych/writer.o +0 -0
- data/vendor/bundle/ruby/2.7.0/gems/ruby2_keywords-0.0.4/LICENSE +22 -0
- data/vendor/bundle/ruby/2.7.0/gems/ruby2_keywords-0.0.4/README.md +67 -0
- data/vendor/bundle/ruby/2.7.0/gems/ruby2_keywords-0.0.4/lib/ruby2_keywords.rb +57 -0
- data/vendor/bundle/ruby/2.7.0/specifications/ast-2.4.1.gemspec +2 -2
- data/vendor/bundle/ruby/2.7.0/specifications/byebug-11.1.3.gemspec +2 -2
- data/vendor/bundle/ruby/2.7.0/specifications/coderay-1.1.3.gemspec +2 -2
- data/vendor/bundle/ruby/2.7.0/specifications/diff-lcs-1.4.4.gemspec +2 -2
- data/vendor/bundle/ruby/2.7.0/specifications/faraday-1.4.2.gemspec +0 -0
- data/vendor/bundle/ruby/2.7.0/specifications/faraday-em_http-1.0.0.gemspec +52 -0
- data/vendor/bundle/ruby/2.7.0/specifications/faraday-em_synchrony-1.0.0.gemspec +56 -0
- data/vendor/bundle/ruby/2.7.0/specifications/faraday-excon-1.1.0.gemspec +52 -0
- data/vendor/bundle/ruby/2.7.0/specifications/faraday-net_http-1.0.1.gemspec +50 -0
- data/vendor/bundle/ruby/2.7.0/specifications/faraday-net_http_persistent-1.1.0.gemspec +48 -0
- data/vendor/bundle/ruby/2.7.0/specifications/jaro_winkler-1.5.4.gemspec +2 -2
- data/vendor/bundle/ruby/2.7.0/specifications/method_source-1.0.0.gemspec +2 -2
- data/vendor/bundle/ruby/2.7.0/specifications/multipart-post-2.1.1.gemspec +2 -2
- data/vendor/bundle/ruby/2.7.0/specifications/parallel-1.19.2.gemspec +2 -2
- data/vendor/bundle/ruby/2.7.0/specifications/parser-2.7.1.4.gemspec +2 -2
- data/vendor/bundle/ruby/2.7.0/specifications/pry-0.13.1.gemspec +2 -2
- data/vendor/bundle/ruby/2.7.0/specifications/pry-byebug-3.9.0.gemspec +2 -2
- data/vendor/bundle/ruby/2.7.0/specifications/psych-3.2.0.gemspec +2 -2
- data/vendor/bundle/ruby/2.7.0/specifications/rainbow-3.0.0.gemspec +2 -2
- data/vendor/bundle/ruby/2.7.0/specifications/rake-13.0.1.gemspec +2 -2
- data/vendor/bundle/ruby/2.7.0/specifications/rspec-3.9.0.gemspec +2 -2
- data/vendor/bundle/ruby/2.7.0/specifications/rspec-core-3.9.2.gemspec +2 -2
- data/vendor/bundle/ruby/2.7.0/specifications/rspec-expectations-3.9.2.gemspec +2 -2
- data/vendor/bundle/ruby/2.7.0/specifications/rspec-mocks-3.9.1.gemspec +2 -2
- data/vendor/bundle/ruby/2.7.0/specifications/rspec-support-3.9.3.gemspec +2 -2
- data/vendor/bundle/ruby/2.7.0/specifications/rubocop-0.66.0.gemspec +2 -2
- data/vendor/bundle/ruby/2.7.0/specifications/ruby-progressbar-1.10.1.gemspec +2 -2
- data/vendor/bundle/ruby/2.7.0/specifications/ruby2_keywords-0.0.4.gemspec +19 -0
- data/vendor/bundle/ruby/2.7.0/specifications/unicode-display_width-1.5.0.gemspec +2 -2
- data/walkthrough.md +1 -1
- metadata +172 -125
- data/vendor/bundle/ruby/2.7.0/cache/faraday-1.0.1.gem +0 -0
- data/vendor/bundle/ruby/2.7.0/extensions/x86_64-linux/2.7.0-static/byebug-11.1.3/byebug/byebug.so +0 -0
- data/vendor/bundle/ruby/2.7.0/extensions/x86_64-linux/2.7.0-static/jaro_winkler-1.5.4/gem_make.out +0 -64
- data/vendor/bundle/ruby/2.7.0/extensions/x86_64-linux/2.7.0-static/jaro_winkler-1.5.4/jaro_winkler/jaro_winkler_ext.so +0 -0
- data/vendor/bundle/ruby/2.7.0/extensions/x86_64-linux/2.7.0-static/psych-3.2.0/mkmf.log +0 -197
- data/vendor/bundle/ruby/2.7.0/extensions/x86_64-linux/2.7.0-static/psych-3.2.0/psych.so +0 -0
- data/vendor/bundle/ruby/2.7.0/gems/faraday-1.0.1/lib/faraday/middleware.rb +0 -21
- data/vendor/bundle/ruby/2.7.0/gems/faraday-1.0.1/spec/faraday/adapter/net_http_persistent_spec.rb +0 -57
- data/vendor/bundle/ruby/2.7.0/gems/faraday-1.0.1/spec/faraday/middleware_spec.rb +0 -26
- data/vendor/bundle/ruby/2.7.0/specifications/faraday-1.0.1.gemspec +0 -0
data/vendor/bundle/ruby/2.7.0/gems/{faraday-1.0.1 → faraday-1.4.2}/spec/faraday/options/env_spec.rb
RENAMED
File without changes
|
File without changes
|
@@ -14,6 +14,13 @@ RSpec.describe Faraday::ProxyOptions do
|
|
14
14
|
expect(options.inspect).to match('#<Faraday::ProxyOptions uri=')
|
15
15
|
end
|
16
16
|
|
17
|
+
it 'defaults to http' do
|
18
|
+
options = Faraday::ProxyOptions.from 'example.org'
|
19
|
+
expect(options.port).to eq(80)
|
20
|
+
expect(options.host).to eq('example.org')
|
21
|
+
expect(options.scheme).to eq('http')
|
22
|
+
end
|
23
|
+
|
17
24
|
it 'works with nil' do
|
18
25
|
options = Faraday::ProxyOptions.from nil
|
19
26
|
expect(options).to be_a_kind_of(Faraday::ProxyOptions)
|
File without changes
|
@@ -31,4 +31,12 @@ RSpec.describe Faraday::FlatParamsEncoder do
|
|
31
31
|
params = { a: [] }
|
32
32
|
expect(subject.encode(params)).to eq('a=')
|
33
33
|
end
|
34
|
+
|
35
|
+
it 'encodes unsorted when asked' do
|
36
|
+
params = { b: false, a: true }
|
37
|
+
expect(subject.encode(params)).to eq('a=true&b=false')
|
38
|
+
Faraday::FlatParamsEncoder.sort_params = false
|
39
|
+
expect(subject.encode(params)).to eq('b=false&a=true')
|
40
|
+
Faraday::FlatParamsEncoder.sort_params = true
|
41
|
+
end
|
34
42
|
end
|
@@ -94,6 +94,14 @@ RSpec.describe Faraday::NestedParamsEncoder do
|
|
94
94
|
expect(subject.encode(params)).to eq('a%5B%5D=true&a%5B%5D=false')
|
95
95
|
end
|
96
96
|
|
97
|
+
it 'encodes unsorted when asked' do
|
98
|
+
params = { b: false, a: true }
|
99
|
+
expect(subject.encode(params)).to eq('a=true&b=false')
|
100
|
+
Faraday::NestedParamsEncoder.sort_params = false
|
101
|
+
expect(subject.encode(params)).to eq('b=false&a=true')
|
102
|
+
Faraday::NestedParamsEncoder.sort_params = true
|
103
|
+
end
|
104
|
+
|
97
105
|
shared_examples 'a wrong decoding' do
|
98
106
|
it do
|
99
107
|
expect { subject.decode(query) }.to raise_error(TypeError) do |e|
|
data/vendor/bundle/ruby/2.7.0/gems/{faraday-1.0.1 → faraday-1.4.2}/spec/faraday/rack_builder_spec.rb
RENAMED
@@ -193,4 +193,153 @@ RSpec.describe Faraday::RackBuilder do
|
|
193
193
|
end
|
194
194
|
end
|
195
195
|
end
|
196
|
+
|
197
|
+
context 'when middleware is added with named arguments' do
|
198
|
+
let(:conn) { Faraday::Connection.new {} }
|
199
|
+
|
200
|
+
let(:dog_middleware) do
|
201
|
+
Class.new(Faraday::Middleware) do
|
202
|
+
attr_accessor :name
|
203
|
+
|
204
|
+
def initialize(app, name:)
|
205
|
+
super(app)
|
206
|
+
@name = name
|
207
|
+
end
|
208
|
+
end
|
209
|
+
end
|
210
|
+
let(:dog) do
|
211
|
+
subject.handlers.find { |handler| handler == dog_middleware }.build
|
212
|
+
end
|
213
|
+
|
214
|
+
it 'adds a handler to construct middleware with options passed to use' do
|
215
|
+
subject.use dog_middleware, name: 'Rex'
|
216
|
+
expect { dog }.to_not output(
|
217
|
+
/warning: Using the last argument as keyword parameters is deprecated/
|
218
|
+
).to_stderr
|
219
|
+
expect(dog.name).to eq('Rex')
|
220
|
+
end
|
221
|
+
end
|
222
|
+
|
223
|
+
context 'when a request adapter is added with named arguments' do
|
224
|
+
let(:conn) { Faraday::Connection.new {} }
|
225
|
+
|
226
|
+
let(:cat_request) do
|
227
|
+
Class.new(Faraday::Middleware) do
|
228
|
+
attr_accessor :name
|
229
|
+
|
230
|
+
def initialize(app, name:)
|
231
|
+
super(app)
|
232
|
+
@name = name
|
233
|
+
end
|
234
|
+
end
|
235
|
+
end
|
236
|
+
let(:cat) do
|
237
|
+
subject.handlers.find { |handler| handler == cat_request }.build
|
238
|
+
end
|
239
|
+
|
240
|
+
it 'adds a handler to construct request adapter with options passed to request' do
|
241
|
+
Faraday::Request.register_middleware cat_request: cat_request
|
242
|
+
subject.request :cat_request, name: 'Felix'
|
243
|
+
expect { cat }.to_not output(
|
244
|
+
/warning: Using the last argument as keyword parameters is deprecated/
|
245
|
+
).to_stderr
|
246
|
+
expect(cat.name).to eq('Felix')
|
247
|
+
end
|
248
|
+
end
|
249
|
+
|
250
|
+
context 'when a response adapter is added with named arguments' do
|
251
|
+
let(:conn) { Faraday::Connection.new {} }
|
252
|
+
|
253
|
+
let(:fish_response) do
|
254
|
+
Class.new(Faraday::Response::Middleware) do
|
255
|
+
attr_accessor :name
|
256
|
+
|
257
|
+
def initialize(app, name:)
|
258
|
+
super(app)
|
259
|
+
@name = name
|
260
|
+
end
|
261
|
+
end
|
262
|
+
end
|
263
|
+
let(:fish) do
|
264
|
+
subject.handlers.find { |handler| handler == fish_response }.build
|
265
|
+
end
|
266
|
+
|
267
|
+
it 'adds a handler to construct response adapter with options passed to response' do
|
268
|
+
Faraday::Response.register_middleware fish_response: fish_response
|
269
|
+
subject.response :fish_response, name: 'Bubbles'
|
270
|
+
expect { fish }.to_not output(
|
271
|
+
/warning: Using the last argument as keyword parameters is deprecated/
|
272
|
+
).to_stderr
|
273
|
+
expect(fish.name).to eq('Bubbles')
|
274
|
+
end
|
275
|
+
end
|
276
|
+
|
277
|
+
context 'when a plain adapter is added with named arguments' do
|
278
|
+
let(:conn) { Faraday::Connection.new {} }
|
279
|
+
|
280
|
+
let(:rabbit_adapter) do
|
281
|
+
Class.new(Faraday::Adapter) do
|
282
|
+
attr_accessor :name
|
283
|
+
|
284
|
+
def initialize(app, name:)
|
285
|
+
super(app)
|
286
|
+
@name = name
|
287
|
+
end
|
288
|
+
end
|
289
|
+
end
|
290
|
+
let(:rabbit) do
|
291
|
+
subject.adapter.build
|
292
|
+
end
|
293
|
+
|
294
|
+
it 'adds a handler to construct adapter with options passed to adapter' do
|
295
|
+
Faraday::Adapter.register_middleware rabbit_adapter: rabbit_adapter
|
296
|
+
subject.adapter :rabbit_adapter, name: 'Thumper'
|
297
|
+
expect { rabbit }.to_not output(
|
298
|
+
/warning: Using the last argument as keyword parameters is deprecated/
|
299
|
+
).to_stderr
|
300
|
+
expect(rabbit.name).to eq('Thumper')
|
301
|
+
end
|
302
|
+
end
|
303
|
+
|
304
|
+
context 'when handlers are directly added or updated' do
|
305
|
+
let(:conn) { Faraday::Connection.new {} }
|
306
|
+
|
307
|
+
let(:rock_handler) do
|
308
|
+
Class.new do
|
309
|
+
attr_accessor :name
|
310
|
+
|
311
|
+
def initialize(_app, name:)
|
312
|
+
@name = name
|
313
|
+
end
|
314
|
+
end
|
315
|
+
end
|
316
|
+
let(:rock) do
|
317
|
+
subject.handlers.find { |handler| handler == rock_handler }.build
|
318
|
+
end
|
319
|
+
|
320
|
+
it 'adds a handler to construct adapter with options passed to insert' do
|
321
|
+
subject.insert 0, rock_handler, name: 'Stony'
|
322
|
+
expect { rock }.to_not output(
|
323
|
+
/warning: Using the last argument as keyword parameters is deprecated/
|
324
|
+
).to_stderr
|
325
|
+
expect(rock.name).to eq('Stony')
|
326
|
+
end
|
327
|
+
|
328
|
+
it 'adds a handler with options passed to insert_after' do
|
329
|
+
subject.insert_after 0, rock_handler, name: 'Rocky'
|
330
|
+
expect { rock }.to_not output(
|
331
|
+
/warning: Using the last argument as keyword parameters is deprecated/
|
332
|
+
).to_stderr
|
333
|
+
expect(rock.name).to eq('Rocky')
|
334
|
+
end
|
335
|
+
|
336
|
+
it 'adds a handler with options passed to swap' do
|
337
|
+
subject.insert 0, rock_handler, name: 'Flint'
|
338
|
+
subject.swap 0, rock_handler, name: 'Chert'
|
339
|
+
expect { rock }.to_not output(
|
340
|
+
/warning: Using the last argument as keyword parameters is deprecated/
|
341
|
+
).to_stderr
|
342
|
+
expect(rock.name).to eq('Chert')
|
343
|
+
end
|
344
|
+
end
|
196
345
|
end
|
@@ -56,7 +56,7 @@ RSpec.describe Faraday::Request::Authorization do
|
|
56
56
|
end
|
57
57
|
|
58
58
|
context 'when other values are provided' do
|
59
|
-
let(:auth_config) { ['baz', foo: 42] }
|
59
|
+
let(:auth_config) { ['baz', { foo: 42 }] }
|
60
60
|
|
61
61
|
it { expect(response.body).to match(/^Token /) }
|
62
62
|
it { expect(response.body).to match(/token="baz"/) }
|
@@ -78,7 +78,7 @@ RSpec.describe Faraday::Request::Authorization do
|
|
78
78
|
end
|
79
79
|
|
80
80
|
context 'when passed a string and a hash' do
|
81
|
-
let(:auth_config) { ['baz', foo: 42] }
|
81
|
+
let(:auth_config) { ['baz', { foo: 42 }] }
|
82
82
|
|
83
83
|
it { expect(response.body).to eq('baz foo="42"') }
|
84
84
|
|
File without changes
|
@@ -1,9 +1,10 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
RSpec.describe Faraday::Request::Multipart do
|
4
|
+
let(:options) { {} }
|
4
5
|
let(:conn) do
|
5
6
|
Faraday.new do |b|
|
6
|
-
b.request :multipart
|
7
|
+
b.request :multipart, options
|
7
8
|
b.request :url_encoded
|
8
9
|
b.adapter :test do |stub|
|
9
10
|
stub.post('/echo') do |env|
|
@@ -54,9 +55,10 @@ RSpec.describe Faraday::Request::Multipart do
|
|
54
55
|
part_bc, body_bc = result.part('b[c]')
|
55
56
|
expect(part_bc).to_not be_nil
|
56
57
|
expect(part_bc.filename).to eq('multipart_spec.rb')
|
57
|
-
expect(part_bc.headers['content-disposition'])
|
58
|
-
|
59
|
-
|
58
|
+
expect(part_bc.headers['content-disposition'])
|
59
|
+
.to eq(
|
60
|
+
'form-data; foo=1; name="b[c]"; filename="multipart_spec.rb"'
|
61
|
+
)
|
60
62
|
expect(part_bc.headers['content-type']).to eq('text/x-ruby')
|
61
63
|
expect(part_bc.headers['content-transfer-encoding']).to eq('binary')
|
62
64
|
expect(body_bc).to eq(File.read(__FILE__))
|
@@ -135,9 +137,10 @@ RSpec.describe Faraday::Request::Multipart do
|
|
135
137
|
part_bc, body_bc = result.part('b[][c]')
|
136
138
|
expect(part_bc).to_not be_nil
|
137
139
|
expect(part_bc.filename).to eq('multipart_spec.rb')
|
138
|
-
expect(part_bc.headers['content-disposition'])
|
139
|
-
|
140
|
-
|
140
|
+
expect(part_bc.headers['content-disposition'])
|
141
|
+
.to eq(
|
142
|
+
'form-data; name="b[][c]"; filename="multipart_spec.rb"'
|
143
|
+
)
|
141
144
|
expect(part_bc.headers['content-type']).to eq('text/x-ruby')
|
142
145
|
expect(part_bc.headers['content-transfer-encoding']).to eq('binary')
|
143
146
|
expect(body_bc).to eq(File.read(__FILE__))
|
@@ -177,9 +180,10 @@ RSpec.describe Faraday::Request::Multipart do
|
|
177
180
|
part_bc, body_bc = result.part('b[c]')
|
178
181
|
expect(part_bc).to_not be_nil
|
179
182
|
expect(part_bc.filename).to eq('multipart_spec.rb')
|
180
|
-
expect(part_bc.headers['content-disposition'])
|
181
|
-
|
182
|
-
|
183
|
+
expect(part_bc.headers['content-disposition'])
|
184
|
+
.to eq(
|
185
|
+
'form-data; foo=1; name="b[c]"; filename="multipart_spec.rb"'
|
186
|
+
)
|
183
187
|
expect(part_bc.headers['content-type']).to eq('text/x-ruby')
|
184
188
|
expect(part_bc.headers['content-transfer-encoding']).to eq('binary')
|
185
189
|
expect(body_bc).to eq(File.read(__FILE__))
|
@@ -258,9 +262,10 @@ RSpec.describe Faraday::Request::Multipart do
|
|
258
262
|
part_bc, body_bc = result.part('b[][c]')
|
259
263
|
expect(part_bc).to_not be_nil
|
260
264
|
expect(part_bc.filename).to eq('multipart_spec.rb')
|
261
|
-
expect(part_bc.headers['content-disposition'])
|
262
|
-
|
263
|
-
|
265
|
+
expect(part_bc.headers['content-disposition'])
|
266
|
+
.to eq(
|
267
|
+
'form-data; name="b[][c]"; filename="multipart_spec.rb"'
|
268
|
+
)
|
264
269
|
expect(part_bc.headers['content-type']).to eq('text/x-ruby')
|
265
270
|
expect(part_bc.headers['content-transfer-encoding']).to eq('binary')
|
266
271
|
expect(body_bc).to eq(File.read(__FILE__))
|
@@ -271,4 +276,27 @@ RSpec.describe Faraday::Request::Multipart do
|
|
271
276
|
expect(body_bd).to eq('2')
|
272
277
|
end
|
273
278
|
end
|
279
|
+
|
280
|
+
context 'when passing flat_encode=true option' do
|
281
|
+
let(:options) { { flat_encode: true } }
|
282
|
+
let(:io) { StringIO.new('io-content') }
|
283
|
+
let(:payload) do
|
284
|
+
{
|
285
|
+
a: 1,
|
286
|
+
b: [
|
287
|
+
Faraday::UploadIO.new(io, 'application/pdf'),
|
288
|
+
Faraday::UploadIO.new(io, 'application/pdf')
|
289
|
+
]
|
290
|
+
}
|
291
|
+
end
|
292
|
+
|
293
|
+
it_behaves_like 'a multipart request'
|
294
|
+
|
295
|
+
it 'encode params using flat encoder' do
|
296
|
+
response = conn.post('/echo', payload)
|
297
|
+
|
298
|
+
expect(response.body).to include('name="b"')
|
299
|
+
expect(response.body).not_to include('name="b[]"')
|
300
|
+
end
|
301
|
+
end
|
274
302
|
end
|
@@ -117,7 +117,7 @@ RSpec.describe Faraday::Request::Retry do
|
|
117
117
|
let(:options) { { max: 2, interval: 0.1, interval_randomness: 0.05 } }
|
118
118
|
let(:middleware) { Faraday::Request::Retry.new(nil, options) }
|
119
119
|
|
120
|
-
it { expect(middleware.send(:calculate_retry_interval, 2)).to be_between(0.1, 0.
|
120
|
+
it { expect(middleware.send(:calculate_retry_interval, 2)).to be_between(0.1, 0.105) }
|
121
121
|
end
|
122
122
|
end
|
123
123
|
|
File without changes
|
data/vendor/bundle/ruby/2.7.0/gems/{faraday-1.0.1 → faraday-1.4.2}/spec/faraday/request_spec.rb
RENAMED
@@ -6,20 +6,31 @@ RSpec.describe Faraday::Request do
|
|
6
6
|
headers: { 'Mime-Version' => '1.0' },
|
7
7
|
request: { oauth: { consumer_key: 'anonymous' } })
|
8
8
|
end
|
9
|
-
let(:
|
9
|
+
let(:http_method) { :get }
|
10
10
|
let(:block) { nil }
|
11
11
|
|
12
|
-
subject { conn.build_request(
|
12
|
+
subject { conn.build_request(http_method, &block) }
|
13
13
|
|
14
14
|
context 'when nothing particular is configured' do
|
15
|
-
it { expect(subject.
|
15
|
+
it { expect(subject.http_method).to eq(:get) }
|
16
16
|
it { expect(subject.to_env(conn).ssl.verify).to be_falsey }
|
17
17
|
end
|
18
18
|
|
19
|
-
context 'when method is post' do
|
20
|
-
let(:
|
19
|
+
context 'when HTTP method is post' do
|
20
|
+
let(:http_method) { :post }
|
21
|
+
|
22
|
+
it { expect(subject.http_method).to eq(:post) }
|
23
|
+
end
|
24
|
+
|
25
|
+
describe 'deprecate method for HTTP method' do
|
26
|
+
let(:http_method) { :post }
|
27
|
+
let(:expected_warning) do
|
28
|
+
%r{WARNING: `Faraday::Request#method` is deprecated; use `#http_method` instead. It will be removed in or after version 2.0.\n`Faraday::Request#method` called from .+/spec/faraday/request_spec.rb:\d+.}
|
29
|
+
end
|
21
30
|
|
22
31
|
it { expect(subject.method).to eq(:post) }
|
32
|
+
|
33
|
+
it { expect { subject.method }.to output(expected_warning).to_stderr }
|
23
34
|
end
|
24
35
|
|
25
36
|
context 'when setting the url on setup with a URI' do
|
File without changes
|
File without changes
|
@@ -29,6 +29,9 @@ RSpec.describe Faraday::Response::RaiseError do
|
|
29
29
|
expect(ex.message).to eq('the server responded with status 400')
|
30
30
|
expect(ex.response[:headers]['X-Reason']).to eq('because')
|
31
31
|
expect(ex.response[:status]).to eq(400)
|
32
|
+
expect(ex.response_status).to eq(400)
|
33
|
+
expect(ex.response_body).to eq('keep looking')
|
34
|
+
expect(ex.response_headers['X-Reason']).to eq('because')
|
32
35
|
end
|
33
36
|
end
|
34
37
|
|
@@ -37,6 +40,9 @@ RSpec.describe Faraday::Response::RaiseError do
|
|
37
40
|
expect(ex.message).to eq('the server responded with status 401')
|
38
41
|
expect(ex.response[:headers]['X-Reason']).to eq('because')
|
39
42
|
expect(ex.response[:status]).to eq(401)
|
43
|
+
expect(ex.response_status).to eq(401)
|
44
|
+
expect(ex.response_body).to eq('keep looking')
|
45
|
+
expect(ex.response_headers['X-Reason']).to eq('because')
|
40
46
|
end
|
41
47
|
end
|
42
48
|
|
@@ -45,6 +51,9 @@ RSpec.describe Faraday::Response::RaiseError do
|
|
45
51
|
expect(ex.message).to eq('the server responded with status 403')
|
46
52
|
expect(ex.response[:headers]['X-Reason']).to eq('because')
|
47
53
|
expect(ex.response[:status]).to eq(403)
|
54
|
+
expect(ex.response_status).to eq(403)
|
55
|
+
expect(ex.response_body).to eq('keep looking')
|
56
|
+
expect(ex.response_headers['X-Reason']).to eq('because')
|
48
57
|
end
|
49
58
|
end
|
50
59
|
|
@@ -53,6 +62,9 @@ RSpec.describe Faraday::Response::RaiseError do
|
|
53
62
|
expect(ex.message).to eq('the server responded with status 404')
|
54
63
|
expect(ex.response[:headers]['X-Reason']).to eq('because')
|
55
64
|
expect(ex.response[:status]).to eq(404)
|
65
|
+
expect(ex.response_status).to eq(404)
|
66
|
+
expect(ex.response_body).to eq('keep looking')
|
67
|
+
expect(ex.response_headers['X-Reason']).to eq('because')
|
56
68
|
end
|
57
69
|
end
|
58
70
|
|
@@ -61,6 +73,9 @@ RSpec.describe Faraday::Response::RaiseError do
|
|
61
73
|
expect(ex.message).to eq('407 "Proxy Authentication Required"')
|
62
74
|
expect(ex.response[:headers]['X-Reason']).to eq('because')
|
63
75
|
expect(ex.response[:status]).to eq(407)
|
76
|
+
expect(ex.response_status).to eq(407)
|
77
|
+
expect(ex.response_body).to eq('keep looking')
|
78
|
+
expect(ex.response_headers['X-Reason']).to eq('because')
|
64
79
|
end
|
65
80
|
end
|
66
81
|
|
@@ -69,6 +84,9 @@ RSpec.describe Faraday::Response::RaiseError do
|
|
69
84
|
expect(ex.message).to eq('the server responded with status 409')
|
70
85
|
expect(ex.response[:headers]['X-Reason']).to eq('because')
|
71
86
|
expect(ex.response[:status]).to eq(409)
|
87
|
+
expect(ex.response_status).to eq(409)
|
88
|
+
expect(ex.response_body).to eq('keep looking')
|
89
|
+
expect(ex.response_headers['X-Reason']).to eq('because')
|
72
90
|
end
|
73
91
|
end
|
74
92
|
|
@@ -77,6 +95,9 @@ RSpec.describe Faraday::Response::RaiseError do
|
|
77
95
|
expect(ex.message).to eq('the server responded with status 422')
|
78
96
|
expect(ex.response[:headers]['X-Reason']).to eq('because')
|
79
97
|
expect(ex.response[:status]).to eq(422)
|
98
|
+
expect(ex.response_status).to eq(422)
|
99
|
+
expect(ex.response_body).to eq('keep looking')
|
100
|
+
expect(ex.response_headers['X-Reason']).to eq('because')
|
80
101
|
end
|
81
102
|
end
|
82
103
|
|
@@ -85,6 +106,9 @@ RSpec.describe Faraday::Response::RaiseError do
|
|
85
106
|
expect(ex.message).to eq('http status could not be derived from the server response')
|
86
107
|
expect(ex.response[:headers]['X-Reason']).to eq('nil')
|
87
108
|
expect(ex.response[:status]).to be_nil
|
109
|
+
expect(ex.response_status).to be_nil
|
110
|
+
expect(ex.response_body).to eq('fail')
|
111
|
+
expect(ex.response_headers['X-Reason']).to eq('nil')
|
88
112
|
end
|
89
113
|
end
|
90
114
|
|
@@ -93,6 +117,9 @@ RSpec.describe Faraday::Response::RaiseError do
|
|
93
117
|
expect(ex.message).to eq('the server responded with status 499')
|
94
118
|
expect(ex.response[:headers]['X-Reason']).to eq('because')
|
95
119
|
expect(ex.response[:status]).to eq(499)
|
120
|
+
expect(ex.response_status).to eq(499)
|
121
|
+
expect(ex.response_body).to eq('keep looking')
|
122
|
+
expect(ex.response_headers['X-Reason']).to eq('because')
|
96
123
|
end
|
97
124
|
end
|
98
125
|
|
@@ -101,6 +128,42 @@ RSpec.describe Faraday::Response::RaiseError do
|
|
101
128
|
expect(ex.message).to eq('the server responded with status 500')
|
102
129
|
expect(ex.response[:headers]['X-Error']).to eq('bailout')
|
103
130
|
expect(ex.response[:status]).to eq(500)
|
131
|
+
expect(ex.response_status).to eq(500)
|
132
|
+
expect(ex.response_body).to eq('fail')
|
133
|
+
expect(ex.response_headers['X-Error']).to eq('bailout')
|
134
|
+
end
|
135
|
+
end
|
136
|
+
|
137
|
+
describe 'request info' do
|
138
|
+
let(:conn) do
|
139
|
+
Faraday.new do |b|
|
140
|
+
b.response :raise_error
|
141
|
+
b.adapter :test do |stub|
|
142
|
+
stub.post('request?full=true', request_body, request_headers) do
|
143
|
+
[400, { 'X-Reason' => 'because' }, 'keep looking']
|
144
|
+
end
|
145
|
+
end
|
146
|
+
end
|
147
|
+
end
|
148
|
+
let(:request_body) { JSON.generate({ 'item' => 'sth' }) }
|
149
|
+
let(:request_headers) { { 'Authorization' => 'Basic 123' } }
|
150
|
+
|
151
|
+
subject(:perform_request) do
|
152
|
+
conn.post 'request' do |req|
|
153
|
+
req.headers['Authorization'] = 'Basic 123'
|
154
|
+
req.params[:full] = true
|
155
|
+
req.body = request_body
|
156
|
+
end
|
157
|
+
end
|
158
|
+
|
159
|
+
it 'returns the request info in the exception' do
|
160
|
+
expect { perform_request }.to raise_error(Faraday::BadRequestError) do |ex|
|
161
|
+
expect(ex.response[:request][:method]).to eq(:post)
|
162
|
+
expect(ex.response[:request][:url_path]).to eq('/request')
|
163
|
+
expect(ex.response[:request][:params]).to eq({ 'full' => 'true' })
|
164
|
+
expect(ex.response[:request][:headers]).to match(a_hash_including(request_headers))
|
165
|
+
expect(ex.response[:request][:body]).to eq(request_body)
|
166
|
+
end
|
104
167
|
end
|
105
168
|
end
|
106
169
|
end
|