module apps.staticapp.authmount
¶
Short summary¶
module mathenjeu.apps.staticapp.authmount
Custom Router to check for authentification.
Classes¶
class |
truncated documentation |
---|---|
The router checks for authentification by looking for a cookie which contains an alias. This alias can only be set if … |
|
Overloads StaticFiles to check authentification. |
Properties¶
property |
truncated documentation |
---|---|
|
Methods¶
method |
truncated documentation |
---|---|
Checks the user is authenticated, falls back in the previous behavior, otherwise redirect to the authentification … |
|
The ASGI entry point. |
|
|
Retrieves the starlette application and the session. |
|
Retrieves the starlette application and the session. |
Retrieves the starlette application and the session. |
Documentation¶
Custom Router to check for authentification.
- 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.
- Paramètres
path – application mapped to this path
app – application
name – name
- 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
- 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.