hack-house/cmd_chat/server/routes.py
mirai 5cbe355660 feat: add SRP authentication, improve security
- Replace RSA key exchange with SRP (Secure Remote Password)
- Password never transmitted over network
- Add unit tests for endpoints
- Fix datetime.UTC compatibility for Python < 3.11
- Fix logger.exception usage
- Update README with new auth flow diagram
2026-01-02 23:09:00 +03:00

26 lines
752 B
Python

from sanic import Sanic, Request, Websocket
from . import views
def register_routes(app: Sanic) -> None:
@app.post("/srp/init")
async def srp_init_route(request: Request):
return await views.srp_init(request, app)
@app.post("/srp/verify")
async def srp_verify_route(request: Request):
return await views.srp_verify(request, app)
@app.websocket("/ws/chat")
async def chat_ws_route(request: Request, ws: Websocket):
await views.chat_ws(request, ws, app)
@app.get("/health")
async def health_route(request: Request):
return await views.health(request, app)
@app.delete("/clear")
async def clear_route(request: Request):
return await views.clear_messages(request, app)