Add recovery key rotation in account settings #47
Loading…
Reference in a new issue
No description provided.
Delete branch "feature/recovery-key-rotation"
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?
Summary
Closes #44.
Implements the recovery key rotation feature requested by @antonsxh. Users can now generate a new E2EE recovery key from the account settings while logged in.
How it works
e2eeChangePassword).generateRecoveryKey), and the master key is wrapped under it.wrappedMkRecoveryandrecoveryHash, and revokes all sessions (issuing a fresh one).The master key never changes — no data re-encryption is needed. The old recovery key stops working immediately.
Security model
isValidAuthKey,isValidEnvelope.replaceUserSessionsrevokes all existing sessions and issues one fresh session.Changes
src/server/services/auth-http-service.js—handleRotateRecoverysrc/server/routes/definitions/core-routes.js—/api/session/rotate-recoveryand/api/auth/rotate-recoverypublic/js/core/e2ee-session.js—e2eeRotateRecoverypublic/app.js— UI wiring, recovery key modalsrc/ui/partials/settings.html— Recovery key settings cardi18n/en.json,i18n/de.json— 9 new keys eachCHANGELOG.md— Unreleased entrytests/auth-http-service.test.mjs— 3 tests (success, wrong password, non-scheme-2)Checks
All safe local checks pass:
npm run lint(architecture + i18n)npm run test:docsnpm run test:unit— 760 tests, 0 failuresnpm run test:ui— desktop + mobile + boot