(Asyncio OR Threadsafe) Python Client for Google Cloud Auth
This is a shared codebase for gcloud-aio-auth and gcloud-rest-auth
This library implements an IamClient class, which can be used to interact with GCP public keys and URL sign blobs.
It additionally implements a Token class, which is used for authorizing against Google Cloud. The other gcloud-aio-* package components accept a Token instance as an argument; you can define a single token for all of these components or define one for each. Each component corresponds to a given Google Cloud service and each service requires various “scopes”.
Installation
$ pip install --upgrade gcloud-{aio,rest}-auth
Usage
See our docs.
CLI
This project can also be used to help you manually authenticate to test GCP routes, eg. we can list our project’s uptime checks with a tool such as curl:
# using default application credentials
curl \
-H "Authorization: Bearer $(python3 -c 'from gcloud.rest.auth import Token; print(Token().get())')" \
"https://monitoring.googleapis.com/v3/projects/PROJECT_ID/uptimeCheckConfigs"
# using a service account (make sure to provide a scope!)
export GOOGLE_APPLICATION_CREDENTIALS=/path/to/service.json
curl \
-H "Authorization: Bearer $(python3 -c 'from gcloud.rest.auth import Token; print(Token(scopes=["'"https://www.googleapis.com/auth/cloud-platform"'"]).get())')" \
"https://monitoring.googleapis.com/v3/projects/PROJECT_ID/uptimeCheckConfigs"
# using legacy account credentials
export GOOGLE_APPLICATION_CREDENTIALS=~/.config/gcloud/legacy_credentials/EMAIL@DOMAIN.TLD/adc.json
curl \
-H "Authorization: Bearer $(python3 -c 'from gcloud.rest.auth import Token; print(Token().get())')" \
"https://monitoring.googleapis.com/v3/projects/PROJECT_ID/uptimeCheckConfigs"
Contributing
Please see our contributing guide.
Metadata
Release files for gcloud-aio-auth 4.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| gcloud_aio_auth-4.1.0.tar.gz | 12.0 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| gcloud_aio_auth-4.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 25.6 kB
Release files / gcloud_aio_auth-4.1.0.tar.gz
| Download URL | gcloud_aio_auth-4.1.0.tar.gz |
|---|---|
| Size | 12.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
e3a618c758c3a7ae0f5fb02958230a1a2ada86db25afbf673e6d6d295770e4a0
|
|
BLAKE2b-256 checksum How to use checksums |
5b40b9703c5fe3fa8091d6354e2c26110c172313dde69dd40d2382f006ebccc5
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.3.1 CPython/3.9.16 Linux/5.15.0-1021-aws
|
Release files / gcloud_aio_auth-4.1.0-py3-none-any.whl
| Download URL | gcloud_aio_auth-4.1.0-py3-none-any.whl |
|---|---|
| Size | 13.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
8465cad8a483478a83186e3665cd304378f664a0c245637578ecd55d61b7d06a
|
|
BLAKE2b-256 checksum How to use checksums |
d1701b98f0a9531e481f9fc4b8ef56792c676276d75a9dbd3441a38b0873ae98
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.3.1 CPython/3.9.16 Linux/5.15.0-1021-aws
|