Webhook-to-SSE gateway with hierarchical topic routing and signature verification

Add /_health endpoint for k8s liveness/readiness probes

Returns 204 No Content, keeping it simple so the kubelet doesn't
need to parse anything.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

+24
+5
server.go
··· 27 27 func (s *Server) ServeHTTP(w http.ResponseWriter, r *http.Request) { 28 28 setCORSHeaders(w) 29 29 30 + if r.Method == "GET" && r.URL.Path == "/_health" { 31 + w.WriteHeader(http.StatusNoContent) 32 + return 33 + } 34 + 30 35 switch r.Method { 31 36 case "OPTIONS": 32 37 w.WriteHeader(http.StatusNoContent)
+19
server_test.go
··· 22 22 return httptest.NewServer(handler), broker 23 23 } 24 24 25 + func TestServer_healthEndpoint(t *testing.T) { 26 + ts, _ := newTestServer(nil) 27 + defer ts.Close() 28 + 29 + resp, err := http.Get(ts.URL + "/_health") 30 + if err != nil { 31 + t.Fatalf("GET /_health failed: %v", err) 32 + } 33 + defer resp.Body.Close() 34 + if resp.StatusCode != http.StatusNoContent { 35 + t.Errorf("expected 204, got %d", resp.StatusCode) 36 + } 37 + buf := make([]byte, 1) 38 + n, _ := resp.Body.Read(buf) 39 + if n != 0 { 40 + t.Errorf("expected empty body, got %d bytes", n) 41 + } 42 + } 43 + 25 44 func TestServer_postPublishesEvent(t *testing.T) { 26 45 ts, _ := newTestServer(nil) 27 46 defer ts.Close()