Skip to main content

flask-paranoid

Build status codecov

Simple user session protection.

Quick Start

Here is a simple application that uses Flask-Paranoid to protect the user session:

from flask import Flask
from flask_paranoid import Paranoid

app = Flask(__name__)
app.config['SECRET_KEY'] = 'top-secret!'

paranoid = Paranoid(app)
paranoid.redirect_view = '/'

@app.route('/')
def index():
    return render_template('index.html')

When a client connects to this application, a "paranoid" token will be generated according to the IP address and user agent. In all subsequent requests, the token will be recalculated and checked against the one computed for the first request. If the session cookie is stolen and the attacker tries to use it from another location, the generated token will be different, and in that case the extension will clear the session and block the request.

Resources

Release files for Flask-Paranoid 0.3.0

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-Paranoid 0.3.0
File Size Uploaded
Flask-Paranoid-0.3.0.tar.gz 4.3 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for Flask-Paranoid 0.3.0
File Interpreter ABI Platform
Flask_Paranoid-0.3.0-py3-none-any.whl Python 3 none any Details

Total release size: 8.8 kB

Release files / Flask-Paranoid-0.3.0.tar.gz

Download URL Flask-Paranoid-0.3.0.tar.gz
Size 4.3 kB
Tags Source
SHA-256 checksum
How to use checksums
46c049ba701b25f1ccf3988164e1bfb12320ab55f1de66384b012f7767bb8058
BLAKE2b-256 checksum
How to use checksums
f0038e4eb2d4e3ffdd436a71f273dc6443c30766b55194a009264ee6eb2c5fde
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.0 CPython/3.9.10

Release files / Flask_Paranoid-0.3.0-py3-none-any.whl

Download URL Flask_Paranoid-0.3.0-py3-none-any.whl
Size 4.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
8cb48aadfbee5aefe8a75e7436f3a31e426a170a893f022a50e7e4f569ad0850
BLAKE2b-256 checksum
How to use checksums
f3d73c054c416a575bc1775ef506fddd0faef4af734a8047d815c7cbb600eb5a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.0 CPython/3.9.10

Release history Release notifications | RSS feed

This release

0.3.0 This release

2 release files

0.2.0

2 release files

0.1.0

1 release file

0.0.1

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