Registry / gcp / gcloud-rest-auth

gcloud-rest-auth

JSON →
library5.4.4pypypiunverified

gcloud-rest-auth (part of the gcloud-aio project) provides asynchronous Python clients for Google Cloud Platform authentication. It leverages aiohttp for non-blocking I/O, offering an efficient way to interact with Google Cloud services in async applications. The current version is 5.4.4, with releases occurring as needed across its various sub-packages.

pip install gcloud-rest-auth
INSTALL
IMPORT
SIG · GCLOUD-REST-AUTH
G
gcloud-rest-auth
gcppythonv5.4.4
Install
3.9s avg
Import
Disk
54MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v5.4.4 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.920 runs
installs and imports cleanly · install 0.0s · import 0.000s · 54.4MB
glibc
py 3.103.920 runs
installs and imports cleanly · install 3.9s · import 0.000s · 55MB
54MB installed
● package 54MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

AioAuth
from gcloud.rest.auth import AioAuth
from gcloud.auth import AioAuth

This quickstart demonstrates how to initialize the `AioAuth` client and retrieve an access token. It automatically handles credential discovery. Remember to have your Google Cloud credentials configured (e.g., via `GOOGLE_APPLICATION_CREDENTIALS` environment variable or `gcloud` CLI).

import asyncio import os from gcloud_aio.auth import AioAuth async def main(): # AioAuth will automatically find credentials (e.g., from GOOGLE_APPLICATION_CREDENTIALS, gcloud CLI, metadata server) # For local development, ensure GOOGLE_APPLICATION_CREDENTIALS or gcloud is configured. # Example: export GOOGLE_APPLICATION_CREDENTIALS='/path/to/your/key.json' async with AioAuth() as client: try: token = await client.get_access_token() print(f"Successfully obtained access token: {token[:20]}...") # You can now use this token for authenticated requests to Google Cloud APIs except Exception as e: print(f"Failed to obtain access token: {e}") print("Please ensure your Google Cloud credentials are set up correctly.") if __name__ == "__main__": asyncio.run(main())
Debug
Known issues
breakingPython 3.9 support was dropped in `gcloud-rest-auth` version 5.4.4. Projects running on Python 3.9 will need to upgrade to Python 3.10 or newer.
fix
Upgrade your Python environment to 3.10 or a later version.
affects: >=5.4.4
gotchaThe PyPI package name `gcloud-rest-auth` does not directly map to the import path. The correct import is `from gcloud_aio.auth import AioAuth`, reflecting its structure within the `gcloud-aio` monorepo.
fix
Always use `from gcloud_aio.auth import AioAuth` for importing the authentication client.
affects: All versions
gotchaThis library provides asynchronous clients built on `aiohttp`. If you are working in a synchronous application or using a different HTTP client library, `gcloud-rest-auth` might not be the right fit.
fix
Ensure your project uses `asyncio` and is compatible with `aiohttp` for network operations when using this library.
affects: All versions
gotchaVersion 5.4.4 fixed an issue where `auto_decompress` settings might have been unexpectedly overwritten or behaved incorrectly when passed as `None`. Older versions might exhibit subtle issues related to HTTP content decompression.
fix
Upgrade to version 5.4.4 or newer to ensure correct handling of `auto_decompress` and proper integration with `aiohttp.ClientSession` settings.
affects: <5.4.4
Upgrade
Version history
5.4.4latest on PyPI · released Feb 26, 2026
Audit
Dependencies

No dependency data recorded yet.

Agent activity
26 hits · last 30 days
node
22
OpenAI (training)
1
Resources
gcloud-rest-auth — pip install gcloud-rest-auth · libregistry