VAPP-20: Security settings: list and remove passkeys, TOTP backup codes #25
Loading…
Reference in a new issue
No description provided.
Delete branch "feat/security-passkeys-backup-codes-vapp-20"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
VAPP-20: Security settings: list and remove passkeys, TOTP backup codes
Extends the Security card on the settings page so users can manage their second factors directly, all over the existing
/control.ashxcontrol channel.Server functions (
src/server_fns/mod.rs)list_passkeys()reads name/id rows fromotp-hkey-get(reply{keys:[{i, name, type}]}, metadata only, no credential material).iis vervain-server'skeyIndex.remove_passkey(id)deletes one key viaotp-hkey-removeand resolves theack(for: "otp-hkey-remove"); a non-okresult (e.g.settings-locked) surfaces inline.get_backup_codes()mints a fresh batch viaotpauth-getpasswordswithsubaction: 1, returning the one-time plaintext codes (passwordsarray of{p, u}). Anullpasswords(settings-locked / no TOTP) becomes an error. A fresh mint invalidates prior codes, so this also serves "regenerate".Frame shapes were verified against vervain-server's
crates/meshcentral-web/src/user_session.rsdispatch before wiring.UI (
src/components/pages/settings.rs)statusresource and the new passkey-list resource, so the table and the count badge stay consistent without a reload.ErrorTextstyling.Acceptance criteria
just checkpasses🤖 Generated with Claude Code
Extend the settings Security card so users can see their registered passkeys by name, remove individual keys, and generate TOTP backup codes, all over the existing control channel. Server fns (src/server_fns/mod.rs): list_passkeys() reads name/id rows from otp-hkey-get; remove_passkey(id) deletes one key via otp-hkey-remove and surfaces the ack result inline; get_backup_codes() mints a fresh batch via otpauth-getpasswords (subaction 1), returning the one-time plaintext codes. Frame shapes were verified against vervain-server's user_session.rs dispatch (HkeyEntry {i,name}, ack for otp-hkey-remove, passwords array of {p,u}). UI (src/components/pages/settings.rs): the bare passkey count badge gains a per-key table with a two-click confirm-gated Remove action (matching the TOTP disable pattern); a successful add or remove restarts both the status and the new passkey-list resource so the table and count stay consistent. A Backup codes row appears only while TOTP is enabled: it generates codes, shows them once in a monospace block with a copy-to-clipboard button, and warns that regenerating invalidates prior codes. Server errors render inline. #VAPP-20 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>