Debian Codegraph @

/

debian flask-paranoid 0.3.0-1debian python3-flask-paranoid python Flask-Paranoid 0.3.0 debianhtmlinimakemakefilemarkdownpythonshelltomlyaml 27 files · 168 symbols
View dependency graph

Depends on

README (full)

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

dir .github/
dir debian/
dir docs/
dir example/
dir src/
dir tests/
file .gitignore
file .travis.yml
file CHANGES.md
file LICENSE
file MANIFEST.in
file README.md
file pyproject.toml
file setup.cfg
file setup.py
file tox.ini