Skip to main content

how to use

from gcpTokenGenerator import tokenGenerator

conf = {
    "STG_Conf": {
        "account": '{your service account}',  # need to get from dev ops
        "host": '{your project id}',
        "target_audience": '{your client id}',
        "iap": True,
    },
    "PRD_Conf": {
        "account": '{your service account}',  # need to get from dev ops
        "host": '{your project id}',
        "target_audience": '{your client id}',
        "iap": True,
    }
}
instance = tokenGenerator(conf)
token = instance.generateToken('STG_Conf')
print('token', token)
  • when reusing same instance, generated token will renew the token only if it's expired after one hour
    meaning it remember the last token generated to one of the configs was used on init

example:

    from gcpTokenGenerator import tokenGenerator

conf = {
    "STG_Conf": {
        "account": '{your service account}',  # need to get from dev ops
        "host": '{your project id}',
        "target_audience": '{your client id}',
        "iap": True,
    },
    "PRD_Conf": {
        "account": '{your service account}',  # need to get from dev ops
        "host": '{your project id}',
        "target_audience": '{your client id}',
        "iap": True,
    }
}
instance = tokenGenerator(conf)
stg_token = instance.generateToken('STG_Conf')
prd_token = instance.generateToken('PRD_Conf')
print('stg_token', stg_token)
print('prd_token', prd_token)

# this will generate new token only if it's expired
stg_token = instance.generateToken('STG_Conf')
prd_token = instance.generateToken('PRD_Conf')

Metadata

Release files for gcpTokenGenerator 0.0.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for gcpTokenGenerator 0.0.2
File Size Uploaded Provenance
gcpTokenGenerator-0.0.2.tar.gz 3.8 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for gcpTokenGenerator 0.0.2
File Interpreter ABI Platform
gcpTokenGenerator-0.0.2-py3-none-any.whl Python 3 none any Details

Total release size: 7.3 kB

Release files / gcpTokenGenerator-0.0.2.tar.gz

Download URL gcpTokenGenerator-0.0.2.tar.gz
Size 3.8 kB
Tags Source
SHA-256 checksum
How to use checksums
642234aff6249d5fea0d499be36a501cc735e7391a91333718eab99cfadbb8e7
BLAKE2b-256 checksum
How to use checksums
d52d7a53af2beb91b77e8782e88b9699cd75a3e9af8da49a4be1aef9eb68543c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.1 importlib_metadata/4.10.0 pkginfo/1.7.0 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.8.2

Release files / gcpTokenGenerator-0.0.2-py3-none-any.whl

Download URL gcpTokenGenerator-0.0.2-py3-none-any.whl
Size 3.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
12970077b1981076829f332d1a83b6037cea6328a096a85050e7e67c311bb11c
BLAKE2b-256 checksum
How to use checksums
b80c267d28f4be26e2f7664e7c6486dfdc199abe75bbca9135f128d5f0ad1ff3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.1 importlib_metadata/4.10.0 pkginfo/1.7.0 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.8.2

Security for gcpTokenGenerator 0.0.2

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.0.2 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page