Skip to content

Fix TAP WebSocket connection failing with bad handshake when TAP_ADMIN_PASSWORD is set#37

Closed
Kzoeps wants to merge 97 commits intohypercerts-org:mainfrom
GainForest:fix/tap-auth-issue
Closed

Fix TAP WebSocket connection failing with bad handshake when TAP_ADMIN_PASSWORD is set#37
Kzoeps wants to merge 97 commits intohypercerts-org:mainfrom
GainForest:fix/tap-auth-issue

Conversation

@Kzoeps
Copy link
Copy Markdown

@Kzoeps Kzoeps commented Apr 6, 2026

The TAP sidecar's /channel WebSocket endpoint requires HTTP Basic Auth when a password is configured. The consumer was dialing with no headers, causing a 401 that gorilla/websocket surfaces as "websocket: bad handshake", preventing Hyperindex from receiving any events.
Changes:

  • Add Password string field to ConsumerConfig in internal/tap/consumer.go
  • Build an Authorization: Basic header in runOnce() when a password is set, matching the pattern already used by AdminClient for HTTP requests
  • Wire cfg.TapAdminPassword into ConsumerConfig.Password in startTap() in cmd/hypergoat/main.go
    No behaviour change when TAP_ADMIN_PASSWORD is empty.

- Add DIDFilterInput GraphQL type with only eq and in fields (no contains/startsWith/neq)
- Replace StringFilterInput with DIDFilterInput for the did field in WhereInput
- Introduce DIDFilter struct in repositories to carry eq and in conditions
- Update extractFilters to populate DIDFilter.EQ and DIDFilter.IN from GraphQL args
- Add buildDIDFilterClause helper to generate SQL WHERE conditions for DIDFilter
- Update all repository methods to accept DIDFilter instead of plain string
- Add tests for DIDFilterInput fields, extractFilters DID handling, and DID in filtering
daviddao and others added 27 commits February 18, 2026 17:52
- Replace hardcoded hypergoat-app-production URL with NEXT_PUBLIC_API_URL env var
- Point GraphiQL links directly to backend (Next.js rewrite can't proxy HTML)
- Remove broken /graphiql rewrite from next.config.ts
…_API_URL

- Add /graphiql server-side redirect route (reads HYPERINDEX_URL at runtime)
- Add ARG NEXT_PUBLIC_API_URL to Dockerfile so docs page gets correct URL at build time
- Revert dashboard/header GraphiQL links to /graphiql (handled by redirect route)
Documents the exact railway up commands, env vars, custom domains,
and common troubleshooting for deploying both services.
feat: Replace Jetstream+Backfill with Tap sidecar
- errorlint: use errors.Is(err, context.Canceled) instead of == comparison
- gocritic: use http.NoBody instead of nil for GET request bodies
- ineffassign: remove unused nextPlaceholder assignments after last DID filter
- revive: add nolint:revive to types package declarations (consistent with existing files)
Merging tap & filter features into main branch
The TAP /channel WebSocket endpoint requires Basic Auth when
TAP_ADMIN_PASSWORD is set. The consumer was sending no Authorization
header, causing a 401 which gorilla/websocket surfaces as 'bad handshake'.

Wire cfg.TapAdminPassword into ConsumerConfig.Password and build the
Authorization header in runOnce() before dialing, matching the pattern
already used by AdminClient for HTTP requests.
@vercel
Copy link
Copy Markdown

vercel bot commented Apr 6, 2026

@Kzoeps is attempting to deploy a commit to the Hypercerts Foundation Team on Vercel.

A member of the Team first needs to authorize it.

@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Apr 6, 2026

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: ad7ba44c-3814-42aa-b62a-ee8239d9d866

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@Kzoeps Kzoeps closed this Apr 6, 2026
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.

2 participants