Skip to content

client/webserver: require auth for companion app QR endpoint.#3541

Merged
JoeGruffins merged 1 commit intodecred:masterfrom
JoeGruffins:hardencomapnionapp
Mar 6, 2026
Merged

client/webserver: require auth for companion app QR endpoint.#3541
JoeGruffins merged 1 commit intodecred:masterfrom
JoeGruffins:hardencomapnionapp

Conversation

@JoeGruffins
Copy link
Copy Markdown
Member

Harden the companion app pairing flow:

  • Enforce Tor: the QR handler returns HTTP 400 when no onion address is available, removing the insecure http:// fallback.
  • Single-token rotation: each QR generation revokes the previous companion token so only one is valid at a time.
  • Unclaimed expiry: tokens that are not scanned within 10 minutes are automatically revoked.
  • Claim tracking: the first use of a companion token marks it as claimed, preventing expiry of active pairings.
  • DB persistence: companion tokens are stored in BoltDB so they survive server restarts. Claimed tokens also survive logout.
  • Unpair support: new POST /api/unpaircompanionapp endpoint and UI button to explicitly remove a companion app pairing.
  • Paired status: the /api/user response includes a companionAppPaired boolean so the UI can show pairing state.

@JoeGruffins JoeGruffins force-pushed the hardencomapnionapp branch 3 times, most recently from f32bd5a to 53f1e9c Compare March 5, 2026 09:38
Harden the companion app pairing flow:

- Enforce Tor: the QR handler returns HTTP 400 when no onion address
  is available, removing the insecure http:// fallback.
- Single-token rotation: each QR generation revokes the previous
  companion token so only one is valid at a time.
- Unclaimed expiry: tokens that are not scanned within 10 minutes
  are automatically revoked.
- Claim tracking: the first use of a companion token marks it as
  claimed, preventing expiry of active pairings.
- DB persistence: companion tokens are stored in BoltDB so they
  survive server restarts. Claimed tokens also survive logout.
- Unpair support: new POST /api/unpaircompanionapp endpoint and
  UI button to explicitly remove a companion app pairing.
- Paired status: the /api/user response includes a
  companionAppPaired boolean so the UI can show pairing state.
@JoeGruffins JoeGruffins merged commit f0ee03d into decred:master Mar 6, 2026
5 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