Rolling Token verificator & generator
Project description
Rolling Token Authentication
Usage
Initialization
from rolling_token_auth import RollingTokenManager
manager = RollingTokenManager("secret", interval=3600)
The interval defines how long a token is valid in seconds. Shorter = more secure.
Both secret and interval must match between generation and verification.
Generation
manager.generate_token()
This generates a token for the current timestamp. Optionally a offset can be declared.
Verification
manager.is_valid(token)
This checks if the given token is valid for the current timestamp. The manager.tolerance parameter defines how many token from the past and future are still valid (default: 1 in each direction).
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file rolling_token_auth-0.1.2.tar.gz.
File metadata
- Download URL: rolling_token_auth-0.1.2.tar.gz
- Upload date:
- Size: 2.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.46.0 CPython/3.8.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
acf36eb3632365ee8c8a9e83d17b8e3f23d2b41e77ebc22fe1f3e9c6d6767331
|
|
| MD5 |
1243973b826d2e38aa02ffee387c2abc
|
|
| BLAKE2b-256 |
2c853c033d4a221a764e15cb94129cb4285b3fd485a36a3b74f018fc02712ee3
|
File details
Details for the file rolling_token_auth-0.1.2-py3-none-any.whl.
File metadata
- Download URL: rolling_token_auth-0.1.2-py3-none-any.whl
- Upload date:
- Size: 2.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.46.0 CPython/3.8.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8fd91138be6e11a1295e90f282df0c8e398725af3e0f5a15ba318e5730435fa1
|
|
| MD5 |
5db5f44a86f30a0632277737c4c87760
|
|
| BLAKE2b-256 |
01bfb5e738b02edebab1bb698e13173aa59700d4e09c86c80b9aa0103f3c765d
|