api.auth

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

Functions

require_app(request) → None

require_app_or_automation(request) → None

require_token(setting) → collections.abc.Callable[[fastapi.Request], None]

Only the token held in config.<setting> (read on each request), or ADMIN_TOKEN.

Module Contents

api.auth.INVALID_TOKEN = 'Accès interdit: token invalide'
api.auth.INVALID_ORIGIN = 'Accès interdit: domaine invalide'
api.auth.require_app(request: fastapi.Request) → None
api.auth.require_app_or_automation(request: fastapi.Request) → None
api.auth.require_token(setting: str) → collections.abc.Callable[[fastapi.Request], None]

Only the token held in config.<setting> (read on each request), or ADMIN_TOKEN.