google-auth-library-python icon indicating copy to clipboard operation
google-auth-library-python copied to clipboard

feat: add httpx transport; add compute_engine async

Open bkanuka opened this issue 2 years ago • 3 comments

Opening a draft PR to gauge interest in adding an httpx transport.

This is used internally for a project that otherwise relied on httpx (instead of aiohttp) for async http requests. Using this httpx transport means that the response from an AuthorisedSession is an httpx.Respose like the other responses in our code.

Frankly, this a copy/paste job from _aiohttp_requests.py with relevant parts changed.


compute_engine._credentials_async.py is also added for async Compute Engine credentials. Arguably, this should be discussed separately, but was created while developing the httpx transport.


There is more work to be done before this could merge, but please discuss and provide feedback.

bkanuka avatar Mar 23 '23 11:03 bkanuka

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

google-cla[bot] avatar Mar 23 '23 11:03 google-cla[bot]

Super cool! I will give this a thorough read later.

Two high level questions I have for you.

  1. What made you decide to use HTTPX instead of aiohttp?
  2. Is it feasible to support both with the same code?
    • I will be digging into this later.

clundin25 avatar May 16 '23 19:05 clundin25

Oh this is exactly what I'd need. httpx is such a brilliant library, it would be awesome of the Google auth client could natively support it.

Lawouach avatar Mar 28 '24 14:03 Lawouach