Bump to Faraday 2

Faraday 2 was released in early 2022. As part of this major release,
authentication helper methods (such as basic_auth) were removed from the
Connection object and into middleware.

This commit updates vmfloaty's dependency on Faraday to ~> 2 and updates
the Http class to use the new authentication middleware.

This upgrade is helpful because, in a CI context, vmfloaty is often
installed alongside other gems that use Faraday >= 2, and vmfloaty's
current dependency on Faraday ~> 1.5, >= 1.5.1 can cause unexpected
dependency resolution.

You can read more about this unexpected dependency behavior in this
GitHub issue: https://github.com/puppetlabs/orchestrator_client-ruby/issues/41
This commit is contained in:
Michael Hashizume 2025-11-03 12:19:52 -08:00
parent 6b6d6f73cd
commit b9562bc9eb
3 changed files with 53 additions and 63 deletions

View file

@ -37,7 +37,7 @@ class Http
Faraday.new(url: url, ssl: { verify: false }) do |faraday|
faraday.request :url_encoded
faraday.request :basic_auth, user, password
faraday.request :authorization, :basic, user, password
faraday.response :logger if verbose
faraday.adapter Faraday.default_adapter
end