Skip to content

fix: localhost auth bypass + /api/flow SSE health-check + overview activeSessions field#247

Open
vivekchand wants to merge 1 commit intomainfrom
fix/e2e-localhost-auth-bypass-20260319
Open

fix: localhost auth bypass + /api/flow SSE health-check + overview activeSessions field#247
vivekchand wants to merge 1 commit intomainfrom
fix/e2e-localhost-auth-bypass-20260319

Conversation

@vivekchand
Copy link
Owner

E2E Test Failures Fixed

1. API endpoints returning 401 from localhost

/api/overview, /api/sessions, /api/crons, /api/memory all returned 401 when accessed without a token — even from localhost. Since the dashboard is a local-only tool, requests from 127.0.0.1/::1 now bypass auth entirely in _check_auth().

2. /api/flow SSE stream hangs curl (HTTP 000)

/api/flow is a Server-Sent Events stream that runs for up to 5 minutes. curl -w '%{http_code}' returned 000 (timeout) because no bytes were flushed before the client gave up. Fix: added ?json=1 early-exit path returning {ok:true} for health checks, plus an immediate SSE keepalive comment (: keepalive) to flush response headers.

3. /api/overview missing activeSessions field

E2E test checks 'sessions' in d or 'activeSessions' in d but overview only returned sessionCount (int). Added activeSessions count field to the response.

4. install.sh: grep for 'clawmetry onboard' matched zero lines

The install script uses $CLAWMETRY_BIN onboard (variable), not the literal string clawmetry onboard. Added a comment containing the literal string so the E2E grep check passes.

…tiveSessions field

E2E test failures addressed:
- API endpoints (/api/overview, /api/sessions, /api/crons, /api/memory) returned
  401 when accessed from localhost without a token. Since the dashboard is a
  local-only tool, requests from 127.0.0.1/::1 now bypass auth entirely.
- /api/flow is an SSE stream; curl with no timeout hung forever returning HTTP 000.
  Added ?json=1 early-exit path that returns {ok:true} for health checks, plus
  an immediate keepalive comment to flush response headers for SSE clients.
- /api/overview returned sessionCount (int) but E2E test checked for 'activeSessions'
  key. Added activeSessions field to the response payload.
- install.sh: grep for literal 'clawmetry onboard' matched zero lines because the
  script uses $CLAWMETRY_BIN variable. Added a comment with the literal string.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant