From 57bc300fe26812aad568c8119f04d92e94c9ab14 Mon Sep 17 00:00:00 2001 From: bndw Date: Sun, 15 Feb 2026 10:26:10 -0800 Subject: fix: record AUTH attempt metrics in WebSocket handler Add RecordAuthAttempt calls to handleAuth so successful and failed AUTH attempts are tracked in metrics. This fixes the dashboard 'Challenges' counter which was always showing 0. The deferred call ensures both success and failure cases are recorded: - success=true when AUTH completes successfully - success=false when AUTH fails (invalid signature, wrong challenge, etc.) Updated MetricsRecorder interface and mock to include RecordAuthAttempt. --- internal/handler/websocket/handler_test.go | 1 + 1 file changed, 1 insertion(+) (limited to 'internal/handler/websocket/handler_test.go') diff --git a/internal/handler/websocket/handler_test.go b/internal/handler/websocket/handler_test.go index 9982aea..10405b2 100644 --- a/internal/handler/websocket/handler_test.go +++ b/internal/handler/websocket/handler_test.go @@ -97,6 +97,7 @@ func (m *mockMetrics) RecordRequest(method, status string, duration float64) { key := fmt.Sprintf("%s:%s", method, status) m.requests[key]++ } +func (m *mockMetrics) RecordAuthAttempt(success bool) {} func (m *mockMetrics) RecordBlockedEvent(kind int32) { m.mu.Lock() defer m.mu.Unlock() -- cgit v1.2.3