Skip to main content

Strong, Simple, and Precise security for Flask APIs

Project description

Latest Published Version Build Status Documentation Build Status

flask-praetorian

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.

The flask-praetorian package can be used to:

  • Encrypt (hash) passwords for storing in your database

  • Verify plaintext passwords against the encrypted, stored versions

  • Generate authorization tokens upon verification of passwords

  • Check requests to secured endpoints for authorized tokens

  • Ensure that the users associated with tokens have necessary roles for access

  • Parse user information from request headers for use in client route handlers

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.

Super-quick Start

  • requirements: python3.5

  • install through pip: $ pip install flask-praetorian

  • minimal usage example: example/basic.py

Documentation

The complete documentation can be found at the flask-praetorian home page

Project details


Download files

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

Source Distribution

flask-praetorian-0.3.1.tar.gz (11.3 kB view details)

Uploaded Source

File details

Details for the file flask-praetorian-0.3.1.tar.gz.

File metadata

File hashes

Hashes for flask-praetorian-0.3.1.tar.gz
Algorithm Hash digest
SHA256 9e4b5a2a95b75d058326ce2588eda94f0c941fdbcb4116570c4f36f1a04bec32
MD5 3098777a7a8154a646e3a27f574cd328
BLAKE2b-256 fcfd2414c3bd7e36e2633ddddad2a7c7cc6e86de18555e3d02f0b57cf6711771

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page