feat(relay): WebSocket relay server for managed recovery sessions #1
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "feat/managed-tunnel"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
Complete relay server implementation for the managed recovery tunnel.
Packages
internal/handlers/device.go—GET /agentWebSocket; authenticates device, creates session, forwards MCP frames to agent, broadcasts push_event to portal SSEinternal/handlers/agent.go—GET /mcp/:sessionIDWebSocket; authenticates agent, drains buffered device frames, bidirectional proxyinternal/handlers/portal.go—GET /portal/:sessionID/eventsSSE stream +POST /api/session/:id/approvalendpoint; JWT authinternal/auth/middleware.go—ServiceTokenAuth(constant-time compare) andJWTAuth(HS256) chi middlewarecmd/recova-relay/main.go— chi router wiring, env config (RELAY_SERVICE_TOKEN,RELAY_JWT_SECRET,PORT)tests/integration/relay_test.go— end-to-end test covering all 5 message flows in-processTest plan
go test ./...passes (auth, handler unit tests + integration test)go build ./...cleanView command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.