Skip to content

feat(auth): compact QR encoding for device enrollment#86

Merged
Jesssullivan merged 1 commit intomainfrom
feat/compact-qr-enrollment
Mar 10, 2026
Merged

feat(auth): compact QR encoding for device enrollment#86
Jesssullivan merged 1 commit intomainfrom
feat/compact-qr-enrollment

Conversation

@Jesssullivan
Copy link
Collaborator

Summary

  • Enrollment invite payloads were ~1200 bytes base64, producing QR codes too dense for phone cameras to scan
  • Add compact format with short JSON keys + zstd compression (~300 bytes)
  • Add --qr CLI flag for terminal QR rendering via qrcode crate
  • UniFFI bridge uses decode_any() auto-detection for both compact and full formats

Test plan

  • cargo check passes for tcfs-auth, tcfs-cli, tcfs-file-provider
  • 6 enrollment tests pass (4 existing + 2 new compact roundtrip/size tests)
  • tcfs device invite --qr renders scannable QR on xoxd-bates
  • iOS app decodes compact invite via QR scan

🤖 Generated with Claude Code

Enrollment invite payloads were ~1200 bytes base64, producing QR codes
too dense for phone cameras to scan. Add compact format with short JSON
keys + zstd compression (~300 bytes), `--qr` CLI flag for terminal
rendering, and `decode_any()` auto-detection in UniFFI bridge for iOS.

- CompactInvite struct with single-letter keys + skip_serializing_if
- encode_compact/decode_compact/decode_any on EnrollmentInvite
- CLI `tcfs device invite --qr` renders scannable QR via qrcode crate
- UniFFI bridge uses decode_any() for both compact and full formats
- 2 new tests validating roundtrip and payload size (<500 bytes)
@Jesssullivan Jesssullivan merged commit f97ed01 into main Mar 10, 2026
8 of 10 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