api.auth ======== .. py:module:: api.auth .. autoapi-nested-parse:: Who may call which route. Each rule is a FastAPI dependency; every rule also accepts ADMIN_TOKEN. - `require_app`: RewakeApp, RewakeInfo and the Chrome extension, with APP_TOKEN, from one of `config.APP_ORIGINS` (exact Origin or Referer site). - `require_app_or_automation`: the same, or Airtable automations with AIRTABLE_AUTOMATION_TOKEN (they run on Airtable's servers, without an Origin). - `require_token("NAME")`: a partner or a webhook holding the token `config.NAME`. Attributes ---------- .. autoapisummary:: api.auth.INVALID_TOKEN api.auth.INVALID_ORIGIN Functions --------- .. autoapisummary:: api.auth.require_app api.auth.require_app_or_automation api.auth.require_token Module Contents --------------- .. py:data:: INVALID_TOKEN :value: 'Accès interdit: token invalide' .. py:data:: INVALID_ORIGIN :value: 'Accès interdit: domaine invalide' .. py:function:: require_app(request: fastapi.Request) -> None .. py:function:: require_app_or_automation(request: fastapi.Request) -> None .. py:function:: require_token(setting: str) -> collections.abc.Callable[[fastapi.Request], None] Only the token held in `config.` (read on each request), or ADMIN_TOKEN.