kaya-oidc 0.0.6 can run several providers in one app (OIDCProviders), each with its own login route and namespaced session state. Adopt it: providers are configured in indexed, contiguous OIDC_<n>_* blocks (0-based) with OIDC_<n>_PROVIDER naming the provider in its login URL and session keys. The old unindexed OIDC_ISSUER/OIDC_CLIENT_ID/... names are no longer read; startup fails with a rename hint when they are set. With no OIDC variables at all, the single dev mock provider named "default" is used, as before. The platform now authenticates through OIDCProviders: auth.current_user returns the session's user (sessions stay single-identity, so at most one provider is logged in) and require_auth/route handlers use it, while the websocket path keeps scanning for any provider's user. New routes expose the configuration to the SPA and keep old links working: GET /api/auth/providers lists the login URLs, GET /auth/login redirects to the first provider and GET /auth/logout to whichever provider the session is logged in with. The lobby renders one login button per provider from that endpoint. Update the env examples, compose and k8s manifests to the indexed scheme, document the multiple-provider setup and the migration, and cover it with config, auth and route tests.
39 lines
1022 B
TOML
39 lines
1022 B
TOML
[build-system]
|
|
requires = ["setuptools>=68"]
|
|
build-backend = "setuptools.build_meta"
|
|
|
|
[project]
|
|
name = "tavolo-platform"
|
|
version = "0.1.0"
|
|
description = "Game-independent multiplayer game platform (lobby, live play, match history, leaderboards) built on the kaya framework"
|
|
readme = "README.md"
|
|
requires-python = ">=3.10"
|
|
dependencies = [
|
|
"kaya-core>=0.0.6",
|
|
"kaya-session",
|
|
"kaya-oidc>=0.0.6",
|
|
"kaya-openapi",
|
|
"tortoise-orm",
|
|
"redis",
|
|
]
|
|
|
|
[tool.setuptools.packages.find]
|
|
where = ["src"]
|
|
namespaces = true
|
|
|
|
[tool.mypy]
|
|
python_version = "3.12"
|
|
ignore_missing_imports = true
|
|
plugins = []
|
|
|
|
# TortoiseORM auto-generates `<fk>_id` attributes on ForeignKeyField at
|
|
# runtime; without the (unavailable here) tortoise mypy plugin the stubs
|
|
# only declare the relation field. These are real attributes, not bugs.
|
|
[[tool.mypy.overrides]]
|
|
module = "tavolo.platform.models"
|
|
disable_error_code = ["attr-defined"]
|
|
|
|
[[tool.mypy.overrides]]
|
|
module = "tavolo.platform.routes.*"
|
|
disable_error_code = ["attr-defined"]
|