Commit Graph
6 Commits
Author SHA1 Message Date
woggioni e4e00762bb Add websocket session support to kaya-session
- kaya-core: WebSocket ABC gains session attribute and accept(headers=...)
- kaya-core: AsgiWebSocket injects headers into websocket.accept message
- kaya-rsgi: RsgiWebSocket accepts headers param (ignored — Granian's
  accept() takes no args)
- kaya-session: SessionWebSocket wrapper exposes ws.session and injects
  Set-Cookie on accept()
- kaya-session: SessionMixin registers before/after websocket hooks;
  session loaded at connect, persisted on close if modified
- 10 new WV session tests covering read, persist, handshake cookie,
  regenerate, invalidate, isolation
- Example and README updated
2026-07-23 22:11:04 +08:00
woggioni 65f1b79ce8 Fix SessionHttpContext to delegate attributes via __getattr__
The previous implementation eagerly copied ASGI-specific attributes
(pathsend, receive, send) from the wrapped context, which crashed under
RSGI because RsgiContext does not have those attributes. Now
SessionHttpContext delegates all non-overridden attributes to the wrapped
context via __getattr__, making it protocol-agnostic.
2026-07-23 22:09:59 +08:00
woggioni 3ebf079533 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.
2026-07-23 22:09:59 +08:00
woggioni 24a797e3d2 Add kaya-oidc package for OpenID Connect authentication 2026-07-23 22:09:59 +08:00
woggioni 77d1134569 Enforce server-side session idle expiry with sliding TTL 2026-07-23 22:09:59 +08:00
woggioni 97a81a9e41 Add kaya-session package for server-side HTTP session management 2026-07-23 22:09:55 +08:00