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.

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 configure 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-1.1.0a0.tar.gz (18.8 kB view details)

Uploaded Source

Built Distribution

flask_praetorian-1.1.0a0-py3-none-any.whl (21.2 kB view details)

Uploaded Python 3

File details

Details for the file flask-praetorian-1.1.0a0.tar.gz.

File metadata

  • Download URL: flask-praetorian-1.1.0a0.tar.gz
  • Upload date:
  • Size: 18.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.4 CPython/3.8.2 Linux/4.19.0-12-amd64

File hashes

Hashes for flask-praetorian-1.1.0a0.tar.gz
Algorithm Hash digest
SHA256 cf03cf52a9e9f9fdd33834e9fa448c5fed2aed4fb5f50c6eebbdecbdbcd255d9
MD5 da2cd7c182dfa21ffa1e5ecfd441fe6b
BLAKE2b-256 93c5c7ee001e42fd1d083fa94bfcc81392fec92b6132c26be588e1a0d4b103b5

See more details on using hashes here.

File details

Details for the file flask_praetorian-1.1.0a0-py3-none-any.whl.

File metadata

File hashes

Hashes for flask_praetorian-1.1.0a0-py3-none-any.whl
Algorithm Hash digest
SHA256 86576cd2ae59609f1213cdcb006b3132ee3806a31acfe2187104af8368699a49
MD5 120a147c994f2c542956d0a7a91db37b
BLAKE2b-256 169c0251ddbcf51a18bc466bbd670c974001d85fb391a1b7267c1102353afff3

See more details on using hashes here.

Supported by

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