corvix.web.routes_pages ======================= .. py:module:: corvix.web.routes_pages .. autoapi-nested-parse:: Page routes: SPA shell serving, login form, and session cookie issuing. Attributes ---------- .. autoapisummary:: corvix.web.routes_pages._LOGIN_HTML Functions --------- .. autoapisummary:: corvix.web.routes_pages.index corvix.web.routes_pages.dashboard_index corvix.web.routes_pages._get_auth_secret corvix.web.routes_pages.login_page corvix.web.routes_pages.login corvix.web.routes_pages.logout Module Contents --------------- .. py:data:: _LOGIN_HTML :value: Multiline-String .. raw:: html
Show Value .. code-block:: python """ Corvix — Sign in

Corvix

""" .. raw:: html
.. py:function:: index() -> litestar.Response[str] Serve the dashboard single-page UI. .. py:function:: dashboard_index(dashboard_name: str) -> litestar.Response[str] Serve the dashboard SPA for bookmarkable dashboard URLs. .. py:function:: _get_auth_secret() -> str Return the configured secret, delegating to middleware._get_secret(). Using the shared implementation ensures consistent TTL caching, memoized misconfiguration logging, and ``_FILE`` support in one place. .. py:function:: login_page() -> litestar.Response[Any] Serve the login form, or redirect to / when auth is not configured. .. py:function:: login(request: litestar.Request) -> litestar.Response[None] :async: Validate the submitted token and issue a session cookie on success. The ``Secure`` attribute is set when the request arrived over HTTPS. The scheme is read from ``request.url.scheme`` which reflects the real protocol when uvicorn is started with ``--proxy-headers`` (trusting ``X-Forwarded-Proto`` from a reverse proxy). This avoids raw header inspection from application code, which can be spoofed by untrusted clients not behind a proxy. .. py:function:: logout() -> litestar.Response[None] Clear the session cookie and redirect to the login page.