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> |
||
|---|---|---|
| .. | ||
| cmd | ||
| internal | ||
| migrations | ||
| pkg/provisionhook | ||
| .air.toml | ||
| .ci-force | ||
| .gitignore | ||
| .golangci.yaml | ||
| Dockerfile | ||
| Dockerfile.dev | ||
| Dockerfile.tenant | ||
| entrypoint-tenant.sh | ||
| go.mod | ||
| go.sum | ||