elastic/elasticsearch-ruby

elasticsearch-transport: Faraday::Connection#basic_auth is deprecated

tagliala opened this issue · 2 comments

Hi,

I've updated Faraday from 1.7.0 to 1.7.1 and I'm getting this deprecation warning from elasticsearch-transport, when the elasticsearch endpoint is authenticated through basic auth embedded in the url, http://test:deprecation@localhost:9200:

client = ::Faraday.new(__full_url(host), options, &block)

$ rails c
WARNING: `Faraday::Connection#basic_auth` is deprecated; it will be removed in version 2.0.
While initializing your connection, use `#request(:basic_auth, ...)` instead.
See https://lostisland.github.io/faraday/middleware/authentication for more usage info.

Versions:

ruby: 2.7.2
rails: 6.1.4.1
elasticsearch-rails: 7.2.0
elasticsearch-transport: 7.14.0

Ref: lostisland/faraday#1306

Hi @tagliala, thanks for reporting this!

I'm following the issue in Faraday, see if the support for basic auth in URLs is dropped. But I may update the client anyway to maybe send the auth header instead of depending on Faraday for this.

Closing this issue as it's been addressed upstream and it's fixed for Faraday v1.7.2 🙌