Environment details
- Python version: 3.11.5
- pip version: 23.3.1
- google-auth version: 2.23.4
Steps to reproduce
import asyncio
from google.auth._default_async import default_async
from google.auth.transport import _aiohttp_requests
async def main():
creds, project = default_async()
await creds.refresh(_aiohttp_requests.Request())
print('Credentials:', creds)
async with _aiohttp_requests.AuthorizedSession(creds) as authed_session:
response = await authed_session.request('POST', 'https://example.org'))
print(response.json())
asyncio.run(main())
Actual result:
Credentials: <google.oauth2._credentials_async.Credentials object at 0x7fc2e3ea9f10>
...
File "/usr/local/lib/python3.11/site-packages/google/auth/transport/_aiohttp_requests.py", line 333, in request
await self.credentials.before_request(
TypeError: object NoneType can't be used in 'await' expression
This seems to happen since google.oauth2._credentials_async.Credentials does not define asynchronous version of before_request, while google.auth._credentials_async.Credentials does this.
Reactions are currently unavailable
Environment details
Steps to reproduce
Actual result:
This seems to happen since google.oauth2._credentials_async.Credentials does not define asynchronous version of before_request, while google.auth._credentials_async.Credentials does this.