API Reference

PASETO (Platform-Agnostic Security Tokens) for Flask applications. <https://github.com/dajiaji/flask-paseto-extended>

class flask_paseto_extended.PasetoCookieSessionInterface(paseto_version: int = 4)[source]

Bases: flask.sessions.SessionInterface

open_session(app: flask.app.Flask, request: flask.wrappers.Request) Optional[flask.sessions.SessionMixin][source]

This method has to be implemented and must either return None in case the loading failed because of a configuration error or an instance of a session object which implements a dictionary like interface + the methods and attributes on SessionMixin.

save_session(app: flask.app.Flask, session: flask.sessions.SessionMixin, response: flask.wrappers.Response) None[source]

This is called for actual sessions returned by open_session() at the end of the request. This is still called during a request context so if you absolutely need access to the request you can do that.

class flask_paseto_extended.PasetoLoginManager(app=None, add_context_processor=True)[source]

Bases: flask_login.login_manager.LoginManager

init_app(app, add_context_processor=True)[source]

Configures an application. This registers an after_request call, and attaches this LoginManager to it as app.login_manager.

Parameters
  • app (flask.Flask) – The flask.Flask object to configure.

  • add_context_processor (bool) – Whether to add a context processor to the app that adds a current_user variable to the template. Defaults to True.