Lokasi ngalangkungan proxy:   [ UP ]  
[Ngawartoskeun bug]   [Panyetelan cookie]                
Skip to content

FloConnect v1: enrolment, POS socket, pairing and report relay (M0–M3) - #1

Merged
itsbkm merged 12 commits into
mainfrom
v1-bridge
Dec 4, 2026
Merged

itsbkm merged 12 commits into
mainfrom
v1-bridge

Conversation

@itsbkm

@itsbkm itsbkm commented Dec 4, 2026

Copy link
Copy Markdown
Contributor

Implements milestones M0–M3 of docs/design.md. Wire contract: docs/protocol.md.

Tested locally: typecheck clean, 81 tests, and mock POS/phone against wrangler dev.

Deviations from the design:

  • All transcript, wrap-salt and AAD fields are length-prefixed (pinned by shared/test-vectors.json).
  • Manual-route token secret is derived from attempt_secret.
  • Small additions: devices.key_id, final on 408 pair_timeout, top-level message on errors, 426 when X-Flo-Proto is missing; the POS appends k= to the QR.

Not verified: WAF rule and per-location rate limiting (need a deployed zone), real 15 s/75 s timings, 10-minute hibernation soak, crypto.subtle in the Capacitor webviews, billing questions in design §12. Security review of the key exchange is pending; do not release before it.

🤖 Generated with Claude Code

itsbkm and others added 12 commits December 4, 2026 18:22
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
… POS, tests

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
… sides

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…ummary, unpair, CORS

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…er URL rules, secrets grep

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
… pre-auth limits, random manual token

1. POS enforces its own pairing limits (open session only, one outstanding attempt,
   3 per code, 20 claims/day); normative in protocol.md 5.2 and design.md; RefPos and mock POS.
2. Per-socket in-memory limits: hello once, 60 requests/min, pair.open bucket; close 4429, 60 s ban.
3. PREAUTH_LIMITER per IP before every unauthenticated Durable Object call.
4. An approved, undelivered attempt blocks new claims until collected or past its deadline.
5. Manual-route device token is random, minted at delivery; vectors and docs updated.
6. A failed POS reply without an error object becomes bad_reply (502).
7. A replaced socket's late close no longer ends the live socket's attempt.
8. Request bodies are streamed and cut at 4 KiB.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@itsbkm
itsbkm merged commit 3f1d05c into main Dec 4, 2026
2 checks passed
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