feat(cli): add ldgr devices command for QR/X25519 device onboarding#265
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Adds an
ldgr devicescommand group that lets you pair a new device to your vault against a self-hostedldgr-server, transferring the vault key end-to-end encrypted over the existing sync relay. This wires the already-implemented core onboarding crypto and server relay into an operator-facing CLI surface.What's included
ldgr devicessubcommands:list— show the devices registered to your vault's account.add— start a pairing session on an already-set-up device; renders a scannable QR code, a copy-paste token, and a verification code, then waits for the new device to join.join <token>— complete onboarding on a new device (one that has already runldgr sync setup); prints its own verification code and installs the received vault key.remove <id>— deregister a device.ldgr-core(sync::pairing): I/O-free per ADR-005, with the pairing token codec, an ECDH handshake, and zeroize-on-drop session state. All I/O (QR, prompts, poll loops, session storage) lives in the CLI.docs/sync-setup.mdand aCHANGELOG.mdentry.iOS QR-scanning onboarding remains a planned follow-up; today
jointakes the token as an argument.Related Issues
Closes #225
Type of Change
Component
crates/ldgr-core/— Core library (crypto, accounting, storage)crates/ldgr-cli/— CLI toolcrates/ldgr-server/— Sync serverbindings/swift/— UniFFI Swift bindingsapps/ios/— iOS / iPadOS / watchOS appapps/web/— Web app (Next.js + WASM)docs/— DocumentationPrivacy Checklist
Checklist
cargo test --workspace)cargo clippy --workspace -- -D warnings)cargo fmt --check)Testing: adds
crates/ldgr-server/tests/device_pairing_e2e.rswith two end-to-end tests proving (1) a joining device recovers the initiator's exact vault key over the encrypted relay and (2) device register/list/remove round-trips. Also adds unit tests for the pairing token codec inldgr-core. Verifiedcargo test --workspace --all-features,cargo clippy --workspace --all-features --all-targets -- -D warnings,cargo fmt --check, andmarkdownlint-cli2all pass.CI note: no CI job names changed, so no
kafkade/github-infraTerraform update is required.