- Add canonical_principal(provider, sub) => 'oidc:v1:<provider>:<sub>' - Preserve provider identity across HTTP sessions and WebSockets - Apply principals throughout: game creation/joining/seating, WebSocket views/actions, Redis engine state, match history, leaderboard focus, ratings, /api/me, OpenAPI, and telemetry - Widen identity columns to 1024 chars with schema-only aerich migration (5_20261024221522_canonical_principals.py) - Document provider names as stable security identifiers - Add regression tests: same subject at different providers cannot share games, private hands, join codes, moves, history, or ratings; distinct seat and rating ownership verified - All platform, integration, game, and frontend tests pass; mypy clean
tavolo-app
The deployable tavolo application: the composition root wiring
tavolo-platform to the
tavolo-scopone,
tavolo-scopa and
tavolo-briscola games.
Contents
app.py— assembles theKayaApp(session/OIDC/Tortoise/OpenAPI mixins plusPlatformMixinand the deadline scheduler), registers theScoponeEngine,ScopaEngine,ScopaQuattroEngine,BriscolaEngine,BriscolaQuattroEngineandBriscolaChiamataEnginewith their configured timeouts, and exposestavolo.app:appfor granian.config.py— environment-driven frozenSettings.telemetry.py— the optional OpenTelemetry wiring beyond kaya-otel: meter/tracer/logger providers, thetavolo.active_users/tavolo.ongoing_gamesgauges (polled from the stores), process/CPython metrics viaopentelemetry-instrumentation-system-metrics, Postgres/Redis query spans via the asyncpg/redis instrumentations, and OTLP log export.aerich_config.py— Tortoise ORM configuration consumed by the aerich CLI (migrations live inserver/migrations/; aerich itself is configured via the[tool.aerich]section ofserver/pyproject.toml).logging_config.py— logging setup.static.py— SPA shell hosting for the compiled frontend.
Development (from packages/tavolo-app/)
uv run mypy --namespace-packages --explicit-package-bases \
src/tavolo/app.py \
src/tavolo/config.py \
src/tavolo/telemetry.py \
src/tavolo/static.py \
src/tavolo/aerich_config.py \
src/tavolo/logging_config.py
End-to-end coverage of the wired stack lives in server/tests/.