mdvtools.auth.project_auth#
Attributes#
Functions#
|
Performs checks before dispatching a request to a project route. |
Module Contents#
- mdvtools.auth.project_auth.project_pre_dispatch_checks(project_id: str, options: dict)[source]#
Performs checks before dispatching a request to a project route. This function is intended to be used as a ‘before_request’ hook.
Checks if the project exists.
Updates the project’s ‘accessed_timestamp’.
Performs authentication and authorization checks based on the route’s options.
- Parameters:
project_id – The ID of the project being accessed.
options – The options dictionary for the matched route (e.g., {‘access_level’: ‘editable’}).
- Returns:
A Flask Response object to short-circuit the request in case of an error, or None to continue.