Skip to main content

Python Client for Google Cloud Auth

Project description

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”.

Latest PyPI Version (gcloud-aio-auth) Python Version Support (gcloud-aio-auth) Python Version Support (gcloud-rest-auth)

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.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

gcloud_aio_auth-4.1.2.tar.gz (12.0 kB view details)

Uploaded Source

Built Distribution

gcloud_aio_auth-4.1.2-py3-none-any.whl (13.7 kB view details)

Uploaded Python 3

File details

Details for the file gcloud_aio_auth-4.1.2.tar.gz.

File metadata

  • Download URL: gcloud_aio_auth-4.1.2.tar.gz
  • Upload date:
  • Size: 12.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.3.1 CPython/3.9.16 Linux/5.15.0-1021-aws

File hashes

Hashes for gcloud_aio_auth-4.1.2.tar.gz
Algorithm Hash digest
SHA256 fa3f216a592025c10c51c0591a0a9130b4ba0e8e237b190b05241f615c4fe308
MD5 d1409ecfa7dd4fae02538f72a0345b2e
BLAKE2b-256 99cd5c99469758e2c5317c2014ca2e37bf35b28381adcd54e33d80e568759dca

See more details on using hashes here.

File details

Details for the file gcloud_aio_auth-4.1.2-py3-none-any.whl.

File metadata

  • Download URL: gcloud_aio_auth-4.1.2-py3-none-any.whl
  • Upload date:
  • Size: 13.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.3.1 CPython/3.9.16 Linux/5.15.0-1021-aws

File hashes

Hashes for gcloud_aio_auth-4.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 6e91358b069e1e14159676cd01e5d644eefec5e49baba0e179af50e004618f06
MD5 725dc7eb43b819cf6841084d63bfc23a
BLAKE2b-256 d7810e503035d78995596292c461ed590c1488f5bc8e76fc8e75f8799be0b9a3

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page