Metadata-Version: 2.1
Name: gcloud-rest-auth
Version: 4.1.2
Summary: Python Client for Google Cloud Auth
Home-page: https://github.com/talkiq/gcloud-aio
License: MIT
Author: Vi Engineering
Author-email: voiceai-eng@dialpad.com
Requires-Python: >=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*, !=3.5.*, !=3.6.*
Classifier: Development Status :: 5 - Production/Stable
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 2
Classifier: Programming Language :: Python :: 2.7
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.7
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Topic :: Internet
Requires-Dist: backoff (>=1.0.0,<3.0.0)
Requires-Dist: chardet (>=2.0,<4.0) ; python_version < "3.0"
Requires-Dist: chardet (>=2.0,<4.1) ; python_version >= "3.7"
Requires-Dist: cryptography (>=2.0.0,<39.0.0)
Requires-Dist: future (>=0.17.0,<0.19.0)
Requires-Dist: pyjwt (>=1.5.3,<3.0.0)
Requires-Dist: requests (>=2.2.1,<3.0.0)
Requires-Dist: six (>=1.11.0,<2.0.0)
Project-URL: Repository, https://github.com/talkiq/gcloud-aio
Description-Content-Type: text/x-rst

(Asyncio OR Threadsafe) Python Client for Google Cloud Auth
===========================================================

    This is a shared codebase for ``gcloud-rest-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-rest-*`` 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`_".

|pypi| |pythons-aio| |pythons-rest|

Installation
------------

.. code-block:: console

    $ 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``:

.. code-block:: console

    # 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`_.

.. _contributing guide: https://github.com/talkiq/gcloud-rest/blob/master/.github/CONTRIBUTING.rst
.. _our docs: https://talkiq.github.io/gcloud-rest
.. _scopes: https://developers.google.com/identity/protocols/googlescopes

.. |pypi| image:: https://img.shields.io/pypi/v/gcloud-rest-auth.svg?style=flat-square
    :alt: Latest PyPI Version (gcloud-rest-auth)
    :target: https://pypi.org/project/gcloud-rest-auth/

.. |pythons-aio| image:: https://img.shields.io/pypi/pyversions/gcloud-rest-auth.svg?style=flat-square&label=python (aio)
    :alt: Python Version Support (gcloud-rest-auth)
    :target: https://pypi.org/project/gcloud-rest-auth/

.. |pythons-rest| image:: https://img.shields.io/pypi/pyversions/gcloud-rest-auth.svg?style=flat-square&label=python (rest)
    :alt: Python Version Support (gcloud-rest-auth)
    :target: https://pypi.org/project/gcloud-rest-auth/

