Skip to main content
One Time JWT

Simple mechanism for cross service authorization. Usage:

Client side:

import onetimejwt

jwt = onetimejwt.generate('shared secret', 60) # shared secret, 60 second age

headers = {
"Authorization": "Bearer " + onetimejwt.generate('shared secret', 60)
}

Server side, create a single instance of Manager and use it for all threads:

import onetimejwt

# at startup, creates a cleanup thread
# note: you can include any number of secrets
JTM = onetimejwt.Manager('shared secret', maxage=60)

JTM.housekeeper()

# during processing -- throws JwtFailed exception if not authorized
JTM.valid(headers.get('Authorization'))

Manager will keep a list of recognized JWTS, and uses logging of a warning level
to report problems.

Metadata

Release files for onetimejwt 1.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 onetimejwt 1.0.2
File Size Uploaded Provenance
onetimejwt-1.0.2.tar.gz 2.8 kB Without provenance Details

Release files / onetimejwt-1.0.2.tar.gz

Download URL onetimejwt-1.0.2.tar.gz
Size 2.8 kB
Tags Source
SHA-256 checksum
How to use checksums
b6d4d381580409faa1fb755060abd4c6191bffa9bed54529fe13d3064c7d12cd
BLAKE2b-256 checksum
How to use checksums
5b0514aa8e8c6aff4c66792e52b566b1b71d6deff553eee0c87f8a7877543b36
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Security for onetimejwt 1.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

1.0.2 This release

1 release file 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