Skip to main content

Garpun Authentication Library

Project description

Garpun Auth Python Library

This library simplifies using Garpun’s various server-to-server authentication mechanisms to access Garpun APIs.

Google oauth2client library is taken as a basis.

Supported Python Versions

Python >= 3.4

Installing

You can install using pip:

$ pip install garpunauth

Using

# Use it for first auth with your scopes
GarpunCredentials.authenticate_user(['cloud-platform'])

# Get default credentials
credentials = GarpunCredentials.get_application_default()
print(u"credentials.access_token = %s" % str(credentials.access_token))
print(u"credentials.access_token_expired = %s" % str(credentials.access_token_expired))
print(u"credentials.refresh_token = %s" % str(credentials.refresh_token))

# Refresh access_token if it expired
import httplib2
http = credentials.authorize(httplib2.Http())
credentials.refresh(http)
print(u"credentials.access_token = %s" % str(credentials.access_token))

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

garpunauth-0.0.6.tar.gz (4.0 kB view details)

Uploaded Source

Built Distribution

garpunauth-0.0.6-py2.py3-none-any.whl (9.0 kB view details)

Uploaded Python 2Python 3

File details

Details for the file garpunauth-0.0.6.tar.gz.

File metadata

  • Download URL: garpunauth-0.0.6.tar.gz
  • Upload date:
  • Size: 4.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.11.0 pkginfo/1.4.2 requests/2.19.1 setuptools/41.4.0 requests-toolbelt/0.8.0 tqdm/4.24.0 CPython/3.7.4

File hashes

Hashes for garpunauth-0.0.6.tar.gz
Algorithm Hash digest
SHA256 0b59e6cca7a7f6a2d9574dbb60389a358a037bd32a6002797f864f65ad2a90d9
MD5 62e706e0bbdffda289e71ddea46e3d86
BLAKE2b-256 2384bc4f4c065cf0f53aee379014eec783983eb7300aa86a550980a88029d0e7

See more details on using hashes here.

File details

Details for the file garpunauth-0.0.6-py2.py3-none-any.whl.

File metadata

  • Download URL: garpunauth-0.0.6-py2.py3-none-any.whl
  • Upload date:
  • Size: 9.0 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.11.0 pkginfo/1.4.2 requests/2.19.1 setuptools/41.4.0 requests-toolbelt/0.8.0 tqdm/4.24.0 CPython/3.7.4

File hashes

Hashes for garpunauth-0.0.6-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 2d01fbd7fb28decd849c74c68ac6de679f4f2b7fab047c77a8b1e4294dd3e798
MD5 0807f11abdcf8c8dc91bf4dda4dff2d7
BLAKE2b-256 5617d6fe91eb9789f97a78ad1cc51e8e1721c34c0c77f986abb7fa3f08202ec3

See more details on using hashes here.

Supported by

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