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

_CommonMethods

AuthMount

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

AuthStaticFiles

Overloads StaticFiles to check authentification.

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 …

__call__

The ASGI entry point.

__init__

get_app_session

Retrieves the starlette application and the session.

get_app_session

Retrieves the starlette application and the session.

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[[], Awaitable[MutableMapping[str, Any]]], Callable[[MutableMapping[str, Any]], Awaitable[None]]], Awaitable[None]], name: Optional[str] = None)

Bases : mathenjeu.apps.staticapp.authmount._CommonMethods, 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

async __call__(scope: MutableMapping[str, Any], receive: Callable[[], Awaitable[MutableMapping[str, Any]]], send: Callable[[MutableMapping[str, Any]], Awaitable[None]])

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

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

  • app – application

  • name – name

source on GitHub

class mathenjeu.apps.staticapp.authmount.AuthStaticFiles(*, directory: Optional[Union[str, os.PathLike[str]]] = None, packages: Optional[List[str]] = None, html: bool = False, check_dir: bool = True)

Bases : mathenjeu.apps.staticapp.authmount._CommonMethods, starlette.staticfiles.StaticFiles

Overloads StaticFiles to check authentification.

source on GitHub

async __call__(scope: MutableMapping[str, Any], receive: Callable[[], Awaitable[MutableMapping[str, Any]]], send: Callable[[MutableMapping[str, Any]], Awaitable[None]]) None

The ASGI entry point.

class mathenjeu.apps.staticapp.authmount._CommonMethods

Bases : object

get_app_session(scope)

Retrieves the starlette application and the session.

Paramètres

scope – request

Renvoie

application, session

source on GitHub