Skip to main content
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 extension 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.8+

  • 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

Metadata

Release files for flask-praetorian 1.6.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for flask-praetorian 1.6.2
File Size Uploaded
flask_praetorian-1.6.2.tar.gz 18.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for flask-praetorian 1.6.2
File Interpreter ABI Platform
flask_praetorian-1.6.2-py3-none-any.whl Python 3 none any Details

Total release size: 39.1 kB

Release files / flask_praetorian-1.6.2.tar.gz

Download URL flask_praetorian-1.6.2.tar.gz
Size 18.1 kB
Tags Source
SHA-256 checksum
How to use checksums
6fc3077f1e382a764fbd5ec6c5037aa72183d2cebc226ed956f43b25430230c2
BLAKE2b-256 checksum
How to use checksums
6ea77df2bfa24bef494bdbff94d6e4d35a2920c937d8f120d1c4a1fcbd878e48
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.4.1 CPython/3.8.18 Linux/6.11.0-1018-azure

Release files / flask_praetorian-1.6.2-py3-none-any.whl

Download URL flask_praetorian-1.6.2-py3-none-any.whl
Size 21.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
e5f6d559e85798d70985a817df708644eec5d4c21e1ec76df89ef1dc4bd8caa3
BLAKE2b-256 checksum
How to use checksums
7a17605a627ef32b094d688137e4b2a1c4328aedfedb48447383b9af23af7bce
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.4.1 CPython/3.8.18 Linux/6.11.0-1018-azure

Release history Release notifications | RSS feed

This release

1.6.2 This release

2 release files

1.6.1

2 release files

1.6.0

2 release files

1.5.0

2 release files

1.4.0

2 release files

1.3.0

2 release files

1.2.0

2 release files

1.1.0

2 release files

1.0.0

2 release files

0.5.3

2 release files

0.5.2

2 release files

0.5.0

2 release files

0.4.8

1 release file

0.4.7

1 release file

0.4.6

1 release file

0.4.5

1 release file

0.4.4

1 release file

0.4.3

1 release file

0.4.2

1 release file

0.4.1

1 release file

0.4.0

1 release file

0.3.22

1 release file

0.3.21

1 release file

0.3.20

1 release file

0.3.19

1 release file

0.3.18

1 release file

0.3.17

1 release file

0.3.15

1 release file

0.3.14

1 release file

0.3.13

1 release file

0.3.12

1 release file

0.3.11

1 release file

0.3.10

1 release file

0.3.9

1 release file

0.3.8

1 release file

0.3.7

1 release file

0.3.6

1 release file

0.3.5

1 release file

0.3.4

1 release file

0.3.3

1 release file

0.3.2

1 release file

0.3.1

1 release file

0.3.0

1 release file

0.2

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page