tpitale / mail_room

Forward mail from gmail IMAP to a callback URL or job worker, simply.
MIT License
195 stars 51 forks source link

Enable token authentication with Faraday >= v2 #164

Closed zach-brown-hpa closed 9 months ago

zach-brown-hpa commented 9 months ago

Previous behavior: delivery_method=postback with token auth and Faraday >= v2.0.0 breaks because theconnection.token_auth method was removed in Faraday v2.0.0.

New behavior: Postback token auth works for Faraday v1.x and v2.x. Uses existence of connection.token_auth method to branch to either the preexisting token auth method or the newer token auth method connection.request(:authorization, 'Token', @delivery_options.token).

zach-brown-hpa commented 9 months ago

@tpitale Anything you'd like to add/change? I've run it locally with the latest Faraday v2.9.0 and it works