Skip to main content

OpenToken support for python.

Project description

opentoken-python

Contributor Covenant

OpenToken support for Python.

A Python implementation of generating and parsing OpenTokens. Much of this implementation is borrowed from node-opentoken.

https://tools.ietf.org/html/draft-smith-opentoken-02

Usage

Create an opentoken string:

from opentoken import OpenToken

otkapi = OpenToken("your_password")
otkapi.create_token([
    ("subject", "foobar"),
    ("key2", "val2")
])

Parse an opentoken string:

otkapi = OpenToken("your_password")
otkapi.parse_token("your_base64_encoded_token_string")

OpenToken constructor

password: Defaults to None.

cipher_suite_id: Defaults to 2. Possible ids are 0 - no encryption, 1 - AES-256, 2 - AES-128, and 3 - 3DES-168.

token_tolerance: Defaults to 120 seconds.

token_lifetime: Defaults to 300 seconds.

token_renewal: Defaults to 12 hours.

Contributing

Feel free to dive in! Open an issue or submit PRs.

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

opentoken-2.2.0.tar.gz (6.2 kB view details)

Uploaded Source

Built Distribution

opentoken-2.2.0-py3-none-any.whl (7.6 kB view details)

Uploaded Python 3

File details

Details for the file opentoken-2.2.0.tar.gz.

File metadata

  • Download URL: opentoken-2.2.0.tar.gz
  • Upload date:
  • Size: 6.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.41.0 CPython/3.8.1

File hashes

Hashes for opentoken-2.2.0.tar.gz
Algorithm Hash digest
SHA256 21552e96ed6561a80dae879c6b9c8e00a09447860fbacebd8e85035e02ef2fa6
MD5 c6e6054d1a93c46cd5bb2665dba02422
BLAKE2b-256 c40f27ceea4de92ccef53a3813c019b72421444a63a795ad22ad1bb412fe329e

See more details on using hashes here.

File details

Details for the file opentoken-2.2.0-py3-none-any.whl.

File metadata

  • Download URL: opentoken-2.2.0-py3-none-any.whl
  • Upload date:
  • Size: 7.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.41.0 CPython/3.8.1

File hashes

Hashes for opentoken-2.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 50f5b5eb91dd79a8a8ac29f8848787cf40af5b3c2489c06c6ce748c40a963bba
MD5 e66a187909c4708dab11f4193d900868
BLAKE2b-256 8c803c9d631387e8782db03475bcae2193dc6883e862cb27454e012d8cd4f57e

See more details on using hashes here.

Supported by

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