module apps.staticapp.authmount

Inheritance diagram of mathenjeu.apps.staticapp.authmount

Short summary

module mathenjeu.apps.staticapp.authmount

Custom Router to check for authentification.

source on GitHub

Classes

class

truncated documentation

AuthMount

The router checks for authentification by looking for a cookie which contains an alias. This alias can only be set if …

Properties

property

truncated documentation

routes

Methods

method

truncated documentation

__call__

Checks the user is authenticated, falls back in the previous behavior, otherwise redirect to the authentification …

__init__

get_app_session

Retrieves the starlette application and the session.

Documentation

Custom Router to check for authentification.

source on GitHub

class mathenjeu.apps.staticapp.authmount.AuthMount(path: str, app: Callable[[MutableMapping[str, Any]], Callable[[Callable[[], Awaitable[MutableMapping[str, Any]]], Callable[[MutableMapping[str, Any]], Awaitable[None]]], Awaitable[None]]], name: str = None)[source]

Bases : starlette.routing.Mount

The router checks for authentification by looking for a cookie which contains an alias. This alias can only be set if the user was able to authentify himself.

source on GitHub

Paramètres
  • path – application mapped to this path

  • app – application

  • name – name

source on GitHub

__call__(scope: MutableMapping[str, Any]) → Callable[[Callable[[], Awaitable[MutableMapping[str, Any]]], Callable[[MutableMapping[str, Any]], Awaitable[None]]], Awaitable[None]][source]

Checks the user is authenticated, falls back in the previous behavior, otherwise redirect to the authentification page (/login).

source on GitHub

__init__(path: str, app: Callable[[MutableMapping[str, Any]], Callable[[Callable[[], Awaitable[MutableMapping[str, Any]]], Callable[[MutableMapping[str, Any]], Awaitable[None]]], Awaitable[None]]], name: str = None) → None[source]
Paramètres
  • path – application mapped to this path

  • app – application

  • name – name

source on GitHub

get_app_session(scope)[source]

Retrieves the starlette application and the session.

Paramètres

scope – request

Renvoie

application, session

source on GitHub