Tests SocketHandler.HandleConnect WebSocket upgrade auth logic: 1. Canvas client (no X-Workspace-ID) → bypasses auth, no DB calls 2. Agent with no live tokens → grandfathered through, no bearer check 3. DB error on HasAnyLiveToken → 500 Internal Server Error 4. Live token present, missing Bearer header → 401 Unauthorized 5. Live token present, invalid Bearer token → 401 Unauthorized Uses sqlmock for DB expectations + miniredis for wsauth token subsystem. Hub.Run() drains the Register channel so WS upgrade attempts don't block. Issue: #699 Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com> |
||
|---|---|---|
| .. | ||
| artifacts | ||
| buildinfo | ||
| bundle | ||
| channels | ||
| crypto | ||
| db | ||
| envx | ||
| events | ||
| handlers | ||
| imagewatch | ||
| memory | ||
| messagestore | ||
| metrics | ||
| middleware | ||
| models | ||
| orgtoken | ||
| pendinguploads | ||
| plugins | ||
| provisioner | ||
| provlog | ||
| registry | ||
| router | ||
| scheduler | ||
| supervised | ||
| textutil | ||
| ws | ||
| wsauth | ||