@@ -297,6 +297,11 @@ def #{method}(url = nil, body = nil, headers = nil, &block)
297297 #
298298 # @return [void]
299299 def basic_auth ( login , pass )
300+ warn <<~TEXT
301+ WARNING: `Faraday::Connection#basic_auth` is deprecated; it will be removed in version 2.0.
302+ While initializing your connection, use `#request(:basic_auth, ...)` instead.
303+ See https://lostisland.github.io/faraday/middleware/authentication for more usage info.
304+ TEXT
300305 set_authorization_header ( :basic_auth , login , pass )
301306 end
302307
@@ -314,6 +319,11 @@ def basic_auth(login, pass)
314319 #
315320 # @return [void]
316321 def token_auth ( token , options = nil )
322+ warn <<~TEXT
323+ WARNING: `Faraday::Connection#token_auth` is deprecated; it will be removed in version 2.0.
324+ While initializing your connection, use `#request(:token_auth, ...)` instead.
325+ See https://lostisland.github.io/faraday/middleware/authentication for more usage info.
326+ TEXT
317327 set_authorization_header ( :token_auth , token , options )
318328 end
319329
@@ -336,6 +346,11 @@ def token_auth(token, options = nil)
336346 #
337347 # @return [void]
338348 def authorization ( type , token )
349+ warn <<~TEXT
350+ WARNING: `Faraday::Connection#authorization` is deprecated; it will be removed in version 2.0.
351+ While initializing your connection, use `#request(:authorization, ...)` instead.
352+ See https://lostisland.github.io/faraday/middleware/authentication for more usage info.
353+ TEXT
339354 set_authorization_header ( :authorization , type , token )
340355 end
341356
0 commit comments