Skip to main content

Token utilities

Project description

Utilities to generate and verify tokens (autodeprecating or not).

Currently implemented :

  • Time-based One-time Password (TOTP)

TOTP Example

Below is an example of a token based on TOTP, self-deprecating after a given number of seconds

from roughrider.token.hmac_factories import TOTTokenFactory

factory = TOTTokenFactory(secret=b'secret', TTL=180)  # 3 min TTL
token = factory.generate('my word')
assert factory.challenge(token, 'my word') is True
assert factory.challenge(token, 'my other word') is False

CHANGES

0.1 (2021-10-09)

  • Initial release.

Project details


Release history Release notifications | RSS feed

This version

0.1

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

roughrider.token-0.1.tar.gz (5.9 kB view details)

Uploaded Source

File details

Details for the file roughrider.token-0.1.tar.gz.

File metadata

  • Download URL: roughrider.token-0.1.tar.gz
  • Upload date:
  • Size: 5.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: Python-urllib/3.8

File hashes

Hashes for roughrider.token-0.1.tar.gz
Algorithm Hash digest
SHA256 99a7c4c4576ef56dbd23ab58adf8e34510a6a5e37a1c571e8798d4f393546e82
MD5 c1ff5862a18b32c4d47ac63a435881ec
BLAKE2b-256 b1ca6623f7fbea37957c86f7bed0fbf947f6da17f9f233425505cd3951e0a2db

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