Skip to content

feat(flamingo)!: match over the verifier WebSocket session - #562

Merged
Takaros999 merged 3 commits into
mainfrom
feat/flamingo-websocket
Sep 29, 2026
Merged

Takaros999 merged 3 commits into
mainfrom
feat/flamingo-websocket

Conversation

@Dzejkop

@Dzejkop Dzejkop commented Sep 28, 2026 •

Copy link
Copy Markdown
Contributor

This PR moves Flamingo matching to the released 0.6.0 WebSocket API.

  • Replace separate HTTP assignment/match requests with one attested WebSocket session per match, including one fresh-session retry on reassign_required.
  • Send configured headers on the upgrade, preserve URL prefixes, and reject caller-supplied handshake headers and cookies.
  • Use all four published Flamingo 0.6.0 crates; the public UniFFI API is unchanged.

Rollout

This is a breaking wire-protocol change with no HTTP fallback. The target Flamingo server and any app-backend proxy must support WebSockets before applications adopt this WalletKit version. Flamingo #125 and app-backend-rest #1442 are merged; dev was verified. Stage/prod rollout and authenticated proxy E2E are separate.

Validation

  • All 23 checks passed on bdc7e1d, including Swift/Kotlin builds and foreign-binding tests, WASM, Rust tests, Clippy and security checks.
  • Re-ran all 21 focused Flamingo tests with the registry dependencies.
  • Confirmed the four published crates' source files match the previously E2E-tested Flamingo revision.
  • Fresh public-dev E2E on bdc7e1d with registry 0.6.0: two DeepFace signed matches through the same matcher, one GrayBadge signed match, expected ThumbnailHashMismatch, and strict/wrong-PCR rejection controls.

Live tests use synthetic inputs and dev's explicit debug measurement bypass; attestation signatures/key binding and successful token signatures still verify. They do not validate real enrollment, phone capture or production PCR trust. The earlier test also covered both dev replicas.


Note

High Risk
Breaking wire-protocol change on the identity-matching path with no HTTP fallback; deployments need WebSocket-capable verifier/proxy infrastructure before adopting this WalletKit version.

Overview
Flamingo matching now uses the 0.6.0 verifier WebSocket API instead of separate HTTP assignment and match calls. Each perform_match opens one attested session (assignment on the socket, then sealed inputs and result on the same connection), with a single retry that opens a fresh session when the client returns ReassignRequired.

Integration changes in FlamingoMatcher: the verifier client is built without a custom reqwest client or affinity cookies; caller headers are applied on the WebSocket upgrade (with URL prefix preserved). with_headers now rejects Cookie and handshake headers (Host, Upgrade, Sec-WebSocket-*, etc.). The public UniFFI surface is unchanged.

Workspace deps add futures-util and tokio-tungstenite 0.29; lockfile reflects the verifier client’s move off HTTP toward WebSockets. Tests drop mockito HTTP route checks in favor of local WebSocket stubs that assert upgrade path, headers, assignment protocol, and that bad attestation fails before binary image frames are sent.

Reviewed by Cursor Bugbot for commit bdc7e1d. Bugbot is set up for automated code reviews on this repo. Configure here.

Flamingo replaces the HTTP assignment and match routes with a single
GET /v1/matches WebSocket (worldcoin/flamingo#125). Each match now opens
a session that verifies the assignment delivered on it and sends the
sealed inputs over the same socket; a reassignment opens a fresh session.

Configured headers are sent on the upgrade request. Headers the
handshake sets itself (Host, Connection, Upgrade, Sec-WebSocket-*) are
rejected alongside Cookie, which no longer carries ALB affinity.

The flamingo crates are pinned to the unreleased PR commit until a
release is published.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@wld-walletkit-bot

wld-walletkit-bot commented Sep 28, 2026 •

Copy link
Copy Markdown
Collaborator

Risk agent: Pre-filter typesafe/jev-1.13-20260917 scored this 0.57 on the skip-review question, so the detailed review was skipped.

The agent transcript is in the run log.

@Takaros999
Takaros999 marked this pull request as ready for review September 29, 2026 07:34
Copilot AI balanced review requested due to automatic review settings September 29, 2026 07:34

@Takaros999 Takaros999 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed bdc7e1d. The update only replaces the tested Git dependencies with published 0.6.0 crates; published source matches the tested revision. All 21 focused tests and a fresh public-dev WebSocket matrix passed with the registry dependencies. Roll out compatible WebSocket servers/proxy before applications adopt this client; live tests used synthetic inputs and dev debug measurements.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 29, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-09-29T07:36:30.384504Z bdc7e1d Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@Takaros999
Takaros999 merged commit ce6c905 into main Sep 29, 2026
25 of 28 checks passed
@Takaros999
Takaros999 deleted the feat/flamingo-websocket branch September 29, 2026 07:34

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🔵 Needs a closer look

It introduces a breaking identity-matching protocol change while authenticated proxy and stage/production validation remain outstanding.

Review effort: Balanced
Findings: None

What changed in this PR

Migrates Flamingo matching from HTTP requests to the v0.6.0 attested WebSocket session protocol.

Changes:

  • Opens one verified WebSocket session per match, with one reassignment retry.
  • Applies validated custom headers during WebSocket upgrades.
  • Adds WebSocket test infrastructure and updates Flamingo dependencies.

No critical code issues found. Residual risk remains because authenticated proxy and stage/production rollout validation are outstanding.

File Description
crates/​walletkit-core/​src/​flamingo/​mod.rs Implements session matching, header validation, retry logic, and tests.
crates/​walletkit-core/​Cargo.toml Adds WebSocket test dependencies.
Cargo.toml Upgrades Flamingo crates and adds workspace dependencies.
Cargo.lock Locks the updated WebSocket dependency graph.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

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.

4 participants