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.2.3a0.tar.gz (11.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

gcloud_aio_auth-4.2.3a0-py3-none-any.whl (13.5 kB view details)

Uploaded Python 3

File details

Details for the file gcloud_aio_auth-4.2.3a0.tar.gz.

File metadata

  • Download URL: gcloud_aio_auth-4.2.3a0.tar.gz
  • Upload date:
  • Size: 11.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.5.1 CPython/3.11.3 Linux/5.15.0-1030-aws

File hashes

Hashes for gcloud_aio_auth-4.2.3a0.tar.gz
Algorithm Hash digest
SHA256 7f34bf3590e1617f2b2804e2bd521b8fb1713975d3354abae61c33252c8238fd
MD5 7fb36cc548172613bf9716ccb2cf7dfd
BLAKE2b-256 6436f1cdecb8836f4db39f5efff9afd844a45d2b2e5dcce79b711e52c8ccc7a5

See more details on using hashes here.

File details

Details for the file gcloud_aio_auth-4.2.3a0-py3-none-any.whl.

File metadata

  • Download URL: gcloud_aio_auth-4.2.3a0-py3-none-any.whl
  • Upload date:
  • Size: 13.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.5.1 CPython/3.11.3 Linux/5.15.0-1030-aws

File hashes

Hashes for gcloud_aio_auth-4.2.3a0-py3-none-any.whl
Algorithm Hash digest
SHA256 8b594cbf6e70bc851914570b531de110debdd5924554aa97b7d98b75cfdce8d1
MD5 c38d77c59c42d5fecb3eba6f20e1fd43
BLAKE2b-256 b8791ef447fc5ea0ce4fc79c9aba254f6f693463892caae02b7a4f51cd05d79b

See more details on using hashes here.

Supported by

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