GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
GeezerVison is showing github.com — feat: asyncio http request logic and asynchronous credentials logic by anibadde · Pull Request #572 · googleapis/google-auth-library-python
This repository was archived by the owner on Mar 6, 2026. It is now read-only.
Conversation
All reactions
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page.
crwilcox
suggested changes
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should six be needed for this? this surface is only usable for 3.6+ correct?
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactions
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I used six to change the exception types (line 143, 147) so that we could raise our defined transport error.
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactions
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This module uses class Credentials(credentials.Credentials, metaclass=abc.ABCMeta): ...
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactions
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. are these shared with the other transport? Can we extract them to a common import to avoid duplication?
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactions
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Fixed in the latest commit.
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactions
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I may have raised this before, but I am -1 on abbreviations. is there a motivation for naming this
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactions
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The motivation was the length, could change this to aiohttp_request though if that would be better. I'm worried about the name change to aiohttp just because of naming collision to the aiohttp library.
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactions
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Fixed, changed to aiohttp_requests in all 3 PRs
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactions
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This import doesn't seem to be used in this sample. Is it required?
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactions
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes the aiohttp import is not required. Removed from the docstring.
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactions
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is this commented out code?
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactions
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Made this change when switching the initialization of client session, deleted the commented out code now.
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactions
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this may be carry-over, does the old surface use a param
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactions
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This was what the documentation was like in the old surface and therefore carried over on to here - I do agree the discrepancy is strange - it would seem that we want this to be URL. Changed in the current version.
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactions
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. are all of these vars unique to the implementation? It seems
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactions
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. _loop and _refresh_lock are unique to this implementation. I think that as they are class variables with the self. syntax we wouldn't need to include them in the super() call, we could talk about this on our next call.
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactions
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. can we share this list, composing
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactions
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Fixed in the latest commit to only have the 1 TEST_DEPENDENCIES list.
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactions
crwilcox
approved these changes
|
| @nox.session(python=["2.7", "3.5"]) | ||
| def unit_prev_versions(session): | ||
| session.install(*TEST_DEPENDENCIES2) | ||
| session.install(*TEST_DEPENDENCIES[:-2]) |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
+1
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
|
||
| import abc | ||
|
|
||
| import six |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
This module uses six only for the six.add_metaclass(abc.ABCMeta) class decorator. Given that it will only ever be imported under Python >= 3.6, it would be clearer to just use the direct Py3 syntax, e.g.:
class Credentials(credentials.Credentials, metaclass=abc.ABCMeta): ...
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
|
||
| """Transport adapter for Async HTTP (aiohttp).""" | ||
|
|
||
| from __future__ import absolute_import |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Redundant under Python 3.x.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
|
||
| except aiohttp.ClientError as caught_exc: | ||
| new_exc = exceptions.TransportError(caught_exc) | ||
| six.raise_from(new_exc, caught_exc) |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Given Python 3 only, this can be simplified to:
except aiohttp.ClientError as caught_exc: raise exceptions.TransportError(caught_exc) from caught_exc
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
|
||
| except asyncio.TimeoutError as caught_exc: | ||
| new_exc = exceptions.TransportError(caught_exc) | ||
| six.raise_from(new_exc, caught_exc) |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Likewise here:
except asyncio.TimeoutError as caught_exc: raise exceptions.TransportError(caught_exc) from caught_exc
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| import flask | ||
| import pytest | ||
| from pytest_localserver.http import WSGIServer | ||
| from six.moves import http_client |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Given Python3-only, this can be just:
import http.client
and then use http.client.OK, etc., below.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
* feat: asyncio http request logic and asynchronous credentials logic (#572) Co-authored-by: Anirudh Baddepudi <[email protected]>
* refactor: split 'with_quota_project' into separate base class (#561) Co-authored-by: Tres Seaver <[email protected]> * fix: dummy commit to trigger a auto release (#597) * chore: release 1.21.1 (#599) * chore: updated CHANGELOG.md [ci skip] * chore: updated setup.cfg [ci skip] * chore: updated setup.py Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com> * fix: migrate signBlob to iamcredentials.googleapis.com (#600) Migrate signBlob from iam.googleapis.com to iamcredentials.googleapis.com. This API is deprecated and will be shutdown in one year. This is used google.auth.iam.Signer. Added a system_test to sanity check the implementation. * chore: release 1.21.2 (#601) Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com> * fix: fix expiry for `to_json()` (#589) * This patch for </issues/501> includes the following fixes: - The access token is always set to `None`, so the fix involves using (the access) `token` from the saved JSON credentials file. - For refresh needs, `expiry` also needs to be saved via `to_json()`. - DUMP: As `expiry` is a `datetime.datetime` object, serialize to `datetime.isoformat()` in the same [`oauth2client` format](https://github.com/googleapis/oauth2client/blob/master/oauth2client/client.py#L55) for consistency. - LOAD: Add code to restore `expiry` back to `datetime.datetime` object when imported. - LOAD: If `expiry` was unsaved, automatically set it as expired so refresh takes place. - Minor `scopes` updates - DUMP: Add property for `scopes` so `to_json()` can grab it - LOAD: `scopes` may be saved as a string instead of a JSON array (Python list), so ensure it is Sequence[str] when imported. * chore: add default CODEOWNERS (#609) * chore: release 1.21.3 (#607) * feat: add asyncio based auth flow (#612) * feat: asyncio http request logic and asynchronous credentials logic (#572) Co-authored-by: Anirudh Baddepudi <[email protected]> * chore: release 1.22.0 (#615) Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com> * fix: move aiohttp to extra as it is currently internal surface (#619) Fix #618. Removes aiohttp from required dependencies to lessen dependency tree for google-auth. This will need to be looked at again as more folks use aiohttp and once the surfaces goes to public visibility. * chore: release 1.22.1 (#620) Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com> * fix: remove checks for ancient versions of Cryptography (#596) Refs #595 (comment) I see no point in checking whether someone is running a version of https://github.com/pyca/cryptography/ from 2014 that doesn't even compile against modern versions of OpenSSL anymore. * chore: sync to master Syncs to master. Fixes broken unit tests in Python 3.6 and 3.7. Aligns test_identity_pool.py with test_aws.py. Co-authored-by: Bu Sun Kim <[email protected]> Co-authored-by: Tres Seaver <[email protected]> Co-authored-by: arithmetic1728 <[email protected]> Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com> Co-authored-by: wesley chun <[email protected]> Co-authored-by: Christopher Wilcox <[email protected]> Co-authored-by: Anirudh Baddepudi <[email protected]> Co-authored-by: Aarni Koskela <[email protected]>
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
There was an error while loading. Please reload this page.