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).
Metadata
Release files for rolling-token-auth 0.1.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| rolling_token_auth-0.1.2.tar.gz | 2.2 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| rolling_token_auth-0.1.2-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 4.6 kB
Release files / rolling_token_auth-0.1.2.tar.gz
| Download URL | rolling_token_auth-0.1.2.tar.gz |
|---|---|
| Size | 2.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
acf36eb3632365ee8c8a9e83d17b8e3f23d2b41e77ebc22fe1f3e9c6d6767331
|
|
BLAKE2b-256 checksum How to use checksums |
2c853c033d4a221a764e15cb94129cb4285b3fd485a36a3b74f018fc02712ee3
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is 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
|
Release files / rolling_token_auth-0.1.2-py3-none-any.whl
| Download URL | rolling_token_auth-0.1.2-py3-none-any.whl |
|---|---|
| Size | 2.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
8fd91138be6e11a1295e90f282df0c8e398725af3e0f5a15ba318e5730435fa1
|
|
BLAKE2b-256 checksum How to use checksums |
01bfb5e738b02edebab1bb698e13173aa59700d4e09c86c80b9aa0103f3c765d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is 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
|