Gestion simplifiée des tokens JWT (access, refresh, blacklist) pour Python
Project description
🔑 jwt-manager
Un utilitaire Python pour la gestion simplifiée des tokens JWT :
- Création de tokens d'accès et de refresh tokens
- Vérification et décodage sécurisé
- Rotation de refresh tokens
- Blacklist / révocation de tokens compromis
Idéal pour les APIs Python (FastAPI, Flask, Django).
🚀 Installation
Depuis PyPI (après publication officielle) :
pip install jwt-manager
from jwt_manager import JWTManager
# Initialiser le gestionnaire
jwtm = JWTManager(secret="ma_cle_super_secrete", access_ttl=900, refresh_ttl=3600)
# Générer des tokens
access = jwtm.create_access_token({"user_id": 42})
refresh = jwtm.create_refresh_token({"user_id": 42})
# Vérifier un access token
payload = jwtm.verify_token(access)
print(payload) # {'user_id': 42, 'exp': ..., 'type': 'access'}
# Rafraîchir un access token
new_access = jwtm.refresh_access_token(refresh)
# Blacklister un token
jwtm.blacklist_token(access)
print(jwtm.is_revoked(access)) # True
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
jwt_manager_py-0.1.0.tar.gz
(2.7 kB
view details)
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 jwt_manager_py-0.1.0.tar.gz.
File metadata
- Download URL: jwt_manager_py-0.1.0.tar.gz
- Upload date:
- Size: 2.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ad8d17427b1d38c6d40c5b8ff515b991f14ef5f0d8d5dedd2679eac0b3821f3b
|
|
| MD5 |
9c9e89be28e8d0e5dc94b2a65c2cb045
|
|
| BLAKE2b-256 |
5e509822353bca20fee62728875314196635365c300a4a823f60991468c0c72c
|
File details
Details for the file jwt_manager_py-0.1.0-py3-none-any.whl.
File metadata
- Download URL: jwt_manager_py-0.1.0-py3-none-any.whl
- Upload date:
- Size: 2.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
dfa3b8d190a9f8ccd9f5cc8f01e64bfcd5188e8ba12b249f26f9e6588e2c11ea
|
|
| MD5 |
301b3bb02ec9bd26317dbcf50f0b6c5c
|
|
| BLAKE2b-256 |
6b10fe530ddbfb0836a13e11220a1dd0fb100ed7bbacea5250294bf2b9c77720
|