Relax version constraint on Faraday
This PR allows Faraday version 2.
that would be helpful, we plan to upgrade faraday to v2 soon
Hi, it would be great if this could be considered for a merge. Faraday 2 is quite stable and the latest version is 2.5.2. We'd like very much to upgrade our faraday, but can't because we also need this gem.
Let me know if we can help please!
@chayuto Not sure if you're a maintainer here - if you are, could I ask for a quick response? I'd be happy to help make this happen if you tell me what you need. Otherwise we'll have to fork and do it ourselves, just to not get stuck on a severely outdated faraday version. I'd rather not :)
Thank you!
Hey all, a quick update here. I was just looking at this last week. It's on my shortlist to get resolved and I'll be working on it when I return after Thanksgiving as part of a larger effort to tackle our backlog of PRs and issues.
Hey all, just an update here. In testing this locally using our ruby sample app, I'm encountering the following error:
Faraday::Error at /callback :basic_auth is not registered on Faraday::Request
It's coming from api_client.rb line 306:
connection = Faraday.new(:url => method_base_url, :ssl => ssl_options) do |conn|
conn.request(:basic_auth, config.username, config.password)
if opts[:header_params]["Content-Type"] == "multipart/form-data"
conn.request :multipart
conn.request :url_encoded
end
Looks like a known issue.
Working my way through the suggested solutions:
- https://github.com/lostisland/faraday/blob/b2390ec2b3f35c2d9a1010527b139aefc85fcede/UPGRADING.md#authentication-helper-methods-in-connection-have-been-removed
- https://lostisland.github.io/faraday/middleware/authentication
If any of you have already encountered/resolved this in your own projects and feel like adding to this PR with the fix, please do. We'd welcome the community contribution 🙂
In other projects I've done something like
conn = Faraday.new(
url: "https://example.com",
headers: { "Authorization" => "Basic #{Base64.strict_encode64("#{username}:#{password}")}" }
)
Looks like this was all it needed... 😆
Old:
conn.request(:basic_auth, config.username, config.password)
New:
conn.request(:authorization, :basic, config.username, config.password)