Skip to content

feat: SAS code entry replaces visual comparison - #10

Merged
YairEtzion merged 1 commit into
mainfrom
feat/sas-code-entry
Apr 3, 2026
Merged

feat: SAS code entry replaces visual comparison#10
YairEtzion merged 1 commit into
mainfrom
feat/sas-code-entry

Conversation

@YairEtzion

Copy link
Copy Markdown
Contributor

Summary

  • Controller displays the 6-digit SAS code, no longer prompts for confirmation
  • Target prompts the operator to type the code shown on the controller's screen
  • Constant-time verifySAS() comparison catches mismatches automatically — eliminates rubber-stamp risk from "Codes match? (Y/n)" defaulting to Y
  • One-sided verification on the target is sufficient: the target's allow list is the security-critical one (controls who may authenticate)

Changes

  • packages/cli/src/handshake.ts — added verifySAS() with constant-time comparison
  • packages/cli/src/commands/listen.ts — replaced confirm prompt with code entry prompt
  • packages/cli/src/commands/invite.ts — display-only (removed confirm prompt and unused imports)
  • packages/relay/src/__tests__/handshake.integration.test.ts — 5 new tests for verifySAS
  • Updated docs: protocol-spec, architecture-decisions, guide, self-hosting, CLI README, root README
  • Updated landing page: home page demo, self-hosting docs page

Test plan

  • All existing tests pass (bun run test — 157 tests across 4 packages)
  • 5 new verifySAS tests: matching codes, mismatched codes, wrong length, empty input, leading zeros
  • Lint passes (bun run lint)
  • Build passes (bun run build)

🤖 Generated with Claude Code

Replace "Codes match? (Y/n)" with code entry: controller displays the
6-digit SAS, target operator types it. Constant-time comparison catches
mismatches automatically, eliminating rubber-stamp risk. One-sided
verification on the target is sufficient — its allow list is the
security-critical one.
@YairEtzion
YairEtzion merged commit 6f8551e into main Apr 3, 2026
1 check passed
@YairEtzion
YairEtzion deleted the feat/sas-code-entry branch April 6, 2026 14:24
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