Skip to content

Read a v3 pairing code: v2 and the home id at FTW Cloud - #89

Merged
frahlg merged 1 commit into
mainfrom
claude/enrollment-v3
Oct 15, 2026
Merged

frahlg merged 1 commit into
mainfrom
claude/enrollment-v3

Conversation

@frahlg

@frahlg frahlg commented Oct 15, 2026 •

Copy link
Copy Markdown
Member

What

enrollment.ts reads a v3 pairing code as well as v2:

https://app.ftw.energy/p#v3.<box_noise_pub>.<pairing_code>.<lan_hint>.<rendezvous_secret>.<home>

v3 is v2 with a sixth segment, the home id at FTW Cloud as base64url of its 26 characters (srcfl/ftw docs/protocol-cloud.md, "Pairing through the service"). The parser takes only a home id FTW Cloud could have cut (26 characters of lowercase base32) and refuses anything else as E_QR_HOME. buildEnrollmentUrl writes v3 when the enrollment names a home, else v2. A v4 code now says "update the app", as v3 did before.

The web app does not use the home id yet. This PR is one of three parsers that must ship before Core turns appenroll.QRNamesHome on; a v3 QR before then stops pairing on every shipped app. This PR does not flip it.

Paired PRs (one-door plan, step 2)

Tests

  • enrollment.test.ts: the shared v3 string parses and builds back to itself; v2 stays v2 with no home; a v3 code without a home, with a seventh segment, a v2 code with a sixth, a home that is not a home id, and a segment that is not base64url are each refused with their code.
  • npx vitest run src/lib/identity src/views (271 tests) and npm run check green locally.

🤖 Generated with Claude Code

The box's QR adds the home id as a sixth segment once Core flips
appenroll.QRNamesHome. Each parser that ships must read v3 before then,
so this one does, and keeps reading v2. The app does not use the home id
yet; the browser session moves to FTW Cloud in a later step.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 15, 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-10-15T15:47:39.586876Z 9a1ea91 PR opened
ℹ️ 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.

@cloudflare-workers-and-pages

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Preview URL Updated (UTC)
✅ Deployment successful!
View logs
ftw-webapp 9a1ea91 Commit Preview URL

Branch Preview URL
Oct 15 2026, 03:46 PM

@frahlg
frahlg merged commit ba20354 into main Oct 15, 2026
3 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