GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — feat: add asyncio based auth flow by crwilcox · Pull Request #612 · googleapis/google-auth-library-python

This repository was archived by the owner on Mar 6, 2026. It is now read-only.

Conversation

@crwilcox

@crwilcox crwilcox commented Sep 25, 2020 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

All code in this PR has been reviewed up to this point and been added to the 'async' branch.

#572
#573
#574
#584
#602
#610
#611

I would recommend being mindful of changes to existing sync based files for possible merge gotchas.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
anibadde and others added 9 commits July 28, 2020 18:53
@anibadde
feat: asyncio http request logic and asynchronous credentials logic (#…
8d0bca1
…572)

* asyncio http request logic.
* asynchronous credentials functionality.
@anibadde
feat: all asynchronous credential types required for all authenticati…
b822e48
…on types (service accounts, default... etc) (#573)

* feat: asyncio http request logic and asynchronous credentials log c

* feat: all asynchronous credentials types implemented and with tests

* feat: added the private scope for Response class

* feat: added docstring for Auth Session request method

* fix: Changed initialization of client session to within an async context manager

* changed aiohttp_requests abbreviation for the async authorized session class

* fix: changed abbrevation of the aiohttp_requests file

* fix: comments on PR regarding shared data between requests and aiohttp_requests

* fix: fixed noxfile test dependency sharing

* fix: fixed the noxfile dependencies between sync and async unit tests

* fix: cover async dependency

* fix: merge conflict issue with credentials

* fix: merge conflict #2

* fix: changed duplicated constants for sync-->async inheritance relationship

* fix: async docstring

* refactoring

* fix: refactoring

* fix: first round of comments, refactoring and test duplication changes

* fix: removed duplication in _default_async

* fix: removed oauth2 client
@anibadde
feat: added system tests for the asyncIO auth changes and async id_to…
0576ed3
…ken credentials (#574)

* feat: asyncio http request logic and asynchronous credentials log c

* feat: all asynchronous credentials types implemented and with tests

* included system tests for the asynchronous auth library

* feat: added the private scope for Response class

* feat: added docstring for Auth Session request method

* fix: Changed initialization of client session to within an async context manager

* changed aiohttp_requests abbreviation for the async authorized session class

* fix: changed abbrevation of the aiohttp_requests file

* fix: comments on PR regarding shared data between requests and aiohttp_requests

* fix: fixed noxfile test dependency sharing

* fix: fixed the noxfile dependencies between sync and async unit tests

* fix: cover async dependency

* fix: merge conflict issue with credentials

* fix: merge conflict #2

* fix: changed duplicated constants for sync-->async inheritance relationship

* fix: async docstring

* refactoring

* fix: refactoring

* fix: first round of comments, refactoring and test duplication changes

* fix: removed duplication in _default_async

* compute engine and metadata changes

* fix: removed oauth2 client

* added further system tests and refactored

* modified aiohttp request docstring

* refactoring and fixing comments

* refactored system tests and re-wrote nox file

* metadata typo

* fix: nox file tests added

* fix: directory path in app_engine
@anibadde
feat: gzip/decompressed response content handling (#584)
e963b33
@crwilcox
fix: use urllib3 inflation of deflated payloads (#586)
42420b5
* fix: use urllib3 inflation of deflated payloads

* fix: lint

* fix: trailing whitespace
@crwilcox
fix(dependencies): require aiohttp for version >3.5 (#602)
188f549
@crwilcox
docs: timeout docs updated to reflect aiohttp timeouts (#610)
a7de807
@crwilcox
fix(dependencies): Further restrict aiohttp version
c9adc27
@crwilcox
fix: move async to internal surface until stabilized (#611)
52162dc
* fix: move async surfaces to internal until stabilized
@crwilcox
crwilcox requested a review from a team September 25, 2020 19:23
@google-cla

google-cla Bot commented Sep 25, 2020

Copy link
Copy Markdown

We found a Contributor License Agreement for you (the sender of this pull request), but were unable to find agreements for all the commit author(s) or Co-authors. If you authored these, maybe you used a different email address in the git commits than was used to sign the CLA (login here to double check)? If these were authored by someone else, then they will need to sign a CLA as well, and confirm that they're okay with these being contributed to Google.
In order to pass this check, please resolve this problem and then comment @googlebot I fixed it.. If the bot doesn't comment, it means it doesn't think anything has changed.

ℹ️ Googlers: Go here for more info.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@google-cla google-cla Bot added the cla: no This human has *not* signed the Contributor License Agreement. label Sep 25, 2020
@crwilcox
Merge branch 'master' into async-to-master
15eba5e
@google-cla

google-cla Bot commented Sep 25, 2020

Copy link
Copy Markdown

We found a Contributor License Agreement for you (the sender of this pull request), but were unable to find agreements for all the commit author(s) or Co-authors. If you authored these, maybe you used a different email address in the git commits than was used to sign the CLA (login here to double check)? If these were authored by someone else, then they will need to sign a CLA as well, and confirm that they're okay with these being contributed to Google.
In order to pass this check, please resolve this problem and then comment @googlebot I fixed it.. If the bot doesn't comment, it means it doesn't think anything has changed.

ℹ️ Googlers: Go here for more info.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

crwilcox
crwilcox commented Sep 25, 2020
View reviewed changes
Comment thread google/auth/__init__.py Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread google/auth/credentials_async.py Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread google/oauth2/credentials_async.py Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread google/oauth2/id_token_async.py Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread google/oauth2/service_account_async.py Resolved

Uh oh!

There was an error while loading. Please reload this page.

crwilcox added 2 commits September 25, 2020 14:02
@crwilcox
fix: move remaining new async surfaces to internal paths
565e2cb
@crwilcox
refactor: port #561 split 'with_quota_project' into separate base class
072283e
@google-cla

google-cla Bot commented Sep 25, 2020

Copy link
Copy Markdown

We found a Contributor License Agreement for you (the sender of this pull request), but were unable to find agreements for all the commit author(s) or Co-authors. If you authored these, maybe you used a different email address in the git commits than was used to sign the CLA (login here to double check)? If these were authored by someone else, then they will need to sign a CLA as well, and confirm that they're okay with these being contributed to Google.
In order to pass this check, please resolve this problem and then comment @googlebot I fixed it.. If the bot doesn't comment, it means it doesn't think anything has changed.

ℹ️ Googlers: Go here for more info.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@crwilcox crwilcox added the cla: yes This human has signed the Contributor License Agreement. label Sep 25, 2020
@google-cla google-cla Bot removed the cla: no This human has *not* signed the Contributor License Agreement. label Sep 25, 2020
@crwilcox
fix: remove default_async from top-level google.auth
629e861
@google-cla

google-cla Bot commented Sep 25, 2020

Copy link
Copy Markdown

We found a Contributor License Agreement for you (the sender of this pull request), but were unable to find agreements for all the commit author(s) or Co-authors. If you authored these, maybe you used a different email address in the git commits than was used to sign the CLA (login here to double check)? If these were authored by someone else, then they will need to sign a CLA as well, and confirm that they're okay with these being contributed to Google.
In order to pass this check, please resolve this problem and then comment @googlebot I fixed it.. If the bot doesn't comment, it means it doesn't think anything has changed.

ℹ️ Googlers: Go here for more info.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@google-cla google-cla Bot added cla: no This human has *not* signed the Contributor License Agreement. and removed cla: yes This human has signed the Contributor License Agreement. labels Sep 25, 2020
@crwilcox crwilcox mentioned this pull request Jan 12, 2026
Move async interfaces to public surface once integrated googleapis/google-cloud-python#15221
Open
@crwilcox crwilcox added cla: yes This human has signed the Contributor License Agreement. and removed cla: no This human has *not* signed the Contributor License Agreement. labels Sep 25, 2020
@crwilcox
chore: flake8 changes
04f545a
@google-cla

google-cla Bot commented Sep 25, 2020

Copy link
Copy Markdown

We found a Contributor License Agreement for you (the sender of this pull request), but were unable to find agreements for all the commit author(s) or Co-authors. If you authored these, maybe you used a different email address in the git commits than was used to sign the CLA (login here to double check)? If these were authored by someone else, then they will need to sign a CLA as well, and confirm that they're okay with these being contributed to Google.
In order to pass this check, please resolve this problem and then comment @googlebot I fixed it.. If the bot doesn't comment, it means it doesn't think anything has changed.

ℹ️ Googlers: Go here for more info.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@google-cla google-cla Bot removed the cla: yes This human has signed the Contributor License Agreement. label Sep 25, 2020
@google-cla google-cla Bot added the cla: no This human has *not* signed the Contributor License Agreement. label Sep 25, 2020
@crwilcox crwilcox added cla: yes This human has signed the Contributor License Agreement. and removed cla: no This human has *not* signed the Contributor License Agreement. labels Sep 25, 2020
crwilcox added 2 commits September 25, 2020 15:43
@crwilcox
test: bad reference in system test
21b84cc
@crwilcox
test: improve coverage
f960381
@google-cla

google-cla Bot commented Sep 26, 2020

Copy link
Copy Markdown

We found a Contributor License Agreement for you (the sender of this pull request), but were unable to find agreements for all the commit author(s) or Co-authors. If you authored these, maybe you used a different email address in the git commits than was used to sign the CLA (login here to double check)? If these were authored by someone else, then they will need to sign a CLA as well, and confirm that they're okay with these being contributed to Google.
In order to pass this check, please resolve this problem and then comment @googlebot I fixed it.. If the bot doesn't comment, it means it doesn't think anything has changed.

ℹ️ Googlers: Go here for more info.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@google-cla google-cla Bot added cla: no This human has *not* signed the Contributor License Agreement. and removed cla: yes This human has signed the Contributor License Agreement. labels Sep 26, 2020
@crwilcox crwilcox mentioned this pull request Sep 26, 2020
coverage: improve test coverage for aiohttp_requests.py #614
Closed
9 tasks done
@crwilcox crwilcox added cla: yes This human has signed the Contributor License Agreement. kokoro:run Add this label to force Kokoro to re-run the tests. labels Sep 26, 2020
@google-cla google-cla Bot removed the cla: no This human has *not* signed the Contributor License Agreement. label Sep 26, 2020
@crwilcox
chore: lint
83e545c
@google-cla

google-cla Bot commented Sep 26, 2020

Copy link
Copy Markdown

We found a Contributor License Agreement for you (the sender of this pull request), but were unable to find agreements for all the commit author(s) or Co-authors. If you authored these, maybe you used a different email address in the git commits than was used to sign the CLA (login here to double check)? If these were authored by someone else, then they will need to sign a CLA as well, and confirm that they're okay with these being contributed to Google.
In order to pass this check, please resolve this problem and then comment @googlebot I fixed it.. If the bot doesn't comment, it means it doesn't think anything has changed.

ℹ️ Googlers: Go here for more info.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@google-cla google-cla Bot added cla: no This human has *not* signed the Contributor License Agreement. and removed cla: yes This human has signed the Contributor License Agreement. labels Sep 26, 2020
@yoshi-kokoro yoshi-kokoro removed the kokoro:run Add this label to force Kokoro to re-run the tests. label Sep 26, 2020
@crwilcox crwilcox added cla: yes This human has signed the Contributor License Agreement. kokoro:force-run Add this label to force Kokoro to re-run the tests. and removed cla: no This human has *not* signed the Contributor License Agreement. labels Sep 26, 2020
busunkim96
busunkim96 approved these changes Sep 28, 2020
View reviewed changes
@crwilcox
crwilcox merged commit 7e15258 into master Sep 28, 2020
busunkim96 added a commit that referenced this pull request Oct 22, 2020
@bojeil-google @busunkim96
@tseaver @arithmetic1728 @release-please @wescpy @crwilcox @anibadde @akx
chore: sync to master (#628)
cae69d5
* 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]>
@tseaver
tseaver deleted the async-to-master branch October 28, 2020 18:41
@bradreardon bradreardon mentioned this pull request Apr 8, 2021
FR: Async requests firebase/firebase-admin-python#104
Open
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Reviewers

1 more reviewer
@busunkim96 busunkim96 busunkim96 approved these changes
Reviewers whose approvals may not affect merge requirements

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

cla: yes This human has signed the Contributor License Agreement. kokoro:force-run Add this label to force Kokoro to re-run the tests.

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

4 participants

@crwilcox @busunkim96 @yoshi-kokoro @anibadde
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.