Closed saboter closed 1 year ago
@saboter Thanks for reporting.
No, I am still using v2 in production.
@bf4 / @mculp Are you all running v3 in production?
@minimul Not yet. Should probably re-record the VCRs and see what's not matching up. Do the cassettes match on the Authorization header?
I'm actually about to catch a flight on vacation so I don't think I will be able to dig into this much for a few days.
@minimul @bf4
It seems the problem is in the parameter usage in this method (https://github.com/minimul/qbo_api/blob/master/lib/qbo_api/connection.rb):
# Faraday 2 deprecated the FaradayMiddleware gem. Middleware is
# now part of Faraday itself, and :authorization can be used to pass
# the Bearer token.
def add_authorization_middleware(conn)
conn.request :authorization, access_token, token_type: 'bearer'
end
After adjusting it according to Faraday docs (https://github.com/lostisland/faraday/blob/main/docs/middleware/request/authentication.md) it started to work:
def add_authorization_middleware(conn)
conn.request :authorization, 'Bearer', access_token
end
Mocked specs have most probably some blind spot for this type of bug.
The reason spec pass could be also use of old Faraday version.
Gemspec allows it:
spec.add_runtime_dependency 'faraday', '>= 1.10.0'
@saboter Good find.
Tell you what, put together a PR for the change you discovered and I'll merge and release it as 3.0.1
. Don't worry about the specs passing at the moment.
Done.
Did not run specs and did not touched gemspec.
Update: PR #120 has been merged and released as version 3.0.1
.
All good now.
Hi everybody,
I was following closely your efforts on the recent faraday upgrade related PR (https://github.com/minimul/qbo_api/pull/118) and rushed to test the new version.
Unfortunately after upgrade my QBO integration stopped working. I am receiving the same exception like in this old closed issue:
https://github.com/minimul/qbo_api/issues/84
Tokens are good, they were tested with this snippet:
Gems:
oauth2 = 2.0.9 faraday = 2.7.2
Is the new version working for you also in your production usage? @bf4 @mculp @minimul
Thank you.