diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 02f0440..37e4745 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -12,7 +12,6 @@ jobs: strategy: matrix: ruby-version: - - '2.7' - '3.0' - '3.1' rails-version: diff --git a/lib/manageiq/api/client.rb b/lib/manageiq/api/client.rb index c8ac0ec..b61678d 100644 --- a/lib/manageiq/api/client.rb +++ b/lib/manageiq/api/client.rb @@ -1,7 +1,7 @@ require "active_support" require "active_support/core_ext" require "faraday" -require "faraday_middleware" +require "faraday/follow_redirects" require 'forwardable' require "json" require "query_relation" diff --git a/lib/manageiq/api/client/connection.rb b/lib/manageiq/api/client/connection.rb index 5043245..7a89d3e 100644 --- a/lib/manageiq/api/client/connection.rb +++ b/lib/manageiq/api/client/connection.rb @@ -76,10 +76,11 @@ def handle faraday.options.open_timeout = @connection_options[:open_timeout] if @connection_options[:open_timeout] faraday.options.timeout = @connection_options[:timeout] if @connection_options[:timeout] faraday.response(:logger, client.logger) - faraday.use FaradayMiddleware::FollowRedirects, :limit => 3, :standards_compliant => true - faraday.adapter(Faraday.default_adapter) # make requests with Net::HTTP + faraday.response(:follow_redirects, :limit => 3, :standards_compliant => true) + # make requests with Net::HTTP + faraday.adapter(Faraday.default_adapter) if authentication.token.blank? && authentication.miqtoken.blank? && authentication.bearer_token.blank? - faraday.basic_auth(authentication.user, authentication.password) + faraday.request(:authorization, :basic, authentication.user, authentication.password) end end end diff --git a/manageiq-api-client.gemspec b/manageiq-api-client.gemspec index 2db7d0a..7e000cf 100644 --- a/manageiq-api-client.gemspec +++ b/manageiq-api-client.gemspec @@ -24,8 +24,8 @@ Gem::Specification.new do |spec| spec.require_paths = ["lib"] spec.add_dependency "activesupport", ">= 6.0", "<7.1" - spec.add_dependency "faraday", "~> 1.0" - spec.add_dependency "faraday_middleware", "~> 1.0" + spec.add_dependency "faraday", "~> 2.9" + spec.add_dependency "faraday-follow_redirects" spec.add_dependency "json", "~> 2.3" spec.add_dependency "query_relation"