Strong, Simple, and Precise security for Flask APIs (using jwt)
Strong, Simple, and Precise security for Flask APIs
API security should be strong, simple, and precise like a Roman Legionary. This package aims to provide that. Using JWT tokens as implemented by PyJWT, flask_praetorian uses a very simple interface to make sure that the users accessing your API’s endpoints are provisioned with the correct roles for access.
This project was heavily influenced by Flask-Security, but intends to supply only essential functionality. Instead of trying to anticipate the needs of all users, flask-praetorian will provide a simple and secure mechanism to provide security for APIs specifically.
This extesion offers a batteries-included approach to security for your API. For essential security concerns for Flask-based APIs, flask-praetorian should supply everything you need.
The flask-praetorian package can be used to:
- Hash passwords for storing in your database
- Verify plaintext passwords against the hashed, stored versions
- Generate authorization tokens upon verification of passwords
- Check requests to secured endpoints for authorized tokens
- Supply expiration of tokens and mechanisms for refreshing them
- Ensure that the users associated with tokens have necessary roles for access
- Parse user information from request headers for use in client route handlers
- Support inclusion of custom user claims in tokens
- Register new users using email verification
All of this is provided in a very simple to confiure and initialize flask extension. Though simple, the security provided by flask-praetorian is strong due to the usage of the proven security technology of JWT and python’s PassLib package.
- requirements: python versions 3.4, 3.5, 3.6, and 3.7
- install through pip: $ pip install flask-praetorian
- minimal usage example: example/basic.py
The complete documentation can be found at the flask-praetorian home page
Release history Release notifications | RSS feed
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
|Filename, size||File type||Python version||Upload date||Hashes|
|Filename, size flask_praetorian-1.0.0-py3-none-any.whl (16.8 kB)||File type Wheel||Python version py3||Upload date||Hashes View|
|Filename, size flask-praetorian-1.0.0.tar.gz (15.9 kB)||File type Source||Python version None||Upload date||Hashes View|
Hashes for flask_praetorian-1.0.0-py3-none-any.whl