feat(ws): opt-in allowed origins and observer key (#170)

This commit is contained in:
MrAlders0n
2026-09-27 11:41:11 -04:00
committed by GitHub
parent 91b4b457b5
commit dec643a2ad
14 changed files with 442 additions and 73 deletions
+1
View File
@@ -14,6 +14,7 @@ import (
type Options struct {
MaxConnsPerIP int
MaxConnectsPerMinute int
WSAllowedOrigins []string
CORS config.CORSConfig
Server config.ServerConfig
Auth config.AuthConfig
+1 -1
View File
@@ -91,7 +91,7 @@ func New(h *hub.Hub, reader api.Reader, workers []*ingest.Worker, opts Options)
))
// ── WebSocket ────────────────────────────────────────────────────────────
r.Get("/ws", ws.Handler(h, reader, opts.MaxConnsPerIP, opts.MaxConnectsPerMinute))
r.Get("/ws", ws.Handler(h, reader, opts.MaxConnsPerIP, opts.MaxConnectsPerMinute, opts.WSAllowedOrigins))
// ── Public REST API (v1) ─────────────────────────────────────────────────
r.Route("/api/v1", func(r chi.Router) {