Refactor to composable KayaMixin architecture

Replace wrapper-based SessionMiddleware/OIDCApp with KayaMixin subclasses
applied via KayaApp(mixins=[...]). Mixins hook into handle_request and
handle_websocket via before/after hooks, so both ASGI and RSGI keep working.
Mixin dependencies are applied automatically and deduplicated.
This commit is contained in:
2026-07-23 22:09:59 +08:00
parent 24a797e3d2
commit 3ebf079533
14 changed files with 480 additions and 359 deletions
+2 -2
View File
@@ -1,7 +1,7 @@
from kaya.core import HttpContext, KayaApp
from kaya.session import InMemorySessionStore, SessionMiddleware
from kaya.session import InMemorySessionStore, SessionMixin
app = SessionMiddleware(KayaApp(), InMemorySessionStore())
app = KayaApp(mixins=[SessionMixin(InMemorySessionStore())])
@app.GET('/')