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

`default_async` returns non-async credentials for GCE and GAE

Open Ark-kun opened this issue 11 months ago • 0 comments

default_async returns non-async credentials for GCE and GAE

Environment details

  • OS: Linux
  • Python version: 3.9
  • pip version:
  • google-auth version:

Steps to reproduce

Run the following code from GCE or Colab

from google.auth import _default_async
print(_default_async.default_async()[0])

The resulting credentials are non-async

<google.auth.compute_engine.credentials.Credentials at 0x7e24d031ebc0>

The issue does not occur when running outside GCE.

It's easy to see that for GCE default_async just calls the method from default: https://github.com/googleapis/google-auth-library-python/blob/bfab59288fb5e4a9d86f5fff55307a72a0b86e47/google/auth/_default_async.py#L162..L172

Ark-kun avatar Nov 14 '24 07:11 Ark-kun