iron_admin 0.5.0 → 0.6.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/app/assets/config/iron_admin_manifest.js +12 -0
- data/app/components/iron_admin/dashboards/metric_card_component.html.haml +8 -3
- data/app/components/iron_admin/dashboards/metric_card_component.rb +21 -1
- data/app/components/iron_admin/form/belongs_to_component.rb +60 -6
- data/app/components/iron_admin/form/nested_form_component.html.haml +28 -0
- data/app/components/iron_admin/form/nested_form_component.rb +81 -0
- data/app/components/iron_admin/resources/data_table_component.html.haml +1 -1
- data/app/components/iron_admin/resources/data_table_component.rb +6 -0
- data/app/components/iron_admin/resources/show_field_component.rb +2 -0
- data/app/controllers/iron_admin/application_controller.rb +32 -1
- data/app/controllers/iron_admin/concerns/action_executable.rb +44 -0
- data/app/controllers/iron_admin/concerns/filterable.rb +84 -0
- data/app/controllers/iron_admin/concerns/json_params_coercion.rb +67 -0
- data/app/controllers/iron_admin/concerns/nested_permittable.rb +36 -0
- data/app/controllers/iron_admin/concerns/scopeable.rb +84 -0
- data/app/controllers/iron_admin/concerns/searchable.rb +13 -16
- data/app/controllers/iron_admin/exports_controller.rb +15 -11
- data/app/controllers/iron_admin/imports_controller.rb +83 -0
- data/app/controllers/iron_admin/live_controller.rb +12 -0
- data/app/controllers/iron_admin/resources_controller.rb +118 -117
- data/app/controllers/iron_admin/search_controller.rb +5 -5
- data/app/controllers/iron_admin/tools_controller.rb +63 -4
- data/app/helpers/iron_admin/application_helper.rb +33 -14
- data/app/helpers/iron_admin/field_display_helper.rb +160 -1
- data/app/javascript/iron_admin/controllers/cp_nested_form_controller.js +113 -0
- data/app/javascript/iron_admin/controllers/filter_operator_controller.js +10 -0
- data/app/javascript/iron_admin/index.js +4 -0
- data/app/views/iron_admin/dashboard/index.html.haml +7 -2
- data/app/views/iron_admin/form/_nested_row.html.haml +70 -0
- data/app/views/iron_admin/imports/new.html.haml +27 -0
- data/app/views/iron_admin/imports/preview.html.haml +31 -0
- data/app/views/iron_admin/resources/_form.html.haml +81 -5
- data/app/views/iron_admin/resources/action_form.html.haml +62 -0
- data/app/views/iron_admin/resources/bulk_action_form.html.haml +62 -0
- data/app/views/iron_admin/resources/index.html.haml +60 -18
- data/app/views/iron_admin/tools/action_form.html.haml +57 -0
- data/app/views/iron_admin/tools/show.html.haml +20 -1
- data/config/importmap.rb +2 -0
- data/config/locales/en.yml +36 -0
- data/config/routes.rb +7 -0
- data/docs/components/filter-components.md +60 -0
- data/docs/getting-started/quick-start.md +17 -1
- data/docs/guides/authentication.md +7 -6
- data/docs/guides/custom-adapters.md +628 -0
- data/docs/guides/extending.md +132 -3
- data/docs/guides/fields.md +1 -1
- data/docs/guides/resources.md +78 -2
- data/docs/guides/troubleshooting.md +29 -0
- data/docs/reference/routes.md +10 -0
- data/lib/generators/iron_admin/install/install_generator.rb +28 -4
- data/lib/generators/iron_admin/install_audit/install_audit_generator.rb +26 -10
- data/lib/iron_admin/action_field.rb +56 -0
- data/lib/iron_admin/adapters/active_record.rb +237 -0
- data/lib/iron_admin/adapters/base.rb +340 -0
- data/lib/iron_admin/adapters/http/column_descriptor.rb +10 -0
- data/lib/iron_admin/adapters/http/configuration.rb +27 -0
- data/lib/iron_admin/adapters/http/connection.rb +117 -0
- data/lib/iron_admin/adapters/http/model_proxy.rb +75 -0
- data/lib/iron_admin/adapters/http/query.rb +111 -0
- data/lib/iron_admin/adapters/http/record.rb +83 -0
- data/lib/iron_admin/adapters/http/type_inferrer.rb +51 -0
- data/lib/iron_admin/adapters/http.rb +241 -0
- data/lib/iron_admin/adapters/mongoid/association_wrapper.rb +74 -0
- data/lib/iron_admin/adapters/mongoid/column_descriptor.rb +10 -0
- data/lib/iron_admin/adapters/mongoid.rb +284 -0
- data/lib/iron_admin/adapters/registry.rb +44 -0
- data/lib/iron_admin/concerns/importable.rb +81 -0
- data/lib/iron_admin/concerns/live_updatable.rb +38 -0
- data/lib/iron_admin/concerns/nestable.rb +69 -0
- data/lib/iron_admin/concerns/soft_deletable.rb +61 -0
- data/lib/iron_admin/configuration.rb +20 -0
- data/lib/iron_admin/dashboard.rb +15 -20
- data/lib/iron_admin/engine.rb +28 -1
- data/lib/iron_admin/errors.rb +29 -0
- data/lib/iron_admin/field_inferrer.rb +61 -22
- data/lib/iron_admin/filters/active_record_query_builder.rb +63 -0
- data/lib/iron_admin/filters/base_query_builder.rb +55 -0
- data/lib/iron_admin/filters/http_query_builder.rb +39 -0
- data/lib/iron_admin/filters/mongoid_query_builder.rb +58 -0
- data/lib/iron_admin/filters/query_builder.rb +12 -0
- data/lib/iron_admin/import/column_mapper.rb +42 -0
- data/lib/iron_admin/import/import_preview.rb +10 -0
- data/lib/iron_admin/import/import_result.rb +10 -0
- data/lib/iron_admin/import/importer.rb +231 -0
- data/lib/iron_admin/import/parser/csv.rb +34 -0
- data/lib/iron_admin/import/parser/json.rb +36 -0
- data/lib/iron_admin/import/type_caster.rb +47 -0
- data/lib/iron_admin/live/broadcaster.rb +43 -0
- data/lib/iron_admin/live/poll_cache.rb +28 -0
- data/lib/iron_admin/live.rb +29 -0
- data/lib/iron_admin/nested_association.rb +15 -0
- data/lib/iron_admin/nested_attributes_validator.rb +25 -0
- data/lib/iron_admin/policy.rb +72 -13
- data/lib/iron_admin/resource.rb +148 -90
- data/lib/iron_admin/resource_registry.rb +77 -4
- data/lib/iron_admin/tool.rb +50 -0
- data/lib/iron_admin/tool_action.rb +73 -0
- data/lib/iron_admin/tool_context.rb +49 -0
- data/lib/iron_admin/version.rb +1 -1
- data/lib/iron_admin.rb +28 -0
- data/vendor/bundle/ruby/3.2.0/cache/addressable-2.9.0.gem +0 -0
- data/vendor/bundle/ruby/3.2.0/cache/crack-1.0.1.gem +0 -0
- data/vendor/bundle/ruby/3.2.0/cache/faraday-2.14.1.gem +0 -0
- data/vendor/bundle/ruby/3.2.0/cache/faraday-net_http-3.4.2.gem +0 -0
- data/vendor/bundle/ruby/3.2.0/cache/hashdiff-1.2.1.gem +0 -0
- data/vendor/bundle/ruby/3.2.0/cache/net-http-0.9.1.gem +0 -0
- data/vendor/bundle/ruby/3.2.0/cache/public_suffix-7.0.5.gem +0 -0
- data/vendor/bundle/ruby/3.2.0/cache/rexml-3.4.4.gem +0 -0
- data/vendor/bundle/ruby/3.2.0/cache/webmock-3.26.2.gem +0 -0
- data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/bigdecimal-4.0.1/bigdecimal.so +0 -0
- data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/bigdecimal-4.0.1/gem_make.out +6 -6
- data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/bigdecimal-4.0.1/mkmf.log +25 -25
- data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/date-3.5.1/date_core.so +0 -0
- data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/date-3.5.1/gem_make.out +6 -6
- data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/date-3.5.1/mkmf.log +4 -4
- data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/erb-6.0.1/erb/escape.so +0 -0
- data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/erb-6.0.1/gem_make.out +6 -6
- data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/erb-6.0.1/mkmf.log +2 -2
- data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/io-console-0.8.2/gem_make.out +6 -6
- data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/io-console-0.8.2/io/console.so +0 -0
- data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/io-console-0.8.2/mkmf.log +22 -22
- data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/json-2.18.1/gem_make.out +6 -6
- data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/json-2.18.1/json/ext/generator.so +0 -0
- data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/json-2.18.1/json/ext/parser.so +0 -0
- data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/json-2.18.1/mkmf.log +9 -9
- data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/nio4r-2.7.5/gem_make.out +6 -6
- data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/nio4r-2.7.5/mkmf.log +12 -12
- data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/nio4r-2.7.5/nio4r_ext.so +0 -0
- data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/prism-1.9.0/gem_make.out +6 -6
- data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/prism-1.9.0/mkmf.log +6 -6
- data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/prism-1.9.0/prism/prism.so +0 -0
- data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/psych-5.3.1/gem_make.out +6 -6
- data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/psych-5.3.1/mkmf.log +7 -7
- data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/psych-5.3.1/psych.so +0 -0
- data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/racc-1.8.1/gem_make.out +6 -6
- data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/racc-1.8.1/racc/cparse.so +0 -0
- data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/redcarpet-3.6.1/gem_make.out +6 -6
- data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/redcarpet-3.6.1/redcarpet.so +0 -0
- data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/stringio-3.2.0/gem_make.out +6 -6
- data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/stringio-3.2.0/mkmf.log +2 -2
- data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/stringio-3.2.0/stringio.so +0 -0
- data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/websocket-driver-0.8.0/gem_make.out +6 -6
- data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/websocket-driver-0.8.0/websocket_mask.so +0 -0
- data/vendor/bundle/ruby/3.2.0/gems/addressable-2.9.0/CHANGELOG.md +326 -0
- data/vendor/bundle/ruby/3.2.0/gems/addressable-2.9.0/LICENSE.txt +202 -0
- data/vendor/bundle/ruby/3.2.0/gems/addressable-2.9.0/README.md +121 -0
- data/vendor/bundle/ruby/3.2.0/gems/addressable-2.9.0/lib/addressable/idna/native.rb +66 -0
- data/vendor/bundle/ruby/3.2.0/gems/addressable-2.9.0/lib/addressable/idna/pure.rb +4710 -0
- data/vendor/bundle/ruby/3.2.0/gems/addressable-2.9.0/lib/addressable/idna.rb +26 -0
- data/vendor/bundle/ruby/3.2.0/gems/addressable-2.9.0/lib/addressable/template.rb +1040 -0
- data/vendor/bundle/ruby/3.2.0/gems/addressable-2.9.0/lib/addressable/uri.rb +2602 -0
- data/vendor/bundle/ruby/3.2.0/gems/addressable-2.9.0/lib/addressable/version.rb +31 -0
- data/vendor/bundle/ruby/3.2.0/gems/addressable-2.9.0/lib/addressable.rb +4 -0
- data/vendor/bundle/ruby/3.2.0/gems/bigdecimal-4.0.1/ext/bigdecimal/Makefile +3 -3
- data/vendor/bundle/ruby/3.2.0/gems/bigdecimal-4.0.1/lib/bigdecimal.so +0 -0
- data/vendor/bundle/ruby/3.2.0/gems/crack-1.0.1/History +58 -0
- data/vendor/bundle/ruby/3.2.0/gems/crack-1.0.1/LICENSE +20 -0
- data/vendor/bundle/ruby/3.2.0/gems/crack-1.0.1/README.md +43 -0
- data/vendor/bundle/ruby/3.2.0/gems/crack-1.0.1/lib/crack/json.rb +113 -0
- data/vendor/bundle/ruby/3.2.0/gems/crack-1.0.1/lib/crack/util.rb +17 -0
- data/vendor/bundle/ruby/3.2.0/gems/crack-1.0.1/lib/crack/version.rb +3 -0
- data/vendor/bundle/ruby/3.2.0/gems/crack-1.0.1/lib/crack/xml.rb +240 -0
- data/vendor/bundle/ruby/3.2.0/gems/crack-1.0.1/lib/crack.rb +8 -0
- data/vendor/bundle/ruby/3.2.0/gems/date-3.5.1/ext/date/Makefile +3 -3
- data/vendor/bundle/ruby/3.2.0/gems/date-3.5.1/lib/date_core.so +0 -0
- data/vendor/bundle/ruby/3.2.0/gems/erb-6.0.1/ext/erb/escape/Makefile +3 -3
- data/vendor/bundle/ruby/3.2.0/gems/erb-6.0.1/lib/erb/escape.so +0 -0
- data/vendor/bundle/ruby/3.2.0/gems/faraday-2.14.1/CHANGELOG.md +574 -0
- data/vendor/bundle/ruby/3.2.0/gems/faraday-2.14.1/LICENSE.md +20 -0
- data/vendor/bundle/ruby/3.2.0/gems/faraday-2.14.1/README.md +67 -0
- data/vendor/bundle/ruby/3.2.0/gems/faraday-2.14.1/Rakefile +12 -0
- data/vendor/bundle/ruby/3.2.0/gems/faraday-2.14.1/examples/client_spec.rb +119 -0
- data/vendor/bundle/ruby/3.2.0/gems/faraday-2.14.1/examples/client_test.rb +144 -0
- data/vendor/bundle/ruby/3.2.0/gems/faraday-2.14.1/lib/faraday/adapter/test.rb +311 -0
- data/vendor/bundle/ruby/3.2.0/gems/faraday-2.14.1/lib/faraday/adapter.rb +101 -0
- data/vendor/bundle/ruby/3.2.0/gems/faraday-2.14.1/lib/faraday/adapter_registry.rb +30 -0
- data/vendor/bundle/ruby/3.2.0/gems/faraday-2.14.1/lib/faraday/connection.rb +565 -0
- data/vendor/bundle/ruby/3.2.0/gems/faraday-2.14.1/lib/faraday/encoders/flat_params_encoder.rb +105 -0
- data/vendor/bundle/ruby/3.2.0/gems/faraday-2.14.1/lib/faraday/encoders/nested_params_encoder.rb +183 -0
- data/vendor/bundle/ruby/3.2.0/gems/faraday-2.14.1/lib/faraday/error.rb +202 -0
- data/vendor/bundle/ruby/3.2.0/gems/faraday-2.14.1/lib/faraday/logging/formatter.rb +118 -0
- data/vendor/bundle/ruby/3.2.0/gems/faraday-2.14.1/lib/faraday/methods.rb +6 -0
- data/vendor/bundle/ruby/3.2.0/gems/faraday-2.14.1/lib/faraday/middleware.rb +72 -0
- data/vendor/bundle/ruby/3.2.0/gems/faraday-2.14.1/lib/faraday/middleware_registry.rb +83 -0
- data/vendor/bundle/ruby/3.2.0/gems/faraday-2.14.1/lib/faraday/options/connection_options.rb +23 -0
- data/vendor/bundle/ruby/3.2.0/gems/faraday-2.14.1/lib/faraday/options/env.rb +204 -0
- data/vendor/bundle/ruby/3.2.0/gems/faraday-2.14.1/lib/faraday/options/proxy_options.rb +38 -0
- data/vendor/bundle/ruby/3.2.0/gems/faraday-2.14.1/lib/faraday/options/request_options.rb +23 -0
- data/vendor/bundle/ruby/3.2.0/gems/faraday-2.14.1/lib/faraday/options/ssl_options.rb +76 -0
- data/vendor/bundle/ruby/3.2.0/gems/faraday-2.14.1/lib/faraday/options.rb +219 -0
- data/vendor/bundle/ruby/3.2.0/gems/faraday-2.14.1/lib/faraday/parameters.rb +5 -0
- data/vendor/bundle/ruby/3.2.0/gems/faraday-2.14.1/lib/faraday/rack_builder.rb +248 -0
- data/vendor/bundle/ruby/3.2.0/gems/faraday-2.14.1/lib/faraday/request/authorization.rb +54 -0
- data/vendor/bundle/ruby/3.2.0/gems/faraday-2.14.1/lib/faraday/request/instrumentation.rb +58 -0
- data/vendor/bundle/ruby/3.2.0/gems/faraday-2.14.1/lib/faraday/request/json.rb +70 -0
- data/vendor/bundle/ruby/3.2.0/gems/faraday-2.14.1/lib/faraday/request/url_encoded.rb +60 -0
- data/vendor/bundle/ruby/3.2.0/gems/faraday-2.14.1/lib/faraday/request.rb +139 -0
- data/vendor/bundle/ruby/3.2.0/gems/faraday-2.14.1/lib/faraday/response/json.rb +74 -0
- data/vendor/bundle/ruby/3.2.0/gems/faraday-2.14.1/lib/faraday/response/logger.rb +39 -0
- data/vendor/bundle/ruby/3.2.0/gems/faraday-2.14.1/lib/faraday/response/raise_error.rb +83 -0
- data/vendor/bundle/ruby/3.2.0/gems/faraday-2.14.1/lib/faraday/response.rb +95 -0
- data/vendor/bundle/ruby/3.2.0/gems/faraday-2.14.1/lib/faraday/utils/headers.rb +150 -0
- data/vendor/bundle/ruby/3.2.0/gems/faraday-2.14.1/lib/faraday/utils/params_hash.rb +61 -0
- data/vendor/bundle/ruby/3.2.0/gems/faraday-2.14.1/lib/faraday/utils.rb +121 -0
- data/vendor/bundle/ruby/3.2.0/gems/faraday-2.14.1/lib/faraday/version.rb +5 -0
- data/vendor/bundle/ruby/3.2.0/gems/faraday-2.14.1/lib/faraday.rb +158 -0
- data/vendor/bundle/ruby/3.2.0/gems/faraday-2.14.1/spec/external_adapters/faraday_specs_setup.rb +14 -0
- data/vendor/bundle/ruby/3.2.0/gems/faraday-2.14.1/spec/faraday/adapter/test_spec.rb +442 -0
- data/vendor/bundle/ruby/3.2.0/gems/faraday-2.14.1/spec/faraday/adapter_registry_spec.rb +28 -0
- data/vendor/bundle/ruby/3.2.0/gems/faraday-2.14.1/spec/faraday/adapter_spec.rb +55 -0
- data/vendor/bundle/ruby/3.2.0/gems/faraday-2.14.1/spec/faraday/connection_spec.rb +841 -0
- data/vendor/bundle/ruby/3.2.0/gems/faraday-2.14.1/spec/faraday/error_spec.rb +175 -0
- data/vendor/bundle/ruby/3.2.0/gems/faraday-2.14.1/spec/faraday/middleware_registry_spec.rb +31 -0
- data/vendor/bundle/ruby/3.2.0/gems/faraday-2.14.1/spec/faraday/middleware_spec.rb +213 -0
- data/vendor/bundle/ruby/3.2.0/gems/faraday-2.14.1/spec/faraday/options/env_spec.rb +76 -0
- data/vendor/bundle/ruby/3.2.0/gems/faraday-2.14.1/spec/faraday/options/options_spec.rb +297 -0
- data/vendor/bundle/ruby/3.2.0/gems/faraday-2.14.1/spec/faraday/options/proxy_options_spec.rb +79 -0
- data/vendor/bundle/ruby/3.2.0/gems/faraday-2.14.1/spec/faraday/options/request_options_spec.rb +19 -0
- data/vendor/bundle/ruby/3.2.0/gems/faraday-2.14.1/spec/faraday/params_encoders/flat_spec.rb +42 -0
- data/vendor/bundle/ruby/3.2.0/gems/faraday-2.14.1/spec/faraday/params_encoders/nested_spec.rb +151 -0
- data/vendor/bundle/ruby/3.2.0/gems/faraday-2.14.1/spec/faraday/rack_builder_spec.rb +317 -0
- data/vendor/bundle/ruby/3.2.0/gems/faraday-2.14.1/spec/faraday/request/authorization_spec.rb +118 -0
- data/vendor/bundle/ruby/3.2.0/gems/faraday-2.14.1/spec/faraday/request/instrumentation_spec.rb +74 -0
- data/vendor/bundle/ruby/3.2.0/gems/faraday-2.14.1/spec/faraday/request/json_spec.rb +199 -0
- data/vendor/bundle/ruby/3.2.0/gems/faraday-2.14.1/spec/faraday/request/url_encoded_spec.rb +93 -0
- data/vendor/bundle/ruby/3.2.0/gems/faraday-2.14.1/spec/faraday/request_spec.rb +110 -0
- data/vendor/bundle/ruby/3.2.0/gems/faraday-2.14.1/spec/faraday/response/json_spec.rb +206 -0
- data/vendor/bundle/ruby/3.2.0/gems/faraday-2.14.1/spec/faraday/response/logger_spec.rb +299 -0
- data/vendor/bundle/ruby/3.2.0/gems/faraday-2.14.1/spec/faraday/response/raise_error_spec.rb +286 -0
- data/vendor/bundle/ruby/3.2.0/gems/faraday-2.14.1/spec/faraday/response_spec.rb +84 -0
- data/vendor/bundle/ruby/3.2.0/gems/faraday-2.14.1/spec/faraday/utils/headers_spec.rb +109 -0
- data/vendor/bundle/ruby/3.2.0/gems/faraday-2.14.1/spec/faraday/utils_spec.rb +120 -0
- data/vendor/bundle/ruby/3.2.0/gems/faraday-2.14.1/spec/faraday_spec.rb +43 -0
- data/vendor/bundle/ruby/3.2.0/gems/faraday-2.14.1/spec/spec_helper.rb +133 -0
- data/vendor/bundle/ruby/3.2.0/gems/faraday-2.14.1/spec/support/disabling_stub.rb +14 -0
- data/vendor/bundle/ruby/3.2.0/gems/faraday-2.14.1/spec/support/fake_safe_buffer.rb +15 -0
- data/vendor/bundle/ruby/3.2.0/gems/faraday-2.14.1/spec/support/faraday_middleware_subclasses.rb +18 -0
- data/vendor/bundle/ruby/3.2.0/gems/faraday-2.14.1/spec/support/helper_methods.rb +96 -0
- data/vendor/bundle/ruby/3.2.0/gems/faraday-2.14.1/spec/support/shared_examples/adapter.rb +105 -0
- data/vendor/bundle/ruby/3.2.0/gems/faraday-2.14.1/spec/support/shared_examples/params_encoder.rb +18 -0
- data/vendor/bundle/ruby/3.2.0/gems/faraday-2.14.1/spec/support/shared_examples/request_method.rb +263 -0
- data/vendor/bundle/ruby/3.2.0/gems/faraday-2.14.1/spec/support/streaming_response_checker.rb +35 -0
- data/vendor/bundle/ruby/3.2.0/gems/faraday-net_http-3.4.2/LICENSE.md +21 -0
- data/vendor/bundle/ruby/3.2.0/gems/faraday-net_http-3.4.2/README.md +57 -0
- data/vendor/bundle/ruby/3.2.0/gems/faraday-net_http-3.4.2/lib/faraday/adapter/net_http.rb +206 -0
- data/vendor/bundle/ruby/3.2.0/gems/faraday-net_http-3.4.2/lib/faraday/net_http/version.rb +7 -0
- data/vendor/bundle/ruby/3.2.0/gems/faraday-net_http-3.4.2/lib/faraday/net_http.rb +10 -0
- data/vendor/bundle/ruby/3.2.0/gems/hashdiff-1.2.1/Gemfile +8 -0
- data/vendor/bundle/ruby/3.2.0/gems/hashdiff-1.2.1/LICENSE +19 -0
- data/vendor/bundle/ruby/3.2.0/gems/hashdiff-1.2.1/README.md +323 -0
- data/vendor/bundle/ruby/3.2.0/gems/hashdiff-1.2.1/Rakefile +18 -0
- data/vendor/bundle/ruby/3.2.0/gems/hashdiff-1.2.1/changelog.md +127 -0
- data/vendor/bundle/ruby/3.2.0/gems/hashdiff-1.2.1/hashdiff.gemspec +39 -0
- data/vendor/bundle/ruby/3.2.0/gems/hashdiff-1.2.1/lib/hashdiff/compare_hashes.rb +101 -0
- data/vendor/bundle/ruby/3.2.0/gems/hashdiff-1.2.1/lib/hashdiff/diff.rb +185 -0
- data/vendor/bundle/ruby/3.2.0/gems/hashdiff-1.2.1/lib/hashdiff/lcs.rb +66 -0
- data/vendor/bundle/ruby/3.2.0/gems/hashdiff-1.2.1/lib/hashdiff/lcs_compare_arrays.rb +32 -0
- data/vendor/bundle/ruby/3.2.0/gems/hashdiff-1.2.1/lib/hashdiff/linear_compare_array.rb +159 -0
- data/vendor/bundle/ruby/3.2.0/gems/hashdiff-1.2.1/lib/hashdiff/patch.rb +88 -0
- data/vendor/bundle/ruby/3.2.0/gems/hashdiff-1.2.1/lib/hashdiff/util.rb +155 -0
- data/vendor/bundle/ruby/3.2.0/gems/hashdiff-1.2.1/lib/hashdiff/version.rb +5 -0
- data/vendor/bundle/ruby/3.2.0/gems/hashdiff-1.2.1/lib/hashdiff.rb +10 -0
- data/vendor/bundle/ruby/3.2.0/gems/io-console-0.8.2/ext/io/console/Makefile +3 -3
- data/vendor/bundle/ruby/3.2.0/gems/io-console-0.8.2/lib/io/console.so +0 -0
- data/vendor/bundle/ruby/3.2.0/gems/json-2.18.1/ext/json/ext/generator/Makefile +3 -3
- data/vendor/bundle/ruby/3.2.0/gems/json-2.18.1/ext/json/ext/parser/Makefile +3 -3
- data/vendor/bundle/ruby/3.2.0/gems/json-2.18.1/lib/json/ext/generator.so +0 -0
- data/vendor/bundle/ruby/3.2.0/gems/json-2.18.1/lib/json/ext/parser.so +0 -0
- data/vendor/bundle/ruby/3.2.0/gems/net-http-0.9.1/BSDL +22 -0
- data/vendor/bundle/ruby/3.2.0/gems/net-http-0.9.1/COPYING +56 -0
- data/vendor/bundle/ruby/3.2.0/gems/net-http-0.9.1/README.md +93 -0
- data/vendor/bundle/ruby/3.2.0/gems/net-http-0.9.1/doc/net-http/examples.rdoc +31 -0
- data/vendor/bundle/ruby/3.2.0/gems/net-http-0.9.1/doc/net-http/included_getters.rdoc +3 -0
- data/vendor/bundle/ruby/3.2.0/gems/net-http-0.9.1/lib/net/http/exceptions.rb +35 -0
- data/vendor/bundle/ruby/3.2.0/gems/net-http-0.9.1/lib/net/http/generic_request.rb +429 -0
- data/vendor/bundle/ruby/3.2.0/gems/net-http-0.9.1/lib/net/http/header.rb +985 -0
- data/vendor/bundle/ruby/3.2.0/gems/net-http-0.9.1/lib/net/http/proxy_delta.rb +17 -0
- data/vendor/bundle/ruby/3.2.0/gems/net-http-0.9.1/lib/net/http/request.rb +88 -0
- data/vendor/bundle/ruby/3.2.0/gems/net-http-0.9.1/lib/net/http/requests.rb +444 -0
- data/vendor/bundle/ruby/3.2.0/gems/net-http-0.9.1/lib/net/http/response.rb +739 -0
- data/vendor/bundle/ruby/3.2.0/gems/net-http-0.9.1/lib/net/http/responses.rb +1242 -0
- data/vendor/bundle/ruby/3.2.0/gems/net-http-0.9.1/lib/net/http/status.rb +84 -0
- data/vendor/bundle/ruby/3.2.0/gems/net-http-0.9.1/lib/net/http.rb +2608 -0
- data/vendor/bundle/ruby/3.2.0/gems/net-http-0.9.1/lib/net/https.rb +23 -0
- data/vendor/bundle/ruby/3.2.0/gems/nio4r-2.7.5/ext/nio4r/Makefile +3 -3
- data/vendor/bundle/ruby/3.2.0/gems/nio4r-2.7.5/lib/nio4r_ext.so +0 -0
- data/vendor/bundle/ruby/3.2.0/gems/prism-1.9.0/ext/prism/Makefile +3 -3
- data/vendor/bundle/ruby/3.2.0/gems/prism-1.9.0/lib/prism/prism.so +0 -0
- data/vendor/bundle/ruby/3.2.0/gems/psych-5.3.1/ext/psych/Makefile +3 -3
- data/vendor/bundle/ruby/3.2.0/gems/psych-5.3.1/lib/psych.so +0 -0
- data/vendor/bundle/ruby/3.2.0/gems/public_suffix-7.0.5/CHANGELOG.md +649 -0
- data/vendor/bundle/ruby/3.2.0/gems/public_suffix-7.0.5/Gemfile +16 -0
- data/vendor/bundle/ruby/3.2.0/gems/public_suffix-7.0.5/LICENSE.txt +22 -0
- data/vendor/bundle/ruby/3.2.0/gems/public_suffix-7.0.5/README.md +231 -0
- data/vendor/bundle/ruby/3.2.0/gems/public_suffix-7.0.5/SECURITY.md +24 -0
- data/vendor/bundle/ruby/3.2.0/gems/public_suffix-7.0.5/data/list.txt +16298 -0
- data/vendor/bundle/ruby/3.2.0/gems/public_suffix-7.0.5/lib/public_suffix/domain.rb +235 -0
- data/vendor/bundle/ruby/3.2.0/gems/public_suffix-7.0.5/lib/public_suffix/errors.rb +41 -0
- data/vendor/bundle/ruby/3.2.0/gems/public_suffix-7.0.5/lib/public_suffix/list.rb +247 -0
- data/vendor/bundle/ruby/3.2.0/gems/public_suffix-7.0.5/lib/public_suffix/rule.rb +350 -0
- data/vendor/bundle/ruby/3.2.0/gems/public_suffix-7.0.5/lib/public_suffix/version.rb +14 -0
- data/vendor/bundle/ruby/3.2.0/gems/public_suffix-7.0.5/lib/public_suffix.rb +177 -0
- data/vendor/bundle/ruby/3.2.0/gems/racc-1.8.1/ext/racc/cparse/Makefile +3 -3
- data/vendor/bundle/ruby/3.2.0/gems/racc-1.8.1/lib/racc/cparse.so +0 -0
- data/vendor/bundle/ruby/3.2.0/gems/redcarpet-3.6.1/ext/redcarpet/Makefile +3 -3
- data/vendor/bundle/ruby/3.2.0/gems/redcarpet-3.6.1/lib/redcarpet.so +0 -0
- data/vendor/bundle/ruby/3.2.0/gems/rexml-3.4.4/LICENSE.txt +22 -0
- data/vendor/bundle/ruby/3.2.0/gems/rexml-3.4.4/NEWS.md +843 -0
- data/vendor/bundle/ruby/3.2.0/gems/rexml-3.4.4/README.md +57 -0
- data/vendor/bundle/ruby/3.2.0/gems/rexml-3.4.4/doc/rexml/context.rdoc +143 -0
- data/vendor/bundle/ruby/3.2.0/gems/rexml-3.4.4/doc/rexml/tasks/rdoc/child.rdoc +87 -0
- data/vendor/bundle/ruby/3.2.0/gems/rexml-3.4.4/doc/rexml/tasks/rdoc/document.rdoc +276 -0
- data/vendor/bundle/ruby/3.2.0/gems/rexml-3.4.4/doc/rexml/tasks/rdoc/element.rdoc +602 -0
- data/vendor/bundle/ruby/3.2.0/gems/rexml-3.4.4/doc/rexml/tasks/rdoc/node.rdoc +97 -0
- data/vendor/bundle/ruby/3.2.0/gems/rexml-3.4.4/doc/rexml/tasks/rdoc/parent.rdoc +267 -0
- data/vendor/bundle/ruby/3.2.0/gems/rexml-3.4.4/doc/rexml/tasks/tocs/child_toc.rdoc +12 -0
- data/vendor/bundle/ruby/3.2.0/gems/rexml-3.4.4/doc/rexml/tasks/tocs/document_toc.rdoc +30 -0
- data/vendor/bundle/ruby/3.2.0/gems/rexml-3.4.4/doc/rexml/tasks/tocs/element_toc.rdoc +55 -0
- data/vendor/bundle/ruby/3.2.0/gems/rexml-3.4.4/doc/rexml/tasks/tocs/master_toc.rdoc +135 -0
- data/vendor/bundle/ruby/3.2.0/gems/rexml-3.4.4/doc/rexml/tasks/tocs/node_toc.rdoc +16 -0
- data/vendor/bundle/ruby/3.2.0/gems/rexml-3.4.4/doc/rexml/tasks/tocs/parent_toc.rdoc +25 -0
- data/vendor/bundle/ruby/3.2.0/gems/rexml-3.4.4/doc/rexml/tutorial.rdoc +1358 -0
- data/vendor/bundle/ruby/3.2.0/gems/rexml-3.4.4/lib/rexml/attlistdecl.rb +63 -0
- data/vendor/bundle/ruby/3.2.0/gems/rexml-3.4.4/lib/rexml/attribute.rb +210 -0
- data/vendor/bundle/ruby/3.2.0/gems/rexml-3.4.4/lib/rexml/cdata.rb +68 -0
- data/vendor/bundle/ruby/3.2.0/gems/rexml-3.4.4/lib/rexml/child.rb +96 -0
- data/vendor/bundle/ruby/3.2.0/gems/rexml-3.4.4/lib/rexml/comment.rb +80 -0
- data/vendor/bundle/ruby/3.2.0/gems/rexml-3.4.4/lib/rexml/doctype.rb +306 -0
- data/vendor/bundle/ruby/3.2.0/gems/rexml-3.4.4/lib/rexml/document.rb +471 -0
- data/vendor/bundle/ruby/3.2.0/gems/rexml-3.4.4/lib/rexml/dtd/attlistdecl.rb +11 -0
- data/vendor/bundle/ruby/3.2.0/gems/rexml-3.4.4/lib/rexml/dtd/dtd.rb +47 -0
- data/vendor/bundle/ruby/3.2.0/gems/rexml-3.4.4/lib/rexml/dtd/elementdecl.rb +18 -0
- data/vendor/bundle/ruby/3.2.0/gems/rexml-3.4.4/lib/rexml/dtd/entitydecl.rb +57 -0
- data/vendor/bundle/ruby/3.2.0/gems/rexml-3.4.4/lib/rexml/dtd/notationdecl.rb +40 -0
- data/vendor/bundle/ruby/3.2.0/gems/rexml-3.4.4/lib/rexml/element.rb +2578 -0
- data/vendor/bundle/ruby/3.2.0/gems/rexml-3.4.4/lib/rexml/encoding.rb +48 -0
- data/vendor/bundle/ruby/3.2.0/gems/rexml-3.4.4/lib/rexml/entity.rb +142 -0
- data/vendor/bundle/ruby/3.2.0/gems/rexml-3.4.4/lib/rexml/formatters/default.rb +116 -0
- data/vendor/bundle/ruby/3.2.0/gems/rexml-3.4.4/lib/rexml/formatters/pretty.rb +142 -0
- data/vendor/bundle/ruby/3.2.0/gems/rexml-3.4.4/lib/rexml/formatters/transitive.rb +58 -0
- data/vendor/bundle/ruby/3.2.0/gems/rexml-3.4.4/lib/rexml/functions.rb +446 -0
- data/vendor/bundle/ruby/3.2.0/gems/rexml-3.4.4/lib/rexml/instruction.rb +79 -0
- data/vendor/bundle/ruby/3.2.0/gems/rexml-3.4.4/lib/rexml/light/node.rb +188 -0
- data/vendor/bundle/ruby/3.2.0/gems/rexml-3.4.4/lib/rexml/namespace.rb +63 -0
- data/vendor/bundle/ruby/3.2.0/gems/rexml-3.4.4/lib/rexml/node.rb +80 -0
- data/vendor/bundle/ruby/3.2.0/gems/rexml-3.4.4/lib/rexml/output.rb +30 -0
- data/vendor/bundle/ruby/3.2.0/gems/rexml-3.4.4/lib/rexml/parent.rb +166 -0
- data/vendor/bundle/ruby/3.2.0/gems/rexml-3.4.4/lib/rexml/parseexception.rb +53 -0
- data/vendor/bundle/ruby/3.2.0/gems/rexml-3.4.4/lib/rexml/parsers/baseparser.rb +949 -0
- data/vendor/bundle/ruby/3.2.0/gems/rexml-3.4.4/lib/rexml/parsers/lightparser.rb +59 -0
- data/vendor/bundle/ruby/3.2.0/gems/rexml-3.4.4/lib/rexml/parsers/pullparser.rb +213 -0
- data/vendor/bundle/ruby/3.2.0/gems/rexml-3.4.4/lib/rexml/parsers/sax2parser.rb +270 -0
- data/vendor/bundle/ruby/3.2.0/gems/rexml-3.4.4/lib/rexml/parsers/streamparser.rb +67 -0
- data/vendor/bundle/ruby/3.2.0/gems/rexml-3.4.4/lib/rexml/parsers/treeparser.rb +89 -0
- data/vendor/bundle/ruby/3.2.0/gems/rexml-3.4.4/lib/rexml/parsers/ultralightparser.rb +57 -0
- data/vendor/bundle/ruby/3.2.0/gems/rexml-3.4.4/lib/rexml/parsers/xpathparser.rb +739 -0
- data/vendor/bundle/ruby/3.2.0/gems/rexml-3.4.4/lib/rexml/quickpath.rb +267 -0
- data/vendor/bundle/ruby/3.2.0/gems/rexml-3.4.4/lib/rexml/rexml.rb +39 -0
- data/vendor/bundle/ruby/3.2.0/gems/rexml-3.4.4/lib/rexml/sax2listener.rb +98 -0
- data/vendor/bundle/ruby/3.2.0/gems/rexml-3.4.4/lib/rexml/security.rb +28 -0
- data/vendor/bundle/ruby/3.2.0/gems/rexml-3.4.4/lib/rexml/source.rb +388 -0
- data/vendor/bundle/ruby/3.2.0/gems/rexml-3.4.4/lib/rexml/streamlistener.rb +93 -0
- data/vendor/bundle/ruby/3.2.0/gems/rexml-3.4.4/lib/rexml/text.rb +420 -0
- data/vendor/bundle/ruby/3.2.0/gems/rexml-3.4.4/lib/rexml/undefinednamespaceexception.rb +9 -0
- data/vendor/bundle/ruby/3.2.0/gems/rexml-3.4.4/lib/rexml/validation/relaxng.rb +540 -0
- data/vendor/bundle/ruby/3.2.0/gems/rexml-3.4.4/lib/rexml/validation/validation.rb +144 -0
- data/vendor/bundle/ruby/3.2.0/gems/rexml-3.4.4/lib/rexml/validation/validationexception.rb +10 -0
- data/vendor/bundle/ruby/3.2.0/gems/rexml-3.4.4/lib/rexml/xmldecl.rb +130 -0
- data/vendor/bundle/ruby/3.2.0/gems/rexml-3.4.4/lib/rexml/xmltokens.rb +85 -0
- data/vendor/bundle/ruby/3.2.0/gems/rexml-3.4.4/lib/rexml/xpath.rb +70 -0
- data/vendor/bundle/ruby/3.2.0/gems/rexml-3.4.4/lib/rexml/xpath_parser.rb +980 -0
- data/vendor/bundle/ruby/3.2.0/gems/rexml-3.4.4/lib/rexml.rb +3 -0
- data/vendor/bundle/ruby/3.2.0/gems/stringio-3.2.0/ext/stringio/Makefile +3 -3
- data/vendor/bundle/ruby/3.2.0/gems/stringio-3.2.0/lib/stringio.so +0 -0
- data/vendor/bundle/ruby/3.2.0/gems/webmock-3.26.2/CHANGELOG.md +2148 -0
- data/vendor/bundle/ruby/3.2.0/gems/webmock-3.26.2/LICENSE +20 -0
- data/vendor/bundle/ruby/3.2.0/gems/webmock-3.26.2/README.md +1229 -0
- data/vendor/bundle/ruby/3.2.0/gems/webmock-3.26.2/lib/webmock/api.rb +111 -0
- data/vendor/bundle/ruby/3.2.0/gems/webmock-3.26.2/lib/webmock/assertion_failure.rb +13 -0
- data/vendor/bundle/ruby/3.2.0/gems/webmock-3.26.2/lib/webmock/callback_registry.rb +37 -0
- data/vendor/bundle/ruby/3.2.0/gems/webmock-3.26.2/lib/webmock/config.rb +20 -0
- data/vendor/bundle/ruby/3.2.0/gems/webmock-3.26.2/lib/webmock/cucumber.rb +12 -0
- data/vendor/bundle/ruby/3.2.0/gems/webmock-3.26.2/lib/webmock/deprecation.rb +11 -0
- data/vendor/bundle/ruby/3.2.0/gems/webmock-3.26.2/lib/webmock/errors.rb +19 -0
- data/vendor/bundle/ruby/3.2.0/gems/webmock-3.26.2/lib/webmock/http_lib_adapters/async_http_client_adapter.rb +228 -0
- data/vendor/bundle/ruby/3.2.0/gems/webmock-3.26.2/lib/webmock/http_lib_adapters/curb_adapter.rb +354 -0
- data/vendor/bundle/ruby/3.2.0/gems/webmock-3.26.2/lib/webmock/http_lib_adapters/em_http_request_adapter.rb +239 -0
- data/vendor/bundle/ruby/3.2.0/gems/webmock-3.26.2/lib/webmock/http_lib_adapters/excon_adapter.rb +167 -0
- data/vendor/bundle/ruby/3.2.0/gems/webmock-3.26.2/lib/webmock/http_lib_adapters/http_lib_adapter.rb +9 -0
- data/vendor/bundle/ruby/3.2.0/gems/webmock-3.26.2/lib/webmock/http_lib_adapters/http_lib_adapter_registry.rb +21 -0
- data/vendor/bundle/ruby/3.2.0/gems/webmock-3.26.2/lib/webmock/http_lib_adapters/http_rb/client.rb +17 -0
- data/vendor/bundle/ruby/3.2.0/gems/webmock-3.26.2/lib/webmock/http_lib_adapters/http_rb/request.rb +28 -0
- data/vendor/bundle/ruby/3.2.0/gems/webmock-3.26.2/lib/webmock/http_lib_adapters/http_rb/response.rb +95 -0
- data/vendor/bundle/ruby/3.2.0/gems/webmock-3.26.2/lib/webmock/http_lib_adapters/http_rb/streamer.rb +44 -0
- data/vendor/bundle/ruby/3.2.0/gems/webmock-3.26.2/lib/webmock/http_lib_adapters/http_rb/webmock.rb +77 -0
- data/vendor/bundle/ruby/3.2.0/gems/webmock-3.26.2/lib/webmock/http_lib_adapters/http_rb_adapter.rb +39 -0
- data/vendor/bundle/ruby/3.2.0/gems/webmock-3.26.2/lib/webmock/http_lib_adapters/httpclient_adapter.rb +260 -0
- data/vendor/bundle/ruby/3.2.0/gems/webmock-3.26.2/lib/webmock/http_lib_adapters/manticore_adapter.rb +147 -0
- data/vendor/bundle/ruby/3.2.0/gems/webmock-3.26.2/lib/webmock/http_lib_adapters/net_http.rb +310 -0
- data/vendor/bundle/ruby/3.2.0/gems/webmock-3.26.2/lib/webmock/http_lib_adapters/net_http_response.rb +36 -0
- data/vendor/bundle/ruby/3.2.0/gems/webmock-3.26.2/lib/webmock/http_lib_adapters/patron_adapter.rb +132 -0
- data/vendor/bundle/ruby/3.2.0/gems/webmock-3.26.2/lib/webmock/http_lib_adapters/typhoeus_hydra_adapter.rb +190 -0
- data/vendor/bundle/ruby/3.2.0/gems/webmock-3.26.2/lib/webmock/matchers/any_arg_matcher.rb +15 -0
- data/vendor/bundle/ruby/3.2.0/gems/webmock-3.26.2/lib/webmock/matchers/hash_argument_matcher.rb +23 -0
- data/vendor/bundle/ruby/3.2.0/gems/webmock-3.26.2/lib/webmock/matchers/hash_excluding_matcher.rb +17 -0
- data/vendor/bundle/ruby/3.2.0/gems/webmock-3.26.2/lib/webmock/matchers/hash_including_matcher.rb +19 -0
- data/vendor/bundle/ruby/3.2.0/gems/webmock-3.26.2/lib/webmock/minitest.rb +43 -0
- data/vendor/bundle/ruby/3.2.0/gems/webmock-3.26.2/lib/webmock/rack_response.rb +73 -0
- data/vendor/bundle/ruby/3.2.0/gems/webmock-3.26.2/lib/webmock/request_body_diff.rb +66 -0
- data/vendor/bundle/ruby/3.2.0/gems/webmock-3.26.2/lib/webmock/request_execution_verifier.rb +79 -0
- data/vendor/bundle/ruby/3.2.0/gems/webmock-3.26.2/lib/webmock/request_pattern.rb +428 -0
- data/vendor/bundle/ruby/3.2.0/gems/webmock-3.26.2/lib/webmock/request_registry.rb +37 -0
- data/vendor/bundle/ruby/3.2.0/gems/webmock-3.26.2/lib/webmock/request_signature.rb +56 -0
- data/vendor/bundle/ruby/3.2.0/gems/webmock-3.26.2/lib/webmock/request_signature_snippet.rb +63 -0
- data/vendor/bundle/ruby/3.2.0/gems/webmock-3.26.2/lib/webmock/request_stub.rb +134 -0
- data/vendor/bundle/ruby/3.2.0/gems/webmock-3.26.2/lib/webmock/response.rb +161 -0
- data/vendor/bundle/ruby/3.2.0/gems/webmock-3.26.2/lib/webmock/responses_sequence.rb +42 -0
- data/vendor/bundle/ruby/3.2.0/gems/webmock-3.26.2/lib/webmock/rspec/matchers/request_pattern_matcher.rb +80 -0
- data/vendor/bundle/ruby/3.2.0/gems/webmock-3.26.2/lib/webmock/rspec/matchers/webmock_matcher.rb +69 -0
- data/vendor/bundle/ruby/3.2.0/gems/webmock-3.26.2/lib/webmock/rspec/matchers.rb +29 -0
- data/vendor/bundle/ruby/3.2.0/gems/webmock-3.26.2/lib/webmock/rspec.rb +44 -0
- data/vendor/bundle/ruby/3.2.0/gems/webmock-3.26.2/lib/webmock/stub_registry.rb +84 -0
- data/vendor/bundle/ruby/3.2.0/gems/webmock-3.26.2/lib/webmock/stub_request_snippet.rb +40 -0
- data/vendor/bundle/ruby/3.2.0/gems/webmock-3.26.2/lib/webmock/test_unit.rb +22 -0
- data/vendor/bundle/ruby/3.2.0/gems/webmock-3.26.2/lib/webmock/util/hash_counter.rb +45 -0
- data/vendor/bundle/ruby/3.2.0/gems/webmock-3.26.2/lib/webmock/util/hash_keys_stringifier.rb +27 -0
- data/vendor/bundle/ruby/3.2.0/gems/webmock-3.26.2/lib/webmock/util/hash_validator.rb +19 -0
- data/vendor/bundle/ruby/3.2.0/gems/webmock-3.26.2/lib/webmock/util/headers.rb +77 -0
- data/vendor/bundle/ruby/3.2.0/gems/webmock-3.26.2/lib/webmock/util/parsers/json.rb +72 -0
- data/vendor/bundle/ruby/3.2.0/gems/webmock-3.26.2/lib/webmock/util/parsers/parse_error.rb +7 -0
- data/vendor/bundle/ruby/3.2.0/gems/webmock-3.26.2/lib/webmock/util/parsers/xml.rb +16 -0
- data/vendor/bundle/ruby/3.2.0/gems/webmock-3.26.2/lib/webmock/util/query_mapper.rb +283 -0
- data/vendor/bundle/ruby/3.2.0/gems/webmock-3.26.2/lib/webmock/util/uri.rb +113 -0
- data/vendor/bundle/ruby/3.2.0/gems/webmock-3.26.2/lib/webmock/util/values_stringifier.rb +22 -0
- data/vendor/bundle/ruby/3.2.0/gems/webmock-3.26.2/lib/webmock/util/version_checker.rb +113 -0
- data/vendor/bundle/ruby/3.2.0/gems/webmock-3.26.2/lib/webmock/version.rb +5 -0
- data/vendor/bundle/ruby/3.2.0/gems/webmock-3.26.2/lib/webmock/webmock.rb +175 -0
- data/vendor/bundle/ruby/3.2.0/gems/webmock-3.26.2/lib/webmock.rb +61 -0
- data/vendor/bundle/ruby/3.2.0/gems/websocket-driver-0.8.0/ext/websocket-driver/Makefile +3 -3
- data/vendor/bundle/ruby/3.2.0/gems/websocket-driver-0.8.0/lib/websocket_mask.so +0 -0
- data/vendor/bundle/ruby/3.2.0/specifications/addressable-2.9.0.gemspec +29 -0
- data/vendor/bundle/ruby/3.2.0/specifications/crack-1.0.1.gemspec +27 -0
- data/vendor/bundle/ruby/3.2.0/specifications/faraday-2.14.1.gemspec +0 -0
- data/vendor/bundle/ruby/3.2.0/specifications/faraday-net_http-3.4.2.gemspec +26 -0
- data/vendor/bundle/ruby/3.2.0/specifications/hashdiff-1.2.1.gemspec +30 -0
- data/vendor/bundle/ruby/3.2.0/specifications/net-http-0.9.1.gemspec +27 -0
- data/vendor/bundle/ruby/3.2.0/specifications/public_suffix-7.0.5.gemspec +24 -0
- data/vendor/bundle/ruby/3.2.0/specifications/rexml-3.4.4.gemspec +25 -0
- data/vendor/bundle/ruby/3.2.0/specifications/webmock-3.26.2.gemspec +44 -0
- metadata +377 -2
|
@@ -0,0 +1,317 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
RSpec.describe Faraday::RackBuilder do
|
|
4
|
+
# mock handler classes
|
|
5
|
+
(Handler = Struct.new(:app)).class_eval do
|
|
6
|
+
def call(env)
|
|
7
|
+
env[:request_headers]['X-Middleware'] ||= ''
|
|
8
|
+
env[:request_headers]['X-Middleware'] += ":#{self.class.name.split('::').last}"
|
|
9
|
+
app.call(env)
|
|
10
|
+
end
|
|
11
|
+
end
|
|
12
|
+
|
|
13
|
+
class Apple < Handler
|
|
14
|
+
end
|
|
15
|
+
|
|
16
|
+
class Orange < Handler
|
|
17
|
+
end
|
|
18
|
+
|
|
19
|
+
class Banana < Handler
|
|
20
|
+
end
|
|
21
|
+
|
|
22
|
+
subject { conn.builder }
|
|
23
|
+
before { Faraday.default_adapter = :test }
|
|
24
|
+
after { Faraday.default_adapter = nil }
|
|
25
|
+
|
|
26
|
+
context 'with default stack' do
|
|
27
|
+
let(:conn) { Faraday::Connection.new }
|
|
28
|
+
|
|
29
|
+
it { expect(subject[0]).to eq(Faraday::Request.lookup_middleware(:url_encoded)) }
|
|
30
|
+
it { expect(subject.adapter).to eq(Faraday::Adapter.lookup_middleware(Faraday.default_adapter)) }
|
|
31
|
+
end
|
|
32
|
+
|
|
33
|
+
context 'with custom empty block' do
|
|
34
|
+
let(:conn) { Faraday::Connection.new {} }
|
|
35
|
+
|
|
36
|
+
it { expect(subject[0]).to be_nil }
|
|
37
|
+
it { expect(subject.adapter).to eq(Faraday::Adapter.lookup_middleware(Faraday.default_adapter)) }
|
|
38
|
+
end
|
|
39
|
+
|
|
40
|
+
context 'with custom adapter only' do
|
|
41
|
+
let(:conn) do
|
|
42
|
+
Faraday::Connection.new do |builder|
|
|
43
|
+
builder.adapter :test do |stub|
|
|
44
|
+
stub.get('/') { |_| [200, {}, ''] }
|
|
45
|
+
end
|
|
46
|
+
end
|
|
47
|
+
end
|
|
48
|
+
|
|
49
|
+
it { expect(subject[0]).to be_nil }
|
|
50
|
+
it { expect(subject.adapter).to eq(Faraday::Adapter.lookup_middleware(:test)) }
|
|
51
|
+
end
|
|
52
|
+
|
|
53
|
+
context 'with custom handler and adapter' do
|
|
54
|
+
let(:conn) do
|
|
55
|
+
Faraday::Connection.new do |builder|
|
|
56
|
+
builder.use Apple
|
|
57
|
+
builder.adapter :test do |stub|
|
|
58
|
+
stub.get('/') { |_| [200, {}, ''] }
|
|
59
|
+
end
|
|
60
|
+
end
|
|
61
|
+
end
|
|
62
|
+
|
|
63
|
+
it 'locks the stack after making a request' do
|
|
64
|
+
expect(subject.locked?).to be_falsey
|
|
65
|
+
conn.get('/')
|
|
66
|
+
expect(subject.locked?).to be_truthy
|
|
67
|
+
expect { subject.use(Orange) }.to raise_error(Faraday::RackBuilder::StackLocked)
|
|
68
|
+
end
|
|
69
|
+
|
|
70
|
+
it 'dup stack is unlocked' do
|
|
71
|
+
expect(subject.locked?).to be_falsey
|
|
72
|
+
subject.lock!
|
|
73
|
+
expect(subject.locked?).to be_truthy
|
|
74
|
+
dup = subject.dup
|
|
75
|
+
expect(dup).to eq(subject)
|
|
76
|
+
expect(dup.locked?).to be_falsey
|
|
77
|
+
end
|
|
78
|
+
|
|
79
|
+
it 'allows to compare handlers' do
|
|
80
|
+
expect(subject.handlers.first).to eq(Faraday::RackBuilder::Handler.new(Apple))
|
|
81
|
+
end
|
|
82
|
+
end
|
|
83
|
+
|
|
84
|
+
context 'when having a single handler' do
|
|
85
|
+
let(:conn) { Faraday::Connection.new {} }
|
|
86
|
+
|
|
87
|
+
before { subject.use(Apple) }
|
|
88
|
+
|
|
89
|
+
it { expect(subject.handlers).to eq([Apple]) }
|
|
90
|
+
|
|
91
|
+
it 'allows use' do
|
|
92
|
+
subject.use(Orange)
|
|
93
|
+
expect(subject.handlers).to eq([Apple, Orange])
|
|
94
|
+
end
|
|
95
|
+
|
|
96
|
+
it 'allows insert_before' do
|
|
97
|
+
subject.insert_before(Apple, Orange)
|
|
98
|
+
expect(subject.handlers).to eq([Orange, Apple])
|
|
99
|
+
end
|
|
100
|
+
|
|
101
|
+
it 'allows insert_after' do
|
|
102
|
+
subject.insert_after(Apple, Orange)
|
|
103
|
+
expect(subject.handlers).to eq([Apple, Orange])
|
|
104
|
+
end
|
|
105
|
+
|
|
106
|
+
it 'raises an error trying to use an unregistered symbol' do
|
|
107
|
+
expect { subject.use(:apple) }.to raise_error(Faraday::Error) do |err|
|
|
108
|
+
expect(err.message).to eq(':apple is not registered on Faraday::Middleware')
|
|
109
|
+
end
|
|
110
|
+
end
|
|
111
|
+
end
|
|
112
|
+
|
|
113
|
+
context 'when having two handlers' do
|
|
114
|
+
let(:conn) { Faraday::Connection.new {} }
|
|
115
|
+
|
|
116
|
+
before do
|
|
117
|
+
subject.use(Apple)
|
|
118
|
+
subject.use(Orange)
|
|
119
|
+
end
|
|
120
|
+
|
|
121
|
+
it 'allows insert_before' do
|
|
122
|
+
subject.insert_before(Orange, Banana)
|
|
123
|
+
expect(subject.handlers).to eq([Apple, Banana, Orange])
|
|
124
|
+
end
|
|
125
|
+
|
|
126
|
+
it 'allows insert_after' do
|
|
127
|
+
subject.insert_after(Apple, Banana)
|
|
128
|
+
expect(subject.handlers).to eq([Apple, Banana, Orange])
|
|
129
|
+
end
|
|
130
|
+
|
|
131
|
+
it 'allows to swap handlers' do
|
|
132
|
+
subject.swap(Apple, Banana)
|
|
133
|
+
expect(subject.handlers).to eq([Banana, Orange])
|
|
134
|
+
end
|
|
135
|
+
|
|
136
|
+
it 'allows to delete a handler' do
|
|
137
|
+
subject.delete(Apple)
|
|
138
|
+
expect(subject.handlers).to eq([Orange])
|
|
139
|
+
end
|
|
140
|
+
end
|
|
141
|
+
|
|
142
|
+
context 'when adapter is added with named options' do
|
|
143
|
+
after { Faraday.default_adapter_options = {} }
|
|
144
|
+
let(:conn) { Faraday::Connection.new {} }
|
|
145
|
+
|
|
146
|
+
let(:cat_adapter) do
|
|
147
|
+
Class.new(Faraday::Adapter) do
|
|
148
|
+
attr_accessor :name
|
|
149
|
+
|
|
150
|
+
def initialize(app, name:)
|
|
151
|
+
super(app)
|
|
152
|
+
@name = name
|
|
153
|
+
end
|
|
154
|
+
end
|
|
155
|
+
end
|
|
156
|
+
|
|
157
|
+
let(:cat) { subject.adapter.build }
|
|
158
|
+
|
|
159
|
+
it 'adds a handler to construct adapter with named options' do
|
|
160
|
+
Faraday.default_adapter = cat_adapter
|
|
161
|
+
Faraday.default_adapter_options = { name: 'Chloe' }
|
|
162
|
+
expect { cat }.to_not output(
|
|
163
|
+
/warning: Using the last argument as keyword parameters is deprecated/
|
|
164
|
+
).to_stderr
|
|
165
|
+
expect(cat.name).to eq 'Chloe'
|
|
166
|
+
end
|
|
167
|
+
end
|
|
168
|
+
|
|
169
|
+
context 'when middleware is added with named arguments' do
|
|
170
|
+
let(:conn) { Faraday::Connection.new {} }
|
|
171
|
+
|
|
172
|
+
let(:dog_middleware) do
|
|
173
|
+
Class.new(Faraday::Middleware) do
|
|
174
|
+
attr_accessor :name
|
|
175
|
+
|
|
176
|
+
def initialize(app, name:)
|
|
177
|
+
super(app)
|
|
178
|
+
@name = name
|
|
179
|
+
end
|
|
180
|
+
end
|
|
181
|
+
end
|
|
182
|
+
let(:dog) do
|
|
183
|
+
subject.handlers.find { |handler| handler == dog_middleware }.build
|
|
184
|
+
end
|
|
185
|
+
|
|
186
|
+
it 'adds a handler to construct middleware with options passed to use' do
|
|
187
|
+
subject.use dog_middleware, name: 'Rex'
|
|
188
|
+
expect { dog }.to_not output(
|
|
189
|
+
/warning: Using the last argument as keyword parameters is deprecated/
|
|
190
|
+
).to_stderr
|
|
191
|
+
expect(dog.name).to eq('Rex')
|
|
192
|
+
end
|
|
193
|
+
end
|
|
194
|
+
|
|
195
|
+
context 'when a middleware is added with named arguments' do
|
|
196
|
+
let(:conn) { Faraday::Connection.new {} }
|
|
197
|
+
|
|
198
|
+
let(:cat_request) do
|
|
199
|
+
Class.new(Faraday::Middleware) do
|
|
200
|
+
attr_accessor :name
|
|
201
|
+
|
|
202
|
+
def initialize(app, name:)
|
|
203
|
+
super(app)
|
|
204
|
+
@name = name
|
|
205
|
+
end
|
|
206
|
+
end
|
|
207
|
+
end
|
|
208
|
+
let(:cat) do
|
|
209
|
+
subject.handlers.find { |handler| handler == cat_request }.build
|
|
210
|
+
end
|
|
211
|
+
|
|
212
|
+
it 'adds a handler to construct request adapter with options passed to request' do
|
|
213
|
+
Faraday::Request.register_middleware cat_request: cat_request
|
|
214
|
+
subject.request :cat_request, name: 'Felix'
|
|
215
|
+
expect { cat }.to_not output(
|
|
216
|
+
/warning: Using the last argument as keyword parameters is deprecated/
|
|
217
|
+
).to_stderr
|
|
218
|
+
expect(cat.name).to eq('Felix')
|
|
219
|
+
end
|
|
220
|
+
end
|
|
221
|
+
|
|
222
|
+
context 'when a middleware is added with named arguments' do
|
|
223
|
+
let(:conn) { Faraday::Connection.new {} }
|
|
224
|
+
|
|
225
|
+
let(:fish_response) do
|
|
226
|
+
Class.new(Faraday::Middleware) do
|
|
227
|
+
attr_accessor :name
|
|
228
|
+
|
|
229
|
+
def initialize(app, name:)
|
|
230
|
+
super(app)
|
|
231
|
+
@name = name
|
|
232
|
+
end
|
|
233
|
+
end
|
|
234
|
+
end
|
|
235
|
+
let(:fish) do
|
|
236
|
+
subject.handlers.find { |handler| handler == fish_response }.build
|
|
237
|
+
end
|
|
238
|
+
|
|
239
|
+
it 'adds a handler to construct response adapter with options passed to response' do
|
|
240
|
+
Faraday::Response.register_middleware fish_response: fish_response
|
|
241
|
+
subject.response :fish_response, name: 'Bubbles'
|
|
242
|
+
expect { fish }.to_not output(
|
|
243
|
+
/warning: Using the last argument as keyword parameters is deprecated/
|
|
244
|
+
).to_stderr
|
|
245
|
+
expect(fish.name).to eq('Bubbles')
|
|
246
|
+
end
|
|
247
|
+
end
|
|
248
|
+
|
|
249
|
+
context 'when a plain adapter is added with named arguments' do
|
|
250
|
+
let(:conn) { Faraday::Connection.new {} }
|
|
251
|
+
|
|
252
|
+
let(:rabbit_adapter) do
|
|
253
|
+
Class.new(Faraday::Adapter) do
|
|
254
|
+
attr_accessor :name
|
|
255
|
+
|
|
256
|
+
def initialize(app, name:)
|
|
257
|
+
super(app)
|
|
258
|
+
@name = name
|
|
259
|
+
end
|
|
260
|
+
end
|
|
261
|
+
end
|
|
262
|
+
let(:rabbit) do
|
|
263
|
+
subject.adapter.build
|
|
264
|
+
end
|
|
265
|
+
|
|
266
|
+
it 'adds a handler to construct adapter with options passed to adapter' do
|
|
267
|
+
Faraday::Adapter.register_middleware rabbit_adapter: rabbit_adapter
|
|
268
|
+
subject.adapter :rabbit_adapter, name: 'Thumper'
|
|
269
|
+
expect { rabbit }.to_not output(
|
|
270
|
+
/warning: Using the last argument as keyword parameters is deprecated/
|
|
271
|
+
).to_stderr
|
|
272
|
+
expect(rabbit.name).to eq('Thumper')
|
|
273
|
+
end
|
|
274
|
+
end
|
|
275
|
+
|
|
276
|
+
context 'when handlers are directly added or updated' do
|
|
277
|
+
let(:conn) { Faraday::Connection.new {} }
|
|
278
|
+
|
|
279
|
+
let(:rock_handler) do
|
|
280
|
+
Class.new do
|
|
281
|
+
attr_accessor :name
|
|
282
|
+
|
|
283
|
+
def initialize(_app, name:)
|
|
284
|
+
@name = name
|
|
285
|
+
end
|
|
286
|
+
end
|
|
287
|
+
end
|
|
288
|
+
let(:rock) do
|
|
289
|
+
subject.handlers.find { |handler| handler == rock_handler }.build
|
|
290
|
+
end
|
|
291
|
+
|
|
292
|
+
it 'adds a handler to construct adapter with options passed to insert' do
|
|
293
|
+
subject.insert 0, rock_handler, name: 'Stony'
|
|
294
|
+
expect { rock }.to_not output(
|
|
295
|
+
/warning: Using the last argument as keyword parameters is deprecated/
|
|
296
|
+
).to_stderr
|
|
297
|
+
expect(rock.name).to eq('Stony')
|
|
298
|
+
end
|
|
299
|
+
|
|
300
|
+
it 'adds a handler with options passed to insert_after' do
|
|
301
|
+
subject.insert_after 0, rock_handler, name: 'Rocky'
|
|
302
|
+
expect { rock }.to_not output(
|
|
303
|
+
/warning: Using the last argument as keyword parameters is deprecated/
|
|
304
|
+
).to_stderr
|
|
305
|
+
expect(rock.name).to eq('Rocky')
|
|
306
|
+
end
|
|
307
|
+
|
|
308
|
+
it 'adds a handler with options passed to swap' do
|
|
309
|
+
subject.insert 0, rock_handler, name: 'Flint'
|
|
310
|
+
subject.swap 0, rock_handler, name: 'Chert'
|
|
311
|
+
expect { rock }.to_not output(
|
|
312
|
+
/warning: Using the last argument as keyword parameters is deprecated/
|
|
313
|
+
).to_stderr
|
|
314
|
+
expect(rock.name).to eq('Chert')
|
|
315
|
+
end
|
|
316
|
+
end
|
|
317
|
+
end
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
RSpec.describe Faraday::Request::Authorization do
|
|
4
|
+
let(:conn) do
|
|
5
|
+
Faraday.new do |b|
|
|
6
|
+
b.request :authorization, auth_type, *auth_config
|
|
7
|
+
b.adapter :test do |stub|
|
|
8
|
+
stub.get('/auth-echo') do |env|
|
|
9
|
+
[200, {}, env[:request_headers]['Authorization']]
|
|
10
|
+
end
|
|
11
|
+
end
|
|
12
|
+
end
|
|
13
|
+
end
|
|
14
|
+
|
|
15
|
+
shared_examples 'does not interfere with existing authentication' do
|
|
16
|
+
context 'and request already has an authentication header' do
|
|
17
|
+
let(:response) { conn.get('/auth-echo', nil, authorization: 'OAuth oauth_token') }
|
|
18
|
+
|
|
19
|
+
it 'does not interfere with existing authorization' do
|
|
20
|
+
expect(response.body).to eq('OAuth oauth_token')
|
|
21
|
+
end
|
|
22
|
+
end
|
|
23
|
+
end
|
|
24
|
+
|
|
25
|
+
let(:response) { conn.get('/auth-echo') }
|
|
26
|
+
|
|
27
|
+
describe 'basic_auth' do
|
|
28
|
+
let(:auth_type) { :basic }
|
|
29
|
+
|
|
30
|
+
context 'when passed correct params' do
|
|
31
|
+
let(:auth_config) { %w[aladdin opensesame] }
|
|
32
|
+
|
|
33
|
+
it { expect(response.body).to eq('Basic YWxhZGRpbjpvcGVuc2VzYW1l') }
|
|
34
|
+
|
|
35
|
+
include_examples 'does not interfere with existing authentication'
|
|
36
|
+
end
|
|
37
|
+
|
|
38
|
+
context 'when passed very long values' do
|
|
39
|
+
let(:auth_config) { ['A' * 255, ''] }
|
|
40
|
+
|
|
41
|
+
it { expect(response.body).to eq("Basic #{'QUFB' * 85}Og==") }
|
|
42
|
+
|
|
43
|
+
include_examples 'does not interfere with existing authentication'
|
|
44
|
+
end
|
|
45
|
+
end
|
|
46
|
+
|
|
47
|
+
describe 'authorization' do
|
|
48
|
+
let(:auth_type) { :Bearer }
|
|
49
|
+
|
|
50
|
+
context 'when passed a string' do
|
|
51
|
+
let(:auth_config) { ['custom'] }
|
|
52
|
+
|
|
53
|
+
it { expect(response.body).to eq('Bearer custom') }
|
|
54
|
+
|
|
55
|
+
include_examples 'does not interfere with existing authentication'
|
|
56
|
+
end
|
|
57
|
+
|
|
58
|
+
context 'when passed a proc' do
|
|
59
|
+
let(:auth_config) { [-> { 'custom_from_proc' }] }
|
|
60
|
+
|
|
61
|
+
it { expect(response.body).to eq('Bearer custom_from_proc') }
|
|
62
|
+
|
|
63
|
+
include_examples 'does not interfere with existing authentication'
|
|
64
|
+
end
|
|
65
|
+
|
|
66
|
+
context 'when passed a callable' do
|
|
67
|
+
let(:callable) { double('Callable Authorizer', call: 'custom_from_callable') }
|
|
68
|
+
let(:auth_config) { [callable] }
|
|
69
|
+
|
|
70
|
+
it { expect(response.body).to eq('Bearer custom_from_callable') }
|
|
71
|
+
|
|
72
|
+
include_examples 'does not interfere with existing authentication'
|
|
73
|
+
end
|
|
74
|
+
|
|
75
|
+
context 'with an argument' do
|
|
76
|
+
let(:response) { conn.get('/auth-echo', nil, 'middle' => 'crunchy surprise') }
|
|
77
|
+
|
|
78
|
+
context 'when passed a proc' do
|
|
79
|
+
let(:auth_config) { [proc { |env| "proc #{env.request_headers['middle']}" }] }
|
|
80
|
+
|
|
81
|
+
it { expect(response.body).to eq('Bearer proc crunchy surprise') }
|
|
82
|
+
|
|
83
|
+
include_examples 'does not interfere with existing authentication'
|
|
84
|
+
end
|
|
85
|
+
|
|
86
|
+
context 'when passed a lambda' do
|
|
87
|
+
let(:auth_config) { [->(env) { "lambda #{env.request_headers['middle']}" }] }
|
|
88
|
+
|
|
89
|
+
it { expect(response.body).to eq('Bearer lambda crunchy surprise') }
|
|
90
|
+
|
|
91
|
+
include_examples 'does not interfere with existing authentication'
|
|
92
|
+
end
|
|
93
|
+
|
|
94
|
+
context 'when passed a callable with an argument' do
|
|
95
|
+
let(:callable) do
|
|
96
|
+
Class.new do
|
|
97
|
+
def call(env)
|
|
98
|
+
"callable #{env.request_headers['middle']}"
|
|
99
|
+
end
|
|
100
|
+
end.new
|
|
101
|
+
end
|
|
102
|
+
let(:auth_config) { [callable] }
|
|
103
|
+
|
|
104
|
+
it { expect(response.body).to eq('Bearer callable crunchy surprise') }
|
|
105
|
+
|
|
106
|
+
include_examples 'does not interfere with existing authentication'
|
|
107
|
+
end
|
|
108
|
+
end
|
|
109
|
+
|
|
110
|
+
context 'when passed too many arguments' do
|
|
111
|
+
let(:auth_config) { %w[baz foo] }
|
|
112
|
+
|
|
113
|
+
it { expect { response }.to raise_error(ArgumentError) }
|
|
114
|
+
|
|
115
|
+
include_examples 'does not interfere with existing authentication'
|
|
116
|
+
end
|
|
117
|
+
end
|
|
118
|
+
end
|
data/vendor/bundle/ruby/3.2.0/gems/faraday-2.14.1/spec/faraday/request/instrumentation_spec.rb
ADDED
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
RSpec.describe Faraday::Request::Instrumentation do
|
|
4
|
+
class FakeInstrumenter
|
|
5
|
+
attr_reader :instrumentations
|
|
6
|
+
|
|
7
|
+
def initialize
|
|
8
|
+
@instrumentations = []
|
|
9
|
+
end
|
|
10
|
+
|
|
11
|
+
def instrument(name, env)
|
|
12
|
+
@instrumentations << [name, env]
|
|
13
|
+
yield
|
|
14
|
+
end
|
|
15
|
+
end
|
|
16
|
+
|
|
17
|
+
let(:config) { {} }
|
|
18
|
+
let(:options) { Faraday::Request::Instrumentation::Options.from config }
|
|
19
|
+
let(:instrumenter) { FakeInstrumenter.new }
|
|
20
|
+
let(:conn) do
|
|
21
|
+
Faraday.new do |f|
|
|
22
|
+
f.request :instrumentation, config.merge(instrumenter: instrumenter)
|
|
23
|
+
f.adapter :test do |stub|
|
|
24
|
+
stub.get '/' do
|
|
25
|
+
[200, {}, 'ok']
|
|
26
|
+
end
|
|
27
|
+
end
|
|
28
|
+
end
|
|
29
|
+
end
|
|
30
|
+
|
|
31
|
+
it { expect(options.name).to eq('request.faraday') }
|
|
32
|
+
it 'defaults to ActiveSupport::Notifications' do
|
|
33
|
+
res = options.instrumenter
|
|
34
|
+
rescue NameError => e
|
|
35
|
+
expect(e.to_s).to match('ActiveSupport')
|
|
36
|
+
else
|
|
37
|
+
expect(res).to eq(ActiveSupport::Notifications)
|
|
38
|
+
end
|
|
39
|
+
|
|
40
|
+
it 'instruments with default name' do
|
|
41
|
+
expect(instrumenter.instrumentations.size).to eq(0)
|
|
42
|
+
|
|
43
|
+
res = conn.get '/'
|
|
44
|
+
expect(res.body).to eq('ok')
|
|
45
|
+
expect(instrumenter.instrumentations.size).to eq(1)
|
|
46
|
+
|
|
47
|
+
name, env = instrumenter.instrumentations.first
|
|
48
|
+
expect(name).to eq('request.faraday')
|
|
49
|
+
expect(env[:url].path).to eq('/')
|
|
50
|
+
end
|
|
51
|
+
|
|
52
|
+
context 'with custom name' do
|
|
53
|
+
let(:config) { { name: 'custom' } }
|
|
54
|
+
|
|
55
|
+
it { expect(options.name).to eq('custom') }
|
|
56
|
+
it 'instruments with custom name' do
|
|
57
|
+
expect(instrumenter.instrumentations.size).to eq(0)
|
|
58
|
+
|
|
59
|
+
res = conn.get '/'
|
|
60
|
+
expect(res.body).to eq('ok')
|
|
61
|
+
expect(instrumenter.instrumentations.size).to eq(1)
|
|
62
|
+
|
|
63
|
+
name, env = instrumenter.instrumentations.first
|
|
64
|
+
expect(name).to eq('custom')
|
|
65
|
+
expect(env[:url].path).to eq('/')
|
|
66
|
+
end
|
|
67
|
+
end
|
|
68
|
+
|
|
69
|
+
context 'with custom instrumenter' do
|
|
70
|
+
let(:config) { { instrumenter: :custom } }
|
|
71
|
+
|
|
72
|
+
it { expect(options.instrumenter).to eq(:custom) }
|
|
73
|
+
end
|
|
74
|
+
end
|
|
@@ -0,0 +1,199 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
RSpec.describe Faraday::Request::Json do
|
|
4
|
+
let(:middleware) { described_class.new(->(env) { Faraday::Response.new(env) }) }
|
|
5
|
+
|
|
6
|
+
def process(body, content_type = nil)
|
|
7
|
+
env = { body: body, request_headers: Faraday::Utils::Headers.new }
|
|
8
|
+
env[:request_headers]['content-type'] = content_type if content_type
|
|
9
|
+
middleware.call(Faraday::Env.from(env)).env
|
|
10
|
+
end
|
|
11
|
+
|
|
12
|
+
def result_body
|
|
13
|
+
result[:body]
|
|
14
|
+
end
|
|
15
|
+
|
|
16
|
+
def result_type
|
|
17
|
+
result[:request_headers]['content-type']
|
|
18
|
+
end
|
|
19
|
+
|
|
20
|
+
context 'no body' do
|
|
21
|
+
let(:result) { process(nil) }
|
|
22
|
+
|
|
23
|
+
it "doesn't change body" do
|
|
24
|
+
expect(result_body).to be_nil
|
|
25
|
+
end
|
|
26
|
+
|
|
27
|
+
it "doesn't add content type" do
|
|
28
|
+
expect(result_type).to be_nil
|
|
29
|
+
end
|
|
30
|
+
end
|
|
31
|
+
|
|
32
|
+
context 'empty body' do
|
|
33
|
+
let(:result) { process('') }
|
|
34
|
+
|
|
35
|
+
it "doesn't change body" do
|
|
36
|
+
expect(result_body).to be_empty
|
|
37
|
+
end
|
|
38
|
+
|
|
39
|
+
it "doesn't add content type" do
|
|
40
|
+
expect(result_type).to be_nil
|
|
41
|
+
end
|
|
42
|
+
end
|
|
43
|
+
|
|
44
|
+
context 'string body' do
|
|
45
|
+
let(:result) { process('{"a":1}') }
|
|
46
|
+
|
|
47
|
+
it "doesn't change body" do
|
|
48
|
+
expect(result_body).to eq('{"a":1}')
|
|
49
|
+
end
|
|
50
|
+
|
|
51
|
+
it 'adds content type' do
|
|
52
|
+
expect(result_type).to eq('application/json')
|
|
53
|
+
end
|
|
54
|
+
end
|
|
55
|
+
|
|
56
|
+
context 'object body' do
|
|
57
|
+
let(:result) { process(a: 1) }
|
|
58
|
+
|
|
59
|
+
it 'encodes body' do
|
|
60
|
+
expect(result_body).to eq('{"a":1}')
|
|
61
|
+
end
|
|
62
|
+
|
|
63
|
+
it 'adds content type' do
|
|
64
|
+
expect(result_type).to eq('application/json')
|
|
65
|
+
end
|
|
66
|
+
end
|
|
67
|
+
|
|
68
|
+
context 'empty object body' do
|
|
69
|
+
let(:result) { process({}) }
|
|
70
|
+
|
|
71
|
+
it 'encodes body' do
|
|
72
|
+
expect(result_body).to eq('{}')
|
|
73
|
+
end
|
|
74
|
+
end
|
|
75
|
+
|
|
76
|
+
context 'true body' do
|
|
77
|
+
let(:result) { process(true) }
|
|
78
|
+
|
|
79
|
+
it 'encodes body' do
|
|
80
|
+
expect(result_body).to eq('true')
|
|
81
|
+
end
|
|
82
|
+
|
|
83
|
+
it 'adds content type' do
|
|
84
|
+
expect(result_type).to eq('application/json')
|
|
85
|
+
end
|
|
86
|
+
end
|
|
87
|
+
|
|
88
|
+
context 'false body' do
|
|
89
|
+
let(:result) { process(false) }
|
|
90
|
+
|
|
91
|
+
it 'encodes body' do
|
|
92
|
+
expect(result_body).to eq('false')
|
|
93
|
+
end
|
|
94
|
+
|
|
95
|
+
it 'adds content type' do
|
|
96
|
+
expect(result_type).to eq('application/json')
|
|
97
|
+
end
|
|
98
|
+
end
|
|
99
|
+
|
|
100
|
+
context 'object body with json type' do
|
|
101
|
+
let(:result) { process({ a: 1 }, 'application/json; charset=utf-8') }
|
|
102
|
+
|
|
103
|
+
it 'encodes body' do
|
|
104
|
+
expect(result_body).to eq('{"a":1}')
|
|
105
|
+
end
|
|
106
|
+
|
|
107
|
+
it "doesn't change content type" do
|
|
108
|
+
expect(result_type).to eq('application/json; charset=utf-8')
|
|
109
|
+
end
|
|
110
|
+
end
|
|
111
|
+
|
|
112
|
+
context 'object body with vendor json type' do
|
|
113
|
+
let(:result) { process({ a: 1 }, 'application/vnd.myapp.v1+json; charset=utf-8') }
|
|
114
|
+
|
|
115
|
+
it 'encodes body' do
|
|
116
|
+
expect(result_body).to eq('{"a":1}')
|
|
117
|
+
end
|
|
118
|
+
|
|
119
|
+
it "doesn't change content type" do
|
|
120
|
+
expect(result_type).to eq('application/vnd.myapp.v1+json; charset=utf-8')
|
|
121
|
+
end
|
|
122
|
+
end
|
|
123
|
+
|
|
124
|
+
context 'object body with incompatible type' do
|
|
125
|
+
let(:result) { process({ a: 1 }, 'application/xml; charset=utf-8') }
|
|
126
|
+
|
|
127
|
+
it "doesn't change body" do
|
|
128
|
+
expect(result_body).to eq(a: 1)
|
|
129
|
+
end
|
|
130
|
+
|
|
131
|
+
it "doesn't change content type" do
|
|
132
|
+
expect(result_type).to eq('application/xml; charset=utf-8')
|
|
133
|
+
end
|
|
134
|
+
end
|
|
135
|
+
|
|
136
|
+
context 'with encoder' do
|
|
137
|
+
let(:encoder) do
|
|
138
|
+
double('Encoder').tap do |e|
|
|
139
|
+
allow(e).to receive(:dump) { |s, opts| JSON.generate(s, opts) }
|
|
140
|
+
end
|
|
141
|
+
end
|
|
142
|
+
|
|
143
|
+
let(:result) { process(a: 1) }
|
|
144
|
+
|
|
145
|
+
context 'when encoder is passed as object' do
|
|
146
|
+
let(:middleware) { described_class.new(->(env) { Faraday::Response.new(env) }, { encoder: encoder }) }
|
|
147
|
+
|
|
148
|
+
it 'calls specified JSON encoder\'s dump method' do
|
|
149
|
+
expect(encoder).to receive(:dump).with({ a: 1 })
|
|
150
|
+
|
|
151
|
+
result
|
|
152
|
+
end
|
|
153
|
+
|
|
154
|
+
it 'encodes body' do
|
|
155
|
+
expect(result_body).to eq('{"a":1}')
|
|
156
|
+
end
|
|
157
|
+
|
|
158
|
+
it 'adds content type' do
|
|
159
|
+
expect(result_type).to eq('application/json')
|
|
160
|
+
end
|
|
161
|
+
end
|
|
162
|
+
|
|
163
|
+
context 'when encoder is passed as an object-method pair' do
|
|
164
|
+
let(:middleware) { described_class.new(->(env) { Faraday::Response.new(env) }, { encoder: [encoder, :dump] }) }
|
|
165
|
+
|
|
166
|
+
it 'calls specified JSON encoder' do
|
|
167
|
+
expect(encoder).to receive(:dump).with({ a: 1 })
|
|
168
|
+
|
|
169
|
+
result
|
|
170
|
+
end
|
|
171
|
+
|
|
172
|
+
it 'encodes body' do
|
|
173
|
+
expect(result_body).to eq('{"a":1}')
|
|
174
|
+
end
|
|
175
|
+
|
|
176
|
+
it 'adds content type' do
|
|
177
|
+
expect(result_type).to eq('application/json')
|
|
178
|
+
end
|
|
179
|
+
end
|
|
180
|
+
|
|
181
|
+
context 'when encoder is not passed' do
|
|
182
|
+
let(:middleware) { described_class.new(->(env) { Faraday::Response.new(env) }) }
|
|
183
|
+
|
|
184
|
+
it 'calls JSON.generate' do
|
|
185
|
+
expect(JSON).to receive(:generate).with({ a: 1 })
|
|
186
|
+
|
|
187
|
+
result
|
|
188
|
+
end
|
|
189
|
+
|
|
190
|
+
it 'encodes body' do
|
|
191
|
+
expect(result_body).to eq('{"a":1}')
|
|
192
|
+
end
|
|
193
|
+
|
|
194
|
+
it 'adds content type' do
|
|
195
|
+
expect(result_type).to eq('application/json')
|
|
196
|
+
end
|
|
197
|
+
end
|
|
198
|
+
end
|
|
199
|
+
end
|