You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
AuthorizedSession takes keyword arguments that are passed down to the ClientSession, so when we make requests using the session that it yields, these arguments are effective. However, AuthorizedSession also does token fresh in its request method, where it manually creates a ClientSession which doesn't include these keyword arguments.
In my scenario, we have to run some logic under a VPN, so I need to pass trust_env into every aiohttp Session, cause otherwise the request would just hang and eventually time out. Because of this I cannot really use AuthorizedSession as it just always times out at the token refresh step.
Environment details
OS: MacOS 14.3
Python version: 3.12
google-auth version: 2.29.0
Steps to reproduce
credentials, _ = default_async()
async with AuthorizedSession(trust_env=False) as session:
await session.request(...)
The code is stuck at the session.request step until it times out if a proxy is used.
Possible solutions
We can just pass the kwargs accepted in the AuthorizedSession constructor into the ClientSession constructor here
The text was updated successfully, but these errors were encountered:
AuthorizedSession
takes keyword arguments that are passed down to theClientSession
, so when we make requests using thesession
that it yields, these arguments are effective. However,AuthorizedSession
also does token fresh in itsrequest
method, where it manually creates aClientSession
which doesn't include these keyword arguments.In my scenario, we have to run some logic under a VPN, so I need to pass
trust_env
into every aiohttp Session, cause otherwise the request would just hang and eventually time out. Because of this I cannot really useAuthorizedSession
as it just always times out at the token refresh step.Environment details
google-auth
version: 2.29.0Steps to reproduce
The code is stuck at the
session.request
step until it times out if a proxy is used.Possible solutions
We can just pass the
kwargs
accepted in theAuthorizedSession
constructor into theClientSession
constructor hereThe text was updated successfully, but these errors were encountered: