Skip to content

Commit

Permalink
refactor: Add **kwargs to parent constructor for Async API (#1127)
Browse files Browse the repository at this point in the history
* refactor: Add **kwargs to parent constructor for Async API

This resolves #1061.
By passing in **kwargs to the parent constructor, `aiohhttp.ClientSession` parameters can be configured by users.
  • Loading branch information
clundin25 authored Aug 30, 2022
1 parent 23a12eb commit 35e83eb
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion google/auth/transport/_aiohttp_requests.py
Original file line number Diff line number Diff line change
Expand Up @@ -233,6 +233,8 @@ class AuthorizedSession(aiohttp.ClientSession):
refreshing credentials. If not passed,
an instance of :class:`~google.auth.transport.aiohttp_requests.Request`
is created.
kwargs: Additional arguments passed through to the underlying
ClientSession :meth:`aiohttp.ClientSession` object.
"""

def __init__(
Expand All @@ -243,8 +245,9 @@ def __init__(
refresh_timeout=None,
auth_request=None,
auto_decompress=False,
**kwargs,
):
super(AuthorizedSession, self).__init__()
super(AuthorizedSession, self).__init__(**kwargs)
self.credentials = credentials
self._refresh_status_codes = refresh_status_codes
self._max_refresh_attempts = max_refresh_attempts
Expand Down
Binary file modified system_tests/secrets.tar.enc
Binary file not shown.

0 comments on commit 35e83eb

Please sign in to comment.