sda.api.graph_context ===================== .. py:module:: sda.api.graph_context .. autoapi-nested-parse:: Request-scoped Microsoft Graph bearer token override. Used by the SDA-Cloud (hosted) dashboard: after a user signs in with the web app registration, the access token is stored in the HTTP session and injected into a :class:`contextvars.ContextVar` for the duration of the request so :func:`~sda.api.graph_auth.get_token_auto` can call SharePoint as that user without changing every Graph caller. Functions --------- .. autoapisummary:: sda.api.graph_context.set_request_graph_token sda.api.graph_context.reset_request_graph_token sda.api.graph_context.get_request_graph_token sda.api.graph_context.clear_request_graph_token Module Contents --------------- .. py:function:: set_request_graph_token(token) Set the Graph access token for the current async context; return reset handle. .. py:function:: reset_request_graph_token(ctx) Restore the previous token value (call in ``finally``). .. py:function:: get_request_graph_token() Return the token for this context, or ``None`` if not set. .. py:function:: clear_request_graph_token() Remove any override (sets context to ``None``).