googleapis / googleapis/google-cloud-python
auth: configure_mtls_channel() discards existing session configuration
- Dominant language
- Python
- Stars
- 5.4k
- Forks
- 1.8k
- Avg merge
- 3d 4h
- Merged PRs (30d)
- 122
Description
In `AsyncAuthorizedSession.configure_mtls_channel()` (`packages/google-auth/google/auth/aio/transport/sessions.py`), configuring mutual TLS replaces `self._auth_request` with a newly constructed `aiohttp.ClientSession` and `aiohttp.TCPConnector`:
```python
connector = aiohttp.TCPConnector(ssl=ssl_context)
new_session = aiohttp.ClientSession(connector=connector)
old_auth_request = self._auth_request
self._auth_request = AiohttpRequest(session=new_session)
```
Because `new_session` is instantiated from scratch with default arguments, we lose any custom configurations provided by callers on the initial session, such as connection pool limits, timeouts, etc.
Contributor guide
Assessment
This issue has not been assessed yet.