From abcde0ac2a1d31fee4e91c6dc1ca8152e8f44cc7 Mon Sep 17 00:00:00 2001 From: ZTatman Date: Fri, 29 May 2026 15:03:58 -0400 Subject: [PATCH] feat(web): refine auth cleanup and PAT settings --- .vscode/settings.json | 12 ++- .zed/settings.json | 7 -- README.md | 4 +- agents.md | 2 +- docker-compose.yml | 10 +- web/app/auth/crypto.py | 14 +-- web/app/auth/identity.py | 2 +- web/app/auth/session.py | 43 +++++++-- web/app/config.py | 5 +- web/app/main.py | 46 +++++++-- web/app/routers/auth.py | 70 ++++++++++++-- web/app/static/img/forgejo-logo.svg | 1 + web/app/templates/dashboard.html | 67 +++++++------- web/dev.sh | 5 + web/pyproject.toml | 9 ++ web/uv.lock | 139 ++++++++++++++++++++++++++++ 16 files changed, 363 insertions(+), 73 deletions(-) create mode 100644 web/app/static/img/forgejo-logo.svg diff --git a/.vscode/settings.json b/.vscode/settings.json index 5a586b3..60ce007 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -1,3 +1,13 @@ { - "css.lint.unknownAtRules": "ignore" + "css.lint.unknownAtRules": "ignore", + "python.defaultInterpreterPath": "${workspaceFolder}/web/.venv/bin/python", + "python.analysis.typeCheckingMode": "off", + "mypy-type-checker.importStrategy": "fromEnvironment", + "mypy-type-checker.cwd": "${workspaceFolder}/web", + "mypy-type-checker.reportingScope": "workspace", + "mypy-type-checker.args": [ + "--config-file", + "pyproject.toml", + "--show-error-codes" + ] } diff --git a/.zed/settings.json b/.zed/settings.json index b1a3678..c94177b 100644 --- a/.zed/settings.json +++ b/.zed/settings.json @@ -1,11 +1,4 @@ { - "lsp": { - "basedpyright": { - "settings": { - "python.pythonPath": "web/.venv/bin/python" - } - } - }, "languages": { "HTML": { "formatter": { diff --git a/README.md b/README.md index ae7e7cd..17639c6 100644 --- a/README.md +++ b/README.md @@ -99,7 +99,7 @@ The web service authenticates users via Forgejo OAuth. You need to register Myst 1. In Forgejo, go to **Settings** → **Applications** → **Create OAuth2 Application** 2. Set the redirect URI to `https://your-myst-domain.com/auth/callback/forgejo` (or `http://localhost:8000/auth/callback/forgejo` for local dev) 3. Copy the **Client ID** and **Client Secret** Forgejo gives you -4. Generate a Fernet encryption key for OAuth token storage: +4. Generate a Fernet encryption key for token storage: ```bash python3 -c "from cryptography.fernet import Fernet; print(Fernet.generate_key().decode())" @@ -110,7 +110,7 @@ The web service authenticates users via Forgejo OAuth. You need to register Myst ```env FORGEJO_OAUTH_CLIENT_ID=your_client_id FORGEJO_OAUTH_CLIENT_SECRET=your_client_secret - OAUTH_TOKEN_ENCRYPTION_KEY=your_fernet_key_from_step_4 + TOKEN_ENCRYPTION_KEY=your_fernet_key_from_step_4 MYST_PUBLIC_BASE_URL=https://your-myst-domain.com # omit trailing slash; omit for local dev ``` diff --git a/agents.md b/agents.md index 5fb03f4..6bd5a23 100644 --- a/agents.md +++ b/agents.md @@ -82,7 +82,7 @@ This file is the single source of truth for codebase obstacles, oddities, and th ### crypto.py decrypt functions kept proactively **Area:** web/app/auth/crypto.py -**Obstacle:** CodeRabbit flagged missing decryption functions and key validation. Added `decrypt_oauth_token`/`decrypt_optional` + key format validation in `fernet_from_encryption_key`. +**Obstacle:** CodeRabbit flagged missing decryption functions and key validation. Added `decrypt_token`/`decrypt_optional` + key format validation in `fernet_from_encryption_key`. **Solution:** Added the functions even though no consumer exists yet. They will be used for PAT decryption in share link flow. **Preference:** Keep dead code if it's small, symmetric (`encrypt`/`decrypt`), and has an obvious future consumer. diff --git a/docker-compose.yml b/docker-compose.yml index 032e4b2..3da7862 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -28,5 +28,13 @@ services: timeout: 5s retries: 5 + adminer: + image: adminer:latest + ports: + - "8080:8080" + depends_on: + db: + condition: service_healthy + volumes: - postgres_data: \ No newline at end of file + postgres_data: diff --git a/web/app/auth/crypto.py b/web/app/auth/crypto.py index 52807b5..822ff3e 100644 --- a/web/app/auth/crypto.py +++ b/web/app/auth/crypto.py @@ -14,13 +14,13 @@ def fernet_from_encryption_key(key: SecretStr) -> Fernet | None: return Fernet(raw.encode()) except Exception as e: msg = ( - f"Invalid OAUTH_TOKEN_ENCRYPTION_KEY: {e}. " + f"Invalid TOKEN_ENCRYPTION_KEY: {e}. " "Generate a valid key with cryptography.fernet.Fernet.generate_key().decode()" ) raise ValueError(msg) from e -def encrypt_oauth_token(fernet: Fernet, raw_token: str) -> str: +def encrypt_token(fernet: Fernet, raw_token: str) -> str: return fernet.encrypt(raw_token.encode()).decode() @@ -29,14 +29,14 @@ def encrypt_optional(fernet: Fernet | None, raw_token: str | None) -> str | None return None if fernet is None: msg = ( - "OAuth token encryption is not configured: set OAUTH_TOKEN_ENCRYPTION_KEY " + "Token encryption is not configured: set TOKEN_ENCRYPTION_KEY " "to the output of cryptography.fernet.Fernet.generate_key().decode()" ) raise ValueError(msg) - return encrypt_oauth_token(fernet, raw_token) + return encrypt_token(fernet, raw_token) -def decrypt_oauth_token(fernet: Fernet, encrypted_token: str) -> str: +def decrypt_token(fernet: Fernet, encrypted_token: str) -> str: try: return fernet.decrypt(encrypted_token.encode()).decode() except InvalidToken: @@ -51,8 +51,8 @@ def decrypt_optional(fernet: Fernet | None, encrypted_token: str | None) -> str return None if fernet is None: msg = ( - "OAuth token encryption is not configured: set OAUTH_TOKEN_ENCRYPTION_KEY " + "Token encryption is not configured: set TOKEN_ENCRYPTION_KEY " "to the output of cryptography.fernet.Fernet.generate_key().decode()" ) raise ValueError(msg) - return decrypt_oauth_token(fernet, encrypted_token) + return decrypt_token(fernet, encrypted_token) diff --git a/web/app/auth/identity.py b/web/app/auth/identity.py index 2e744ac..556ae95 100644 --- a/web/app/auth/identity.py +++ b/web/app/auth/identity.py @@ -26,7 +26,7 @@ async def find_or_create_user( """Find or create a user based on the given provider and identity details.""" # Create a Fernet instance for encrypting tokens if a key is available - fernet = fernet_from_encryption_key(settings.oauth_token_encryption_key) + fernet = fernet_from_encryption_key(settings.token_encryption_key) # Query the database for an existing identity result = await db.execute( diff --git a/web/app/auth/session.py b/web/app/auth/session.py index d0ca611..52b69a1 100644 --- a/web/app/auth/session.py +++ b/web/app/auth/session.py @@ -4,6 +4,7 @@ import hashlib import secrets import uuid from datetime import UTC, datetime, timedelta +from typing import Annotated from fastapi import Cookie, Depends, HTTPException, Response, status from sqlalchemy import select, update @@ -20,6 +21,10 @@ SESSION_DURATION_DAYS = 7 async def create_session( db: AsyncSession, response: Response, user_id: uuid.UUID, secure: bool = True ) -> None: + """Create a persisted browser session and set its cookie on the response.""" + + # The browser gets the raw token, but the database only stores its hash. + # This keeps a leaked sessions table from containing usable cookie values. raw_token = secrets.token_hex(32) token_hash = hashlib.sha256(raw_token.encode()).hexdigest() expires_at = datetime.now(UTC) + timedelta(days=SESSION_DURATION_DAYS) @@ -30,9 +35,11 @@ async def create_session( ) db.add(row) await db.commit() + # HttpOnly keeps client-side scripts from reading the session cookie. Lax is + # enough for normal navigation while reducing cross-site request exposure. response.set_cookie( key=SESSION_COOKIE, - value=raw_token, + value=raw_token, # raw token is stored in the cookie, not the hash httponly=True, samesite="lax", secure=secure, @@ -45,8 +52,14 @@ async def _lookup_session( db: AsyncSession, myst_session: str | None, ) -> Session | None: + """Return the active session for a raw cookie token, if one exists.""" + + # Missing cookie means anonymous request. Callers decide whether anonymous is + # acceptable with get_optional_session or should become a 401. if not myst_session: return None + # Match the incoming cookie by hashing it the same way create_session did. + # Only active, non-expired sessions are accepted. token_hash = hashlib.sha256(myst_session.encode()).hexdigest() now = datetime.now(UTC) stmt = ( @@ -62,6 +75,8 @@ async def _lookup_session( sess = result.scalar_one_or_none() if sess is None: return None + # Track activity whenever a valid cookie is used, then refresh the related + # user so route handlers can safely access sess.user. sess.last_seen_at = now await db.commit() await db.refresh(sess, attribute_names=["user"]) @@ -69,9 +84,12 @@ async def _lookup_session( async def get_current_session( - db: AsyncSession = Depends(get_db), - myst_session: str | None = Cookie(default=None), + db: Annotated[AsyncSession, Depends(get_db)], + myst_session: Annotated[str | None, Cookie()] = None, ) -> Session: + """FastAPI dependency that requires a valid signed-in session.""" + + # Use this dependency on routes that require a signed-in user. sess = await _lookup_session(db, myst_session) if sess is None: raise HTTPException( @@ -82,13 +100,19 @@ async def get_current_session( async def get_optional_session( - db: AsyncSession = Depends(get_db), - myst_session: str | None = Cookie(default=None), + db: Annotated[AsyncSession, Depends(get_db)], + myst_session: Annotated[str | None, Cookie()] = None, ) -> Session | None: + """FastAPI dependency that returns the current session when available. Used on pages that can render differently for anonymous and signed-in users.""" + return await _lookup_session(db, myst_session) async def revoke_session(db: AsyncSession, response: Response, myst_session: str | None) -> None: + """Delete the browser cookie and mark the matching session as revoked.""" + + # Always ask the browser to delete its cookie, even if the DB row is already + # missing or revoked. response.delete_cookie( key=SESSION_COOKIE, path="/", @@ -97,10 +121,17 @@ async def revoke_session(db: AsyncSession, response: Response, myst_session: str ) if not myst_session: return + # Revoke by hash for the same reason we store sessions by hash: the raw + # cookie token should only exist in the browser. token_hash = hashlib.sha256(myst_session.encode()).hexdigest() - await db.execute( + result = await db.execute( update(Session) .where(Session.token_hash == token_hash, Session.revoked_at.is_(None)) .values(revoked_at=datetime.now(UTC)) ) await db.commit() + + # Bypasses the strict static type checking check safely + rowcount = getattr(result, "rowcount", 0) + if rowcount == 0: + pass diff --git a/web/app/config.py b/web/app/config.py index 76b1870..aabe8f4 100644 --- a/web/app/config.py +++ b/web/app/config.py @@ -1,5 +1,6 @@ from functools import lru_cache from pathlib import Path +from typing import ClassVar from pydantic import SecretStr from pydantic_settings import BaseSettings, SettingsConfigDict @@ -18,9 +19,9 @@ class Settings(BaseSettings): # Public Myst base URL for OAuth redirect_uri (no trailing slash). If empty, Request.base_url is used. myst_public_base_url: str = "" # URL-safe base64 Fernet key (see `cryptography.fernet.Fernet.generate_key()`). Required to persist OAuth tokens and user PATs. - oauth_token_encryption_key: SecretStr = SecretStr("") + token_encryption_key: SecretStr = SecretStr("") - model_config = SettingsConfigDict(env_file=str(env_file)) + model_config: ClassVar[SettingsConfigDict] = SettingsConfigDict(env_file=str(env_file)) @lru_cache diff --git a/web/app/main.py b/web/app/main.py index 06bacb6..5cc7385 100644 --- a/web/app/main.py +++ b/web/app/main.py @@ -1,15 +1,19 @@ from contextlib import asynccontextmanager from pathlib import Path +from typing import Annotated -from fastapi import Depends, FastAPI, Request +from fastapi import Depends, FastAPI, Form, HTTPException, Request, status +from fastapi.responses import RedirectResponse from fastapi.staticfiles import StaticFiles from jinja2_fragments.fastapi import Jinja2Blocks from sqlalchemy.ext.asyncio import AsyncSession, async_sessionmaker, create_async_engine -import app.models # noqa: F401 - register ORM tables on metadata +from app import models as _models # noqa: F401 - register ORM tables on metadata +from app.auth.crypto import encrypt_optional, fernet_from_encryption_key from app.auth.session import get_current_session, get_optional_session -from app.config import get_settings +from app.config import Settings, get_settings from app.database import Base +from app.deps import get_db from app.models.session import Session as UserBrowserSession from app.routers import auth, links @@ -46,7 +50,9 @@ app.include_router(links.router) @app.get("/") -async def root(request: Request, sess: UserBrowserSession | None = Depends(get_optional_session)): +async def root( + request: Request, sess: Annotated[UserBrowserSession | None, Depends(get_optional_session)] +): return templates.TemplateResponse( request, "index.html", @@ -55,9 +61,37 @@ async def root(request: Request, sess: UserBrowserSession | None = Depends(get_o @app.get("/dashboard") -async def dashboard(request: Request, sess: UserBrowserSession = Depends(get_current_session)): +async def dashboard( + request: Request, sess: Annotated[UserBrowserSession, Depends(get_current_session)] +): return templates.TemplateResponse( request, "dashboard.html", - {"user": sess.user}, + { + "user": sess.user, + "pat_registered": request.query_params.get("pat") == "registered", + }, + ) + + +@app.post("/dashboard/pat") +async def register_pat( + pat: Annotated[str, Form()], + db: Annotated[AsyncSession, Depends(get_db)], + settings: Annotated[Settings, Depends(get_settings)], + sess: Annotated[UserBrowserSession, Depends(get_current_session)], +) -> RedirectResponse: + pat = pat.strip() + if not pat: + raise HTTPException( + status_code=status.HTTP_400_BAD_REQUEST, detail="Forgejo access token is required." + ) + + fernet = fernet_from_encryption_key(settings.token_encryption_key) + sess.user.pat_encrypted = encrypt_optional(fernet, pat) + await db.commit() + + return RedirectResponse( + "/dashboard?pat=registered#forgejo-access-token", + status_code=status.HTTP_303_SEE_OTHER, ) diff --git a/web/app/routers/auth.py b/web/app/routers/auth.py index b63dd6b..6525140 100644 --- a/web/app/routers/auth.py +++ b/web/app/routers/auth.py @@ -2,6 +2,7 @@ from __future__ import annotations import secrets from datetime import UTC, datetime, timedelta +from typing import Annotated from urllib.parse import urlencode import httpx @@ -21,6 +22,10 @@ router = APIRouter(prefix="/auth", tags=["auth"]) async def _forgejo_post(settings: Settings, path: str, data: dict) -> dict: + """POST form data to a Forgejo API path and return the JSON response.""" + + # Keep Forgejo HTTP calls in small helpers so route handlers read as the + # OAuth flow instead of low-level request/response plumbing. url = f"{settings.forgejo_base_url.rstrip('/')}{path}" try: async with httpx.AsyncClient(timeout=30.0) as client: @@ -39,6 +44,8 @@ async def _forgejo_post(settings: Settings, path: str, data: dict) -> dict: async def _forgejo_get(settings: Settings, path: str, token: str) -> dict: + """GET a Forgejo API path with a provider access token.""" + url = f"{settings.forgejo_base_url.rstrip('/')}{path}" try: async with httpx.AsyncClient(timeout=30.0) as client: @@ -60,6 +67,10 @@ async def _forgejo_get(settings: Settings, path: str, token: str) -> dict: def _set_oauth_state_cookie(response: Response, state: str) -> None: + """Set the short-lived OAuth state cookie used to verify the callback.""" + + # Store the OAuth state server-to-browser only. The callback must echo this + # value back, which ties the callback to the login request we initiated. response.set_cookie( key="oauth_state", value=state, @@ -71,6 +82,10 @@ def _set_oauth_state_cookie(response: Response, state: str) -> None: def _verify_oauth_state(state: str | None, oauth_state: str | None) -> None: + """Validate the OAuth state query parameter against the stored cookie.""" + + # Use constant-time comparison because this value is part of the CSRF + # defense for the OAuth redirect flow. if not state or not oauth_state or not secrets.compare_digest(state, oauth_state): raise HTTPException( status_code=status.HTTP_400_BAD_REQUEST, @@ -82,6 +97,10 @@ def _verify_oauth_state(state: str | None, oauth_state: str | None) -> None: def _parse_token_response(data: dict) -> tuple[str, str | None, datetime | None]: + """Extract access token, refresh token, and expiry from Forgejo OAuth data.""" + + # Forgejo's token response is external input, so normalize it before the + # rest of the app stores or relies on any values. access_token = data.get("access_token") if not access_token or not isinstance(access_token, str): raise HTTPException( @@ -99,12 +118,16 @@ def _parse_token_response(data: dict) -> tuple[str, str | None, datetime | None] def _parse_user_response(data: dict) -> tuple[str, str, str | None]: + """Extract the Forgejo identity fields needed for local user linking.""" + + # Provider id and username are the stable link between Forgejo and our local + # user record. Email is optional because providers may omit or hide it. provider_user_id = str(data.get("id", "")).strip() - provider_username = str(data.get("login", "")).strip() + provider_username = str(data.get("username", "")).strip() if not provider_user_id or not provider_username: raise HTTPException( status_code=status.HTTP_502_BAD_GATEWAY, - detail="Forgejo user response missing id or login.", + detail="Forgejo user response missing id or username.", ) email_val = data.get("email") email = email_val if isinstance(email_val, str) and email_val.strip() else None @@ -115,6 +138,10 @@ def _parse_user_response(data: dict) -> tuple[str, str, str | None]: def _forgejo_oauth_redirect_uri(request: Request, settings: Settings) -> str: + """Return the callback URL registered with Forgejo for this request.""" + + # In production, prefer the configured public base URL so Forgejo sees the + # same callback URL users do. Locally, fall back to FastAPI's generated URL. base_url = settings.myst_public_base_url.strip().rstrip("/") if base_url: return f"{base_url}/auth/callback/forgejo" @@ -122,6 +149,10 @@ def _forgejo_oauth_redirect_uri(request: Request, settings: Settings) -> str: def _require_forgejo_oauth_config(settings: Settings) -> None: + """Raise a setup error when the Forgejo OAuth settings are incomplete.""" + + # Fail before redirecting when OAuth is only partially configured. This gives + # a clearer setup error than a failed request after the user leaves the app. if not settings.forgejo_base_url.strip(): raise HTTPException( status_code=status.HTTP_503_SERVICE_UNAVAILABLE, @@ -145,10 +176,14 @@ def _require_forgejo_oauth_config(settings: Settings) -> None: @router.get("/login/forgejo") async def login_forgejo( - request: Request, settings: Settings = Depends(get_settings) + request: Request, settings: Annotated[Settings, Depends(get_settings)] ) -> RedirectResponse: + """Redirect the browser to Forgejo to begin OAuth sign-in.""" + _require_forgejo_oauth_config(settings) + # Start the OAuth authorization-code flow. Forgejo receives our callback URL + # and the random state value; the user's browser is redirected there next. redirect_uri = _forgejo_oauth_redirect_uri(request, settings) state = secrets.token_urlsafe(32) query = urlencode( @@ -168,13 +203,17 @@ async def login_forgejo( @router.get("/callback/forgejo", name="forgejo_oauth_callback") async def callback_forgejo( request: Request, - db: AsyncSession = Depends(get_db), - settings: Settings = Depends(get_settings), + db: Annotated[AsyncSession, Depends(get_db)], + settings: Annotated[Settings, Depends(get_settings)], code: str | None = None, state: str | None = None, - oauth_state: str | None = Cookie(default=None), + oauth_state: Annotated[str | None, Cookie()] = None, ) -> RedirectResponse: + """Handle Forgejo's OAuth callback and create a local app session.""" + _require_forgejo_oauth_config(settings) + # The callback must include the same state value we put in the cookie during + # login, otherwise this could be an unsolicited OAuth response. _verify_oauth_state(state, oauth_state) if not code: @@ -183,9 +222,14 @@ async def callback_forgejo( detail="Forgejo did not return an authorization code. The user may have denied consent.", ) + # Build the response before session creation so the session cookie is set on + # the exact RedirectResponse returned to the browser. redirect = RedirectResponse("/dashboard", status_code=status.HTTP_302_FOUND) redirect.delete_cookie("oauth_state") + # Exchange Forgejo's short-lived authorization code for provider tokens. + # These tokens identify the Forgejo account, but they are not our app + # session cookie. token_data = await _forgejo_post( settings, "/login/oauth/access_token", @@ -199,9 +243,13 @@ async def callback_forgejo( ) access_token, refresh_plain, expires_at = _parse_token_response(token_data) + # Use the provider access token once to fetch the Forgejo account profile we + # link to our local users table. user_data = await _forgejo_get(settings, "/api/v1/user", access_token) provider_user_id, provider_username, email = _parse_user_response(user_data) + # Upsert the local user and linked identity. Provider tokens are encrypted + # before they are stored by find_or_create_user. user = await find_or_create_user( db, settings, @@ -214,15 +262,21 @@ async def callback_forgejo( refresh_token_raw=refresh_plain, ) + # After OAuth succeeds, use our own session cookie for normal app requests. + # The raw cookie value is sent to the browser; only its hash is stored. await create_session(db, redirect, user.id, secure=request.url.scheme == "https") return redirect @router.get("/logout") async def logout( - db: AsyncSession = Depends(get_db), - myst_session: str | None = Cookie(default=None), + db: Annotated[AsyncSession, Depends(get_db)], + myst_session: Annotated[str | None, Cookie()] = None, ) -> RedirectResponse: + """Revoke the current app session and redirect back to the home page.""" + + # revoke_session must receive this redirect response, otherwise the + # Set-Cookie delete header would be written to an unused Response object. redirect = RedirectResponse("/", status_code=status.HTTP_302_FOUND) await revoke_session(db, redirect, myst_session) return redirect diff --git a/web/app/static/img/forgejo-logo.svg b/web/app/static/img/forgejo-logo.svg new file mode 100644 index 0000000..804b05e --- /dev/null +++ b/web/app/static/img/forgejo-logo.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/web/app/templates/dashboard.html b/web/app/templates/dashboard.html index b95becd..170cd48 100644 --- a/web/app/templates/dashboard.html +++ b/web/app/templates/dashboard.html @@ -26,39 +26,44 @@

Viewer activity will appear here.

-
+
-

Forgejo access token

-

- Register a read:repository-scoped PAT - to enable share link viewing. -

+ {% if pat_registered %} +
Forgejo access token registered.
+ {% else %} +

Forgejo access token

+

+ Register a read:repository-scoped PAT + to enable share link viewing. +

+
+
+
+
+ + +
+ +
+
+ +
+
+
+ {% endif %}
-
-
-
-
- - -
- -
-
- -
-
-
diff --git a/web/dev.sh b/web/dev.sh index e2502fc..c37f35f 100755 --- a/web/dev.sh +++ b/web/dev.sh @@ -6,11 +6,16 @@ cd "$(dirname "$0")" export DATABASE_URL="postgresql+asyncpg://myst:myst@localhost:5432/myst_db" export MYST_PUBLIC_BASE_URL="http://localhost:8000" +echo "Starting local Postgres and Adminer..." +docker compose -f ../docker-compose.yml up -d db adminer + echo "Building Tailwind CSS..." ./tailwindcss -i ./app/static/css/input.css -o ./app/static/css/output.css echo "Starting Myst dev server..." echo " FastAPI: http://localhost:8000" +echo " Adminer: http://localhost:8080" +echo " PostgreSQL / db / myst / myst / myst_db" echo " CSS: watching app/static/css/input.css" ./tailwindcss -i ./app/static/css/input.css -o ./app/static/css/output.css --watch & diff --git a/web/pyproject.toml b/web/pyproject.toml index 4bda3eb..bc29401 100644 --- a/web/pyproject.toml +++ b/web/pyproject.toml @@ -24,10 +24,19 @@ dependencies = [ [dependency-groups] dev = [ "djlint>=1.36.1", + "mypy>=1.19.0", "ruff>=0.11.0", "uvicorn[standard]>=0.44.0", ] +[tool.mypy] +python_version = "3.13" +files = ["app"] +check_untyped_defs = true +warn_unused_ignores = true +warn_redundant_casts = true +strict_optional = true + [tool.djlint] indent = 2 profile = "jinja" diff --git a/web/uv.lock b/web/uv.lock index c933cde..7c30baf 100644 --- a/web/uv.lock +++ b/web/uv.lock @@ -1,6 +1,10 @@ version = 1 revision = 3 requires-python = ">=3.13" +resolution-markers = [ + "python_full_version >= '3.15'", + "python_full_version < '3.15'", +] [[package]] name = "aiofiles" @@ -41,6 +45,46 @@ wheels = [ { url = "https://files.pythonhosted.org/packages/da/42/e921fccf5015463e32a3cf6ee7f980a6ed0f395ceeaa45060b61d86486c2/anyio-4.13.0-py3-none-any.whl", hash = "sha256:08b310f9e24a9594186fd75b4f73f4a4152069e3853f1ed8bfbf58369f4ad708", size = 114353, upload-time = "2026-03-24T12:59:08.246Z" }, ] +[[package]] +name = "ast-serialize" +version = "0.5.0" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/81/9d/09e27731bd5864a9ce04e3244074e674bb8936bf62b45e0357248717adac/ast_serialize-0.5.0.tar.gz", hash = "sha256:5880091bfe6f4f986f22866375c2e884843e7a0b6343ae41aeea659613d879b6", size = 61157, upload-time = "2026-05-17T17:48:29.429Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/c0/9a/13dde51ba9e15f8b97957ab7cb0120d0e381524d651c6bd630b9c359227f/ast_serialize-0.5.0-cp314-cp314t-macosx_10_12_x86_64.whl", hash = "sha256:8f5c14f169eb0972c0c21bada5358b23d6047c76583b005234f865b11f1fa00a", size = 1183520, upload-time = "2026-05-17T17:47:30.831Z" }, + { url = "https://files.pythonhosted.org/packages/37/de/5a7f0a9fe68944f536632a5af84676739c7d2582be42deb082634bf3a754/ast_serialize-0.5.0-cp314-cp314t-macosx_11_0_arm64.whl", hash = "sha256:7d1a2de9de5be04652f0ed60738356ef94f66db37924a9499fffe98dc491aa0b", size = 1175779, upload-time = "2026-05-17T17:47:32.551Z" }, + { url = "https://files.pythonhosted.org/packages/9c/81/0bb853e76e4f6e9a1855d569003c59e19ffac45f7079d91505d1bb212f92/ast_serialize-0.5.0-cp314-cp314t-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:be5173fb66f9b49026d9d5a2ff0fc7c7009077107c0eb285b2d60fdf1fe10bd1", size = 1233750, upload-time = "2026-05-17T17:47:34.731Z" }, + { url = "https://files.pythonhosted.org/packages/e5/d3/4cf705beeccc08754d0bbda99aefff26110e209b9a07ac8a6b60eec48531/ast_serialize-0.5.0-cp314-cp314t-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:f8015cd071ac1339924ee2b8098c93e00e155f30a16f40ec9816fcf84f4753f6", size = 1235942, upload-time = "2026-05-17T17:47:36.287Z" }, + { url = "https://files.pythonhosted.org/packages/26/c8/ee097e437ea27dd2b8b227865c875492b585650a5802a22d82b304c8201b/ast_serialize-0.5.0-cp314-cp314t-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:5499e8797edff2a9186aa313ed382c6b422e798e9332d9953badcee6e69a88f2", size = 1442517, upload-time = "2026-05-17T17:47:38.17Z" }, + { url = "https://files.pythonhosted.org/packages/ff/bd/68063442838f1ba68ec72b5436430bc75b3bb17a1a3c3063f09b0c05ae2b/ast_serialize-0.5.0-cp314-cp314t-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:6848f2a093fb5548751a9a09bff8fcd229e2bbeb0e3331f391b6ae6d26cd9903", size = 1254081, upload-time = "2026-05-17T17:47:39.826Z" }, + { url = "https://files.pythonhosted.org/packages/50/e2/1e520793bc6a4e4524a6ab022391e827825eaa0c3811828bfdc6852eca26/ast_serialize-0.5.0-cp314-cp314t-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:832d4c998e0b091fd60a6d6bceee535483c4d490de9ba85003af835225719261", size = 1259910, upload-time = "2026-05-17T17:47:41.369Z" }, + { url = "https://files.pythonhosted.org/packages/4e/e1/49b60f467979979cfe6913b43948ff25bca971ad0591d181812f163a988e/ast_serialize-0.5.0-cp314-cp314t-manylinux_2_31_riscv64.whl", hash = "sha256:16db7c62ec0b8efe1d7afd283a388d8f74f2605d56032e5a37747d2de8dba027", size = 1250678, upload-time = "2026-05-17T17:47:43.702Z" }, + { url = "https://files.pythonhosted.org/packages/74/ba/66ab9555de6275677566f6574e5ef6c29cb185ea866f643bc06f8280a8ee/ast_serialize-0.5.0-cp314-cp314t-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:baf5eb061eb5bccade4128ad42da33787d72f6013809cd1b590376ece8b3c937", size = 1301603, upload-time = "2026-05-17T17:47:46.256Z" }, + { url = "https://files.pythonhosted.org/packages/66/42/6aca9b9abc710014b2be9059689e5dd1679339e78f567ffb4d255a9e2050/ast_serialize-0.5.0-cp314-cp314t-musllinux_1_2_aarch64.whl", hash = "sha256:104e4a35bd7c124173c41760ef9aaea17ddb3f86c65cb643671d59afbe3ee94c", size = 1410332, upload-time = "2026-05-17T17:47:47.899Z" }, + { url = "https://files.pythonhosted.org/packages/47/68/2f76594432a22581ecf878b5e75a9b8601c24b2241cf0bbeb1e21fcf370c/ast_serialize-0.5.0-cp314-cp314t-musllinux_1_2_armv7l.whl", hash = "sha256:36be371028fc1675acb38a331bde160dbab7ff907fdf00b67eb6911aa106951b", size = 1509979, upload-time = "2026-05-17T17:47:50.942Z" }, + { url = "https://files.pythonhosted.org/packages/40/ac/a93c9b58292653f6c595752f677a08e608f903b710594909e9231a389b3b/ast_serialize-0.5.0-cp314-cp314t-musllinux_1_2_i686.whl", hash = "sha256:061ee58bdb52341c8201a6df41182a977736bae3b7ded87ca7176ca25a8a47ab", size = 1505002, upload-time = "2026-05-17T17:47:54.093Z" }, + { url = "https://files.pythonhosted.org/packages/14/2e/b278f68c497ee2f1d1576cbbef8db5281cd4a5f2db040537592ac9c8862e/ast_serialize-0.5.0-cp314-cp314t-musllinux_1_2_x86_64.whl", hash = "sha256:b15219e9cdc9f53f6f4cb51c009203507228226148c05c5e8fe451c28b435eb3", size = 1456231, upload-time = "2026-05-17T17:47:56.311Z" }, + { url = "https://files.pythonhosted.org/packages/0b/43/419be1c566a4c504cd8fd60ce2f84e790f295495c0f327cfaeadf3d51012/ast_serialize-0.5.0-cp314-cp314t-win32.whl", hash = "sha256:842d1c004bb466c7df036f95fabef789570541922b10976b12f5592a69cf0b38", size = 1058668, upload-time = "2026-05-17T17:47:58.305Z" }, + { url = "https://files.pythonhosted.org/packages/03/6f/c9d4d549295ed05111aeb8853232d1afd9d0a179fddb01eeffbb3a4a6842/ast_serialize-0.5.0-cp314-cp314t-win_amd64.whl", hash = "sha256:b0c06d760909b095cc466356dfccd05a1c7233a6ca191c020dca2c6a6f16c24c", size = 1101075, upload-time = "2026-05-17T17:48:00.35Z" }, + { url = "https://files.pythonhosted.org/packages/d0/8e/d00c5ab30c58222e07d62956fca86c59d91b9ad32997e633c38b526623a3/ast_serialize-0.5.0-cp314-cp314t-win_arm64.whl", hash = "sha256:787baedb0262cc49e8ce37cc15c00ae818e46a165a3b36f5e21ed174998104cb", size = 1075347, upload-time = "2026-05-17T17:48:01.753Z" }, + { url = "https://files.pythonhosted.org/packages/e0/9e/dc2530acb3a60dc6e46d65abf27d1d9f86721694757906a148d90a6860de/ast_serialize-0.5.0-cp39-abi3-macosx_10_12_x86_64.whl", hash = "sha256:0668aa9459cfa8c9c49ddd2163ebcf43088ba045ef7492af6fe22e0098303101", size = 1191380, upload-time = "2026-05-17T17:48:03.738Z" }, + { url = "https://files.pythonhosted.org/packages/26/0a/bd3d18a582f273d6c843d16bb9e22e9e16365ff7991e92f18f798e9f1224/ast_serialize-0.5.0-cp39-abi3-macosx_11_0_arm64.whl", hash = "sha256:bf683d6363edf2b39eed6b6d4fe22d34b6203867a67e27134d9e2a2680c4bc4a", size = 1183879, upload-time = "2026-05-17T17:48:05.463Z" }, + { url = "https://files.pythonhosted.org/packages/40/ae/1f919100f8620887af58fcc381c61a1f218cdf89c6e155f87b213e61010a/ast_serialize-0.5.0-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:9cc22cf0c9be65e71cf88fda130af60d61eb4a79370ad4cfe7900d48a4aa2211", size = 1244529, upload-time = "2026-05-17T17:48:07.008Z" }, + { url = "https://files.pythonhosted.org/packages/c6/ca/6376559dcce707cdbc1d0d9a13c8d3baaaa501e949ce0ebdc4230cd881aa/ast_serialize-0.5.0-cp39-abi3-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:f66173891548c9f2726bf27957b41cabce12fa679dc6da505ddbde4d4b3b31cf", size = 1240560, upload-time = "2026-05-17T17:48:08.46Z" }, + { url = "https://files.pythonhosted.org/packages/35/b2/a620e206b5aeb7efbf2710336df57d457cffbb3991076bbcc1147ef9abd4/ast_serialize-0.5.0-cp39-abi3-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:e42d729ef2be96a14efbad355093284739e3670ece3e534f82cc8832790911d9", size = 1451172, upload-time = "2026-05-17T17:48:09.922Z" }, + { url = "https://files.pythonhosted.org/packages/fa/e0/4ad5c04c24a40481b2935ce9a0ccdb6023dc8b667167d06ae530cc3512f2/ast_serialize-0.5.0-cp39-abi3-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:b725026bafa801dbd7310eb13a75f0a2e370e7e51b2cb225f9d21fcfadf919ee", size = 1265072, upload-time = "2026-05-17T17:48:11.469Z" }, + { url = "https://files.pythonhosted.org/packages/b2/71/4d1d479aa56d0101c40e17720c3d6ac2af7269ea0487a80b18e7bfd1a5b7/ast_serialize-0.5.0-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:b54f60c1d78767a53b67eaa663f0dfac3afe606aa07f1301572f588b73d64809", size = 1270488, upload-time = "2026-05-17T17:48:13.575Z" }, + { url = "https://files.pythonhosted.org/packages/6d/4f/0de1bbe06f6edef9fde4ed12ca8e7b3ec7e6e2bd4e672c5af487f7957665/ast_serialize-0.5.0-cp39-abi3-manylinux_2_31_riscv64.whl", hash = "sha256:27d51654fc240a1e87e742d353d98eb45b75f62f129086b3596ab53df2ac2a43", size = 1260702, upload-time = "2026-05-17T17:48:15.141Z" }, + { url = "https://files.pythonhosted.org/packages/75/61/e00872439cfdddcc3c1b6cdaa6e5d904ba8e26a18807c67c4e14409d0ca8/ast_serialize-0.5.0-cp39-abi3-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:2782c36237c46dd1674542f2109740ea5ea485a169bf1431939ada0434e17934", size = 1311182, upload-time = "2026-05-17T17:48:16.779Z" }, + { url = "https://files.pythonhosted.org/packages/76/8e/699a5b955f7926956c95e9e1d74132acad73c2fe7a426f94da89123c20aa/ast_serialize-0.5.0-cp39-abi3-musllinux_1_2_aarch64.whl", hash = "sha256:1943db345233cc7194a470f13afa9c59772c0b123dea0c9414c4d4ca54369759", size = 1421410, upload-time = "2026-05-17T17:48:18.527Z" }, + { url = "https://files.pythonhosted.org/packages/a9/ae/d5b7626874478997adc7a29ab28accf21e596fb590c944290401dfd0b29e/ast_serialize-0.5.0-cp39-abi3-musllinux_1_2_armv7l.whl", hash = "sha256:df1c00022cbbcb064bfaa505aa9c9295362443ce5dacb459d1331d3da353f887", size = 1516587, upload-time = "2026-05-17T17:48:20.133Z" }, + { url = "https://files.pythonhosted.org/packages/0c/ce/b59e02a82d9c4244d64cde502e0b00e83e38816abe19155ceb5437402c7f/ast_serialize-0.5.0-cp39-abi3-musllinux_1_2_i686.whl", hash = "sha256:cae65289fc456fde04af979a2be09302ef5d8ab92ef23e596d6746dc267ada27", size = 1515171, upload-time = "2026-05-17T17:48:21.921Z" }, + { url = "https://files.pythonhosted.org/packages/8b/38/d8d90042747d05aa08d4efcf1c99035a5f670a6bf4c214d31644392afbca/ast_serialize-0.5.0-cp39-abi3-musllinux_1_2_x86_64.whl", hash = "sha256:239a4c354e8d676e9d94631d1d4a64edc6b266f86ff3a5a80aedd344f342c01d", size = 1464668, upload-time = "2026-05-17T17:48:23.544Z" }, + { url = "https://files.pythonhosted.org/packages/dd/51/5b840c4df7334104cecffa28f23904fe81ca89ca223d2450e288de39fd3c/ast_serialize-0.5.0-cp39-abi3-win32.whl", hash = "sha256:143a4ef63285a075871908fda3672dc21864b83a8ec3ee12304aa3e4c5387b9a", size = 1068311, upload-time = "2026-05-17T17:48:25.027Z" }, + { url = "https://files.pythonhosted.org/packages/41/11/ca5672c7d491825bc4cd6702dea106a6b60d928707712ec257c7833ae476/ast_serialize-0.5.0-cp39-abi3-win_amd64.whl", hash = "sha256:cf25572c526add400f26a4750dc6ce0c3bb93fc1f75e7ae0cad4ce4f2cd5c590", size = 1108931, upload-time = "2026-05-17T17:48:26.591Z" }, + { url = "https://files.pythonhosted.org/packages/45/19/cc8bd127d28a43da249aa955cfd164cf8fd534e79e42cea96c4854d72fd0/ast_serialize-0.5.0-cp39-abi3-win_arm64.whl", hash = "sha256:92a31c9c20d25a076edaeec76b128a3535d74a24f340b9a8a7e96c9b86dc9642", size = 1081181, upload-time = "2026-05-17T17:48:28.122Z" }, +] + [[package]] name = "asyncpg" version = "0.31.0" @@ -437,6 +481,53 @@ wheels = [ { url = "https://files.pythonhosted.org/packages/b8/42/cf027b4ac873b076189d935b135397675dac80cb29acb13e1ab86ad6c631/json5-0.14.0-py3-none-any.whl", hash = "sha256:56cf861bab076b1178eb8c92e1311d273a9b9acea2ccc82c276abf839ebaef3a", size = 36271, upload-time = "2026-03-27T22:50:47.073Z" }, ] +[[package]] +name = "librt" +version = "0.11.0" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/40/08/9e7f6b5d2b5bed6ad055cdd5925f192bb403a51280f86b56554d9d0699a2/librt-0.11.0.tar.gz", hash = "sha256:075dc3ef4458a278e0195cbf6ac9d38808d9b906c5a6c7f7f79c3888276a3fb1", size = 200139, upload-time = "2026-05-10T18:17:25.138Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/82/61/e59168d4d0bf2bf90f4f0caf7a001bfc60254c3af4586013b04dc3ef517b/librt-0.11.0-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:78dc31f7fdfe9c9d0eb0e8f42d139db230e826415bbcabd9f0e9faaaee909894", size = 144119, upload-time = "2026-05-10T18:16:11.771Z" }, + { url = "https://files.pythonhosted.org/packages/61/fd/caa1d60b12f7dd79ccea23054e06eeaebe266a5f52c40a6b651069200ce5/librt-0.11.0-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:fa475675db22290c3158e1d42326d0f5a65f04f44a0e68c3630a25b53560fb9c", size = 143565, upload-time = "2026-05-10T18:16:13.334Z" }, + { url = "https://files.pythonhosted.org/packages/b8/a9/dc744f5c2b4978d48db970be29f22716d3413d28b14ad99740817315cf2c/librt-0.11.0-cp313-cp313-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:621db29691044bdeda22e789e482e1b0f3a985d90e3426c9c6d17606416205ea", size = 485395, upload-time = "2026-05-10T18:16:14.729Z" }, + { url = "https://files.pythonhosted.org/packages/8f/21/7f8e97a1e4dae952a5a95948f6f8507a173bc1e669f54340bba6ca1ca31b/librt-0.11.0-cp313-cp313-manylinux2014_i686.manylinux_2_17_i686.manylinux_2_28_i686.whl", hash = "sha256:a9010e2ed5b3a9e158c5fd966b3ab7e834bb3d3aacc8f66c91dd4b57a3799230", size = 479383, upload-time = "2026-05-10T18:16:16.321Z" }, + { url = "https://files.pythonhosted.org/packages/a6/6d/d8ee9c114bebf2c50e29ec2aa940826fccb62a645c3e4c18760987d0e16d/librt-0.11.0-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:7c39513d8b7477a2e1ed8c43fc21c524e8d5a0f8d4e8b7b074dbdbe7820a08e2", size = 513010, upload-time = "2026-05-10T18:16:17.647Z" }, + { url = "https://files.pythonhosted.org/packages/f0/43/0b5708af2bd30a46400e72ba6bdaa8f066f15fb9a688527e34220e8d6c06/librt-0.11.0-cp313-cp313-manylinux_2_34_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:7aef3cf1d5af86e770ab04bfd993dfc4ae8b8c17f66fb77dd4a7d50de7bbb1a3", size = 508433, upload-time = "2026-05-10T18:16:19.309Z" }, + { url = "https://files.pythonhosted.org/packages/4a/50/356187247d09013490481033183b3532b58acf8028bcb34b2b56a375c9b2/librt-0.11.0-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:557183ddc36babe46b27dd60facbd5adb4492181a5be887587d57cda6e092f21", size = 522595, upload-time = "2026-05-10T18:16:20.642Z" }, + { url = "https://files.pythonhosted.org/packages/40/e7/c6ac4240899c7f3248079d5a9900debe0dadb3fdeaf856684c987105ba47/librt-0.11.0-cp313-cp313-musllinux_1_2_i686.whl", hash = "sha256:83d3e1f72bd42f6c5c0b7daec530c3f829bd02db42c70b8ddf0c2d90a2459930", size = 527255, upload-time = "2026-05-10T18:16:22.352Z" }, + { url = "https://files.pythonhosted.org/packages/eb/b5/a81322dbeedeeaf9c1ee6f001734d28a09d8383ac9e6779bc24bbd0743c6/librt-0.11.0-cp313-cp313-musllinux_1_2_riscv64.whl", hash = "sha256:4ce1f21fbe589bc1afd7872dece84fb0e1144f794a288e58a10d2c54a55c43be", size = 516847, upload-time = "2026-05-10T18:16:23.627Z" }, + { url = "https://files.pythonhosted.org/packages/ae/66/6e6323787d592b55204a42595ff1102da5115601b53a7e9ddebc889a6da5/librt-0.11.0-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:970b09f7044ea2b64c9da42fd3d335666518cfd1c6e8a182c95da73d0214b41e", size = 553920, upload-time = "2026-05-10T18:16:25.025Z" }, + { url = "https://files.pythonhosted.org/packages/9c/21/623f8ca230857102066d9ca8c6c1734995908c4d0d1bee7bb2ef0021cb33/librt-0.11.0-cp313-cp313-win32.whl", hash = "sha256:78fddc31cd4d3caa897ad5d31f856b1faadc9474021ad6cb182b9018793e254e", size = 101898, upload-time = "2026-05-10T18:16:26.649Z" }, + { url = "https://files.pythonhosted.org/packages/b3/1d/b4ebd44dd723f768469007515cb92251e0ae286c94c140f374801140fa74/librt-0.11.0-cp313-cp313-win_amd64.whl", hash = "sha256:8ca8aa88751a775870b764e93bad5135385f563cb8dcee399abf034ea4d3cb47", size = 119812, upload-time = "2026-05-10T18:16:27.859Z" }, + { url = "https://files.pythonhosted.org/packages/3b/e4/b2f4ca7965ca373b491cdb4bc25cdb30c1649ca81a8782056a83850292a9/librt-0.11.0-cp313-cp313-win_arm64.whl", hash = "sha256:96f044bb325fd9cf1a723015638c219e9143f0dfbc0ca54c565df2b7fc748b44", size = 103448, upload-time = "2026-05-10T18:16:29.066Z" }, + { url = "https://files.pythonhosted.org/packages/29/eb/dbce197da4e227779e56b5735f2decc3eb36e55a1cdbf1bd65d6639d76c1/librt-0.11.0-cp314-cp314-macosx_10_13_x86_64.whl", hash = "sha256:4a017a95e5837dc15a8c5661d60e05daa96b90908b1aa6b7acdf443cd25c8ebd", size = 143345, upload-time = "2026-05-10T18:16:30.674Z" }, + { url = "https://files.pythonhosted.org/packages/76/a3/254bebd0c11c8ba684018efb8006ff22e466abce445215cca6c778e7d9de/librt-0.11.0-cp314-cp314-macosx_11_0_arm64.whl", hash = "sha256:b1ecbd9819deccc39b7542bf4d2a740d8a620694d39989e58661d3763458f8d4", size = 143131, upload-time = "2026-05-10T18:16:32.037Z" }, + { url = "https://files.pythonhosted.org/packages/f1/3f/f77d6122d21ac7bf6ae8a7dfced1bd2a7ac545d3273ebdcaf8042f6d619f/librt-0.11.0-cp314-cp314-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:7da327dacd7be8f8ec36547373550744a3cc0e536d54665cd83f8bcd961200e8", size = 477024, upload-time = "2026-05-10T18:16:33.493Z" }, + { url = "https://files.pythonhosted.org/packages/ac/0a/2c996dadebaa7d9bbbd43ef2d4f3e66b6da545f838a41694ef6172cebec8/librt-0.11.0-cp314-cp314-manylinux2014_i686.manylinux_2_17_i686.manylinux_2_28_i686.whl", hash = "sha256:0dc56b1f8d06e60db362cc3fdae206681817f86ce4725d34511473487f12a34b", size = 474221, upload-time = "2026-05-10T18:16:34.864Z" }, + { url = "https://files.pythonhosted.org/packages/0a/7e/f5d92af8486b8272c23b3e686b46ff72d89c8169585eb61eef01a2ac7147/librt-0.11.0-cp314-cp314-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:05fb8fb2ab90e21c8d12ea240d744ad514da9baf381ebfa70d91d20d21713175", size = 505174, upload-time = "2026-05-10T18:16:36.705Z" }, + { url = "https://files.pythonhosted.org/packages/af/1a/cb0734fe86398eb33193ab753b7326255c74cac5eb09e76b9b16536e7adb/librt-0.11.0-cp314-cp314-manylinux_2_34_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:cae74872be221df4374d10fec61f93ed1513b9546ea84f2c0bf73ab3e9bd0b03", size = 497216, upload-time = "2026-05-10T18:16:38.418Z" }, + { url = "https://files.pythonhosted.org/packages/18/06/094820f91558b66e29943c0ec41c9914f460f48dd51fc503c3101e10842d/librt-0.11.0-cp314-cp314-musllinux_1_2_aarch64.whl", hash = "sha256:32bcc918c0148eb7e3d57385125bac7e5f9e4359d05f07448b09f6f778c2f31c", size = 513921, upload-time = "2026-05-10T18:16:39.848Z" }, + { url = "https://files.pythonhosted.org/packages/0b/c2/00de9018871a282f530cacb457d5ec0428f6ac7e6fedde9aff7468d9fb04/librt-0.11.0-cp314-cp314-musllinux_1_2_i686.whl", hash = "sha256:f9743fc99135d5f78d2454435615f6dec0473ca507c26ce9d92b10b562a280d3", size = 520850, upload-time = "2026-05-10T18:16:41.471Z" }, + { url = "https://files.pythonhosted.org/packages/51/9d/64631832348fd1834fb3a61b996434edddaaf25a31d03b0a76273159d2cf/librt-0.11.0-cp314-cp314-musllinux_1_2_riscv64.whl", hash = "sha256:5ba067f4aadae8fda802d91d2124c90c42195ff32d9161d3549e6d05cfe26f96", size = 504237, upload-time = "2026-05-10T18:16:43.15Z" }, + { url = "https://files.pythonhosted.org/packages/a5/ec/ae5525eb16edc827a044e7bb8777a455ff95d4bca9379e7e6bddd7383647/librt-0.11.0-cp314-cp314-musllinux_1_2_x86_64.whl", hash = "sha256:de3bf945454d032f9e390b85c4072e0a0570bf825421c8be0e71209fa65e1abe", size = 546261, upload-time = "2026-05-10T18:16:44.408Z" }, + { url = "https://files.pythonhosted.org/packages/5a/09/adce371f27ca039411da9659f7430fcc2ba6cd0c7b3e4467a0f091be7fa9/librt-0.11.0-cp314-cp314-win32.whl", hash = "sha256:d2277a05f6dcb9fd13db9566aac4fabd68c3ea1ea46ee5567d4eef8efa495a2f", size = 96965, upload-time = "2026-05-10T18:16:46.039Z" }, + { url = "https://files.pythonhosted.org/packages/d6/ee/8ac720d98548f173c7ce2e632a7ca94673f74cacd5c8162a84af5b35958a/librt-0.11.0-cp314-cp314-win_amd64.whl", hash = "sha256:ab73e8db5e3f564d812c1f5c3a175930a5f9bc96ccb5e3b22a34d7858b401cf7", size = 115151, upload-time = "2026-05-10T18:16:47.133Z" }, + { url = "https://files.pythonhosted.org/packages/94/20/c900cf14efeb09b6bef2b2dff20779f73464b97fd58d1c6bccc379588ae3/librt-0.11.0-cp314-cp314-win_arm64.whl", hash = "sha256:aea3caa317752e3a466fa8af45d91ee0ea8c7fdd96e42b0a8dd9b76a7931eba1", size = 98850, upload-time = "2026-05-10T18:16:48.597Z" }, + { url = "https://files.pythonhosted.org/packages/0c/71/944bfe4b64e12abffcd3c15e1cce07f72f3d55655083786285f4dedeb532/librt-0.11.0-cp314-cp314t-macosx_10_13_x86_64.whl", hash = "sha256:d1b36540d7aaf9b9101b3a6f376c8d8e9f7a9aec93ed05918f2c69d493ffef72", size = 151138, upload-time = "2026-05-10T18:16:49.839Z" }, + { url = "https://files.pythonhosted.org/packages/b6/10/99e64a5c86989357fda078c8143c533389585f6473b7439172dd8f3b3b2d/librt-0.11.0-cp314-cp314t-macosx_11_0_arm64.whl", hash = "sha256:efbb343ab2ce3540f4ecbe6315d677ed70f37cd9a72b1e58066c918ca83acbaa", size = 151976, upload-time = "2026-05-10T18:16:51.062Z" }, + { url = "https://files.pythonhosted.org/packages/21/31/5072ad880946d83e5ea4147d6d018c78eefce85b77819b19bdd0ee229435/librt-0.11.0-cp314-cp314t-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:aa0dd688aab3f7914d3e6e5e3554978e0383312fb8e771d84be008a35b9ee548", size = 557927, upload-time = "2026-05-10T18:16:52.632Z" }, + { url = "https://files.pythonhosted.org/packages/5e/8d/70b5fb7cfbab60edbe7381614ab985da58e144fbf465c86d44c95f43cdca/librt-0.11.0-cp314-cp314t-manylinux2014_i686.manylinux_2_17_i686.manylinux_2_28_i686.whl", hash = "sha256:f5fb36b8c6c63fdcbb1d526d94c0d1331610d43f4118cc1beb4efef4f3faacb2", size = 539698, upload-time = "2026-05-10T18:16:53.934Z" }, + { url = "https://files.pythonhosted.org/packages/fa/a3/ba3495a0b3edbd24a4cae0d1d3c64f39a9fc45d06e812101289b50c1a619/librt-0.11.0-cp314-cp314t-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:4a9a237d13addb93715b6fee74023d5ee3469b53fce527626c0e088aa585805f", size = 577162, upload-time = "2026-05-10T18:16:55.589Z" }, + { url = "https://files.pythonhosted.org/packages/f7/db/36e25fb81f99937ff1b96612a1dc9fd66f039cb9cc3aee12c01fac31aab9/librt-0.11.0-cp314-cp314t-manylinux_2_34_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:5ddd17bd87b2c56ddd60e546a7984a2e64c4e8eab92fb4cf3830a48ad5469d51", size = 566494, upload-time = "2026-05-10T18:16:56.975Z" }, + { url = "https://files.pythonhosted.org/packages/33/0d/3f622b47f0b013eeb9cf4cc07ae9bfe378d832a4eec998b2b209fe84244d/librt-0.11.0-cp314-cp314t-musllinux_1_2_aarch64.whl", hash = "sha256:bd43992b4473d42f12ff9e68326079f0696d9d4e6000e8f39a0238d482ba6ee2", size = 596858, upload-time = "2026-05-10T18:16:58.374Z" }, + { url = "https://files.pythonhosted.org/packages/a9/02/71b90bc93039c46a2000651f6ad60122b114c8f54c4ad306e0e96f5b75ad/librt-0.11.0-cp314-cp314t-musllinux_1_2_i686.whl", hash = "sha256:f8e3e8056dd674e279741485e2e512d6e9a751c7455809d0114e6ebf8d781085", size = 590318, upload-time = "2026-05-10T18:16:59.676Z" }, + { url = "https://files.pythonhosted.org/packages/04/04/418cb3f75621e2b761fb1ab0f017f4d70a1a72a6e7c74ee4f7e8d198c2f3/librt-0.11.0-cp314-cp314t-musllinux_1_2_riscv64.whl", hash = "sha256:c1f708d8ae9c56cf38a903c44297243d2ec83fd82b396b977e0144a3e76217e3", size = 575115, upload-time = "2026-05-10T18:17:01.007Z" }, + { url = "https://files.pythonhosted.org/packages/cc/2c/5a2183ac58dd911f26b5d7e7d7d8f1d87fcecdddd99d6c12169a258ff62c/librt-0.11.0-cp314-cp314t-musllinux_1_2_x86_64.whl", hash = "sha256:0add982e0e7b9fc14cf4b33789d5f13f66581889b88c2f58099f6ce8f92617bd", size = 617918, upload-time = "2026-05-10T18:17:02.682Z" }, + { url = "https://files.pythonhosted.org/packages/15/1f/dc6771a52592a4451be6effa200cbfc9cec61e4393d3033d81a9d307961d/librt-0.11.0-cp314-cp314t-win32.whl", hash = "sha256:2b481d846ac894c4e8403c5fd0e87c5d11d6499e404b474602508a224ff531c8", size = 103562, upload-time = "2026-05-10T18:17:03.99Z" }, + { url = "https://files.pythonhosted.org/packages/62/4a/7d1415567027286a75ba1093ec4aca11f073e0f559c530cf3e0a757ad55c/librt-0.11.0-cp314-cp314t-win_amd64.whl", hash = "sha256:28edb433edde181112a908c78907af28f964eabc15f4dd16c9d66c834302677c", size = 124327, upload-time = "2026-05-10T18:17:05.465Z" }, + { url = "https://files.pythonhosted.org/packages/ce/62/b40b382fa0c66fee1478073eb8db352a4a6beda4a1adccf1df911d8c289c/librt-0.11.0-cp314-cp314t-win_arm64.whl", hash = "sha256:dee008f20b542e3cd162ba338a7f9ec0f6d23d395f66fe8aeeec3c9d067ea253", size = 102572, upload-time = "2026-05-10T18:17:06.809Z" }, +] + [[package]] name = "markupsafe" version = "3.0.3" @@ -489,6 +580,52 @@ wheels = [ { url = "https://files.pythonhosted.org/packages/70/bc/6f1c2f612465f5fa89b95bead1f44dcb607670fd42891d8fdcd5d039f4f4/markupsafe-3.0.3-cp314-cp314t-win_arm64.whl", hash = "sha256:32001d6a8fc98c8cb5c947787c5d08b0a50663d139f1305bac5885d98d9b40fa", size = 14146, upload-time = "2025-09-27T18:37:28.327Z" }, ] +[[package]] +name = "mypy" +version = "2.1.0" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "ast-serialize" }, + { name = "librt", marker = "platform_python_implementation != 'PyPy'" }, + { name = "mypy-extensions" }, + { name = "pathspec" }, + { name = "typing-extensions" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/82/15/cca9d88503549ed6fedeaa1d448cdddd542ee8a490232d732e278036fbf2/mypy-2.1.0.tar.gz", hash = "sha256:81e76ad12c2d804512e9b13240d1588316531bfba07558286078bfbce9613633", size = 3898359, upload-time = "2026-05-11T18:37:36.237Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/6e/dd/c7191469c777f07689c032a8f7326e393ea34c92d6d76eb7ce5ba57ea66d/mypy-2.1.0-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:35aac3bb114e03888f535d5eb51b8bafbb3266586b599da1940f9b1be3ec5bd5", size = 14852174, upload-time = "2026-05-11T18:31:38.929Z" }, + { url = "https://files.pythonhosted.org/packages/55/8c/aed55408879043d72bb9135f4d0d19a02b886dd569631e113e3d2706cb8d/mypy-2.1.0-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:8de55a8c861f2a49331f807be98d90caeceeef520bde13d43a160207f8af613e", size = 13651542, upload-time = "2026-05-11T18:36:04.636Z" }, + { url = "https://files.pythonhosted.org/packages/3a/8e/f371a824b1f1fa8ea6e3dbb8703d232977d572be2329554a3bc4d960302f/mypy-2.1.0-cp313-cp313-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:5fdf2941a07434af755837d9880f7d7d25f1dacb1af9dcd4b9b66f2220a3024e", size = 14033929, upload-time = "2026-05-11T18:35:55.742Z" }, + { url = "https://files.pythonhosted.org/packages/94/21/f54be870d6dd53a82c674407e0f8eed7174b05ec78d42e5abd7b42e84fd5/mypy-2.1.0-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:e195b817c13f02352a9c124301f9f30f078405444679b6753c1b96b6eed37285", size = 15039200, upload-time = "2026-05-11T18:33:10.281Z" }, + { url = "https://files.pythonhosted.org/packages/17/99/bf21748626a40ce59fd29a39386ab46afec88b7bd2f0fa6c3a97c995523f/mypy-2.1.0-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:5431d42af987ebd92ba2f71d45c85ed41d8e6ca9f5fd209a69f68f707d2469e5", size = 15272690, upload-time = "2026-05-11T18:32:07.205Z" }, + { url = "https://files.pythonhosted.org/packages/d6/d7/9e90d2cf47100bea550ed2bc7b0d4de3a62181d84d5e37da0003e8462637/mypy-2.1.0-cp313-cp313-win_amd64.whl", hash = "sha256:767fe8c66dc3e01e19e1737d4c38ebefead16125e1b8e58ad421903b376f5c65", size = 11147435, upload-time = "2026-05-11T18:33:56.477Z" }, + { url = "https://files.pythonhosted.org/packages/ec/46/e5c449e858798e35ffc90946282a27c62a77be743fe17480e4977374eb91/mypy-2.1.0-cp313-cp313-win_arm64.whl", hash = "sha256:ecfe70d43775ab99562ab128ce49854a362044c9f894961f68f898c23cb7429d", size = 10035052, upload-time = "2026-05-11T18:32:30.049Z" }, + { url = "https://files.pythonhosted.org/packages/b0/ca/b279a672e874aedd5498ae25f722dacc8aa86bbffb939b3f97cbb1cf6686/mypy-2.1.0-cp314-cp314-macosx_10_15_x86_64.whl", hash = "sha256:7354c5a7f69d9345c3d6e69921d57088eea3ddeeb6b20d34c1b3855b02c36ec2", size = 14848422, upload-time = "2026-05-11T18:35:45.984Z" }, + { url = "https://files.pythonhosted.org/packages/27/e6/3efe56c631d959b9b4454e208b0ac4b7f4f58b404c89f8bec7b49efdfc21/mypy-2.1.0-cp314-cp314-macosx_11_0_arm64.whl", hash = "sha256:49890d4f76ac9e06ec117f9e09f3174da70a620a0c300953d8595c926e80947f", size = 13677374, upload-time = "2026-05-11T18:36:57.188Z" }, + { url = "https://files.pythonhosted.org/packages/84/7f/8107ea87a44fd1f1b59882442f033c9c3488c127201b1d1d15f1cbd6022e/mypy-2.1.0-cp314-cp314-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:761be68e023ef5d94678772396a8af1220030f80837a3afd8d0aef3b419666f4", size = 14055743, upload-time = "2026-05-11T18:35:18.361Z" }, + { url = "https://files.pythonhosted.org/packages/51/4d/b6d34db183133b83761b9199a82d31557cdbb70a380d8c3b3438e11882a3/mypy-2.1.0-cp314-cp314-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:c90345fc182dc363b891350457ec69c35140858538f38b4540845afcc32b1aef", size = 15020937, upload-time = "2026-05-11T18:34:59.618Z" }, + { url = "https://files.pythonhosted.org/packages/ff/d7/f08360c691d758acb02f45022c34d98b92892f4ea756644e1000d4b9f3d8/mypy-2.1.0-cp314-cp314-musllinux_1_2_x86_64.whl", hash = "sha256:b84802e7b5a6daf1f5e15bc9fcd7ddae77be13981ffab037f1c67bb84d67d135", size = 15253371, upload-time = "2026-05-11T18:36:41.081Z" }, + { url = "https://files.pythonhosted.org/packages/67/1b/09460a13719530a19bce27bd3bc8449e83569dd2ba7faf51c9c3c30c0b61/mypy-2.1.0-cp314-cp314-win_amd64.whl", hash = "sha256:022c771234936ceac541ebaf836fe9e2abeb3f5e09aff21588fe543ff006fe21", size = 11326429, upload-time = "2026-05-11T18:34:13.526Z" }, + { url = "https://files.pythonhosted.org/packages/40/62/75dbf0f82f7b6680340efc614af29dd0b3c17b8a4f1cd09b8bd2fd6bc814/mypy-2.1.0-cp314-cp314-win_arm64.whl", hash = "sha256:498207db725cec88829a6a5c2fc771205fd043719ef98bc49aba8fb9fc4e6d57", size = 10218799, upload-time = "2026-05-11T18:32:23.491Z" }, + { url = "https://files.pythonhosted.org/packages/b2/66/caca04ed7d972fb6eb6dd1ccd6df1de5c38fae8c5b3dc1c4e8e0d85ee6b9/mypy-2.1.0-cp314-cp314t-macosx_10_15_x86_64.whl", hash = "sha256:7d5e5cad0efeba72b93cd17490cc0d69c5ac9ca132994fe3fb0314808aeeb83e", size = 15923458, upload-time = "2026-05-11T18:35:28.64Z" }, + { url = "https://files.pythonhosted.org/packages/ed/52/2d90cbe49d014b13ed7ff337930c30bad35893fe38a1e4641e756bb62191/mypy-2.1.0-cp314-cp314t-macosx_11_0_arm64.whl", hash = "sha256:ff715050c127d724fd260a2e666e7747fdd83511c0c47d449d98238970aef780", size = 14757697, upload-time = "2026-05-11T18:36:14.208Z" }, + { url = "https://files.pythonhosted.org/packages/ac/37/d98f4a14e081b238992d0ed96b6d39c7cc0148c9699eb71eaa68629665ea/mypy-2.1.0-cp314-cp314t-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:82208da9e09414d520e912d3e462d454854bed0810b71540bb016dcbca7308fd", size = 15405638, upload-time = "2026-05-11T18:33:48.249Z" }, + { url = "https://files.pythonhosted.org/packages/a3/c2/15c46613b24a84fad2aea1248bf9619b99c2767ae9071fe224c179a0b7d4/mypy-2.1.0-cp314-cp314t-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:e79ebc1b904b84f0310dff7469655a9c36c7a68bddb37bdd42b67a332df61d08", size = 16215852, upload-time = "2026-05-11T18:32:50.296Z" }, + { url = "https://files.pythonhosted.org/packages/5c/90/9c16a57f482c76d25f6379762b56bbf65c711d8158cf271fb2802cfb0640/mypy-2.1.0-cp314-cp314t-musllinux_1_2_x86_64.whl", hash = "sha256:e583edc957cfb0deb142079162ae826f58449b116c1d442f2d91c69d9fced081", size = 16452695, upload-time = "2026-05-11T18:33:38.182Z" }, + { url = "https://files.pythonhosted.org/packages/0f/4c/215a4eeb63cacc5f17f516691ea7285d11e249802b942476bff15922a314/mypy-2.1.0-cp314-cp314t-win_amd64.whl", hash = "sha256:b33b6cd332695bba180d55e717a79d3038e479a2c49cc5eb3d53603409b9a5d7", size = 12866622, upload-time = "2026-05-11T18:34:39.945Z" }, + { url = "https://files.pythonhosted.org/packages/4b/50/1043e1db5f455ffe4c9ab22747cd8ca2bc492b1e4f4e21b130a44ee2b217/mypy-2.1.0-cp314-cp314t-win_arm64.whl", hash = "sha256:4f910fe825376a7b66ef7ca8c98e5a149e8cd64c19ae71d84047a74ee060d4e6", size = 10610798, upload-time = "2026-05-11T18:36:31.444Z" }, + { url = "https://files.pythonhosted.org/packages/0d/2a/13ca1f292f6db1b98ff495ef3467736b331621c5917cad984b7043e7348d/mypy-2.1.0-py3-none-any.whl", hash = "sha256:a663814603a5c563fb87a4f96fb473eeb30d1f5a4885afcf44f9db000a366289", size = 2693302, upload-time = "2026-05-11T18:31:29.246Z" }, +] + +[[package]] +name = "mypy-extensions" +version = "1.1.0" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/a2/6e/371856a3fb9d31ca8dac321cda606860fa4548858c0cc45d9d1d4ca2628b/mypy_extensions-1.1.0.tar.gz", hash = "sha256:52e68efc3284861e772bbcd66823fde5ae21fd2fdb51c62a211403730b916558", size = 6343, upload-time = "2025-04-22T14:54:24.164Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/79/7b/2c79738432f5c924bef5071f933bcc9efd0473bac3b4aa584a6f7c1c8df8/mypy_extensions-1.1.0-py3-none-any.whl", hash = "sha256:1be4cccdb0f2482337c4743e60421de3a356cd97508abadd57d47403e94f5505", size = 4963, upload-time = "2025-04-22T14:54:22.983Z" }, +] + [[package]] name = "myst-web" version = "0.1.0" @@ -510,6 +647,7 @@ dependencies = [ [package.dev-dependencies] dev = [ { name = "djlint" }, + { name = "mypy" }, { name = "ruff" }, { name = "uvicorn", extra = ["standard"] }, ] @@ -532,6 +670,7 @@ requires-dist = [ [package.metadata.requires-dev] dev = [ { name = "djlint", specifier = ">=1.36.1" }, + { name = "mypy", specifier = ">=1.19.0" }, { name = "ruff", specifier = ">=0.11.0" }, { name = "uvicorn", extras = ["standard"], specifier = ">=0.44.0" }, ]