Skip to main content

Strong, Simple, and Precise security for Flask APIs (using jwt)

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: python versions 3.4, 3.5, 3.6, and 3.7

  • 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.5.0.tar.gz (10.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

flask_praetorian-0.5.0-py3-none-any.whl (31.6 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: flask-praetorian-0.5.0.tar.gz
  • Upload date:
  • Size: 10.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/0.12.11 CPython/3.6.7 Linux/4.15.0-1026-gcp

File hashes

Hashes for flask-praetorian-0.5.0.tar.gz
Algorithm Hash digest
SHA256 23f5ed8a2357ded7466816ac7147606a3f320b996ebbf2c14276bcc55b63bc63
MD5 3b35c8e6fa54d29c1cc239a4ad75d293
BLAKE2b-256 16e37d49d786003b7a11d51ccf2547e710d6bd50aa0b305023c0972286a13cea

See more details on using hashes here.

File details

Details for the file flask_praetorian-0.5.0-py3-none-any.whl.

File metadata

  • Download URL: flask_praetorian-0.5.0-py3-none-any.whl
  • Upload date:
  • Size: 31.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/0.12.11 CPython/3.6.7 Linux/4.15.0-1026-gcp

File hashes

Hashes for flask_praetorian-0.5.0-py3-none-any.whl
Algorithm Hash digest
SHA256 9d6df3c91e7493d9609fde61c9ccbf17af51f6270451e31ab0e3e38780fb0f6a
MD5 2df3799be74e18ea35593751ce90e3da
BLAKE2b-256 668ae0f2b0cde3ff5b3c5a13d6270ebb5e39b5844f16874385bdd7a7c80f9371

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