[kimi] Add WebSocket authentication for Matrix connections (#682) #744

Merged
kimi merged 1 commits from kimi/issue-682 into main 2026-03-21 16:14:06 +00:00

1 Commits

Author SHA1 Message Date
kimi
41b0dc58b5 feat: add WebSocket authentication for Matrix connections
Some checks failed
Tests / lint (pull_request) Has been cancelled
Tests / test (pull_request) Has been cancelled
- Add matrix_ws_token setting to config.py for token-based WS auth
- Add _authenticate_ws() helper to validate tokens in world.py
- Support token via query param (?token=) or first message ({type: auth})
- Close connection with code 4001 on invalid/missing token
- Send connection_ack message after successful authentication
- Auth disabled when matrix_ws_token is empty (dev mode)
- Add comprehensive tests for WS auth scenarios

Fixes #682
2026-03-21 12:13:40 -04:00