Add recovery key rotation in account settings #45
Loading…
Reference in a new issue
No description provided.
Delete branch "feature/recovery-key-reset"
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
Implements recovery key rotation (regeneration) for authenticated users with E2EE scheme v2, as requested in #44.
Users can reset/regenerate their E2EE recovery key from Settings → Account → Recovery key while logged in.
Changes
POST /api/session/rotate-recovery(and/api/auth/alias) handlerhandleRotateRecoveryinauth-http-service.js. Verifies current password (authKey as proof), validates E2EE scheme v2, atomically replaceswrappedMkRecovery+recoveryHash+recoveryRotatedAt. Routes registered incore-routes.js.e2eeRotateRecovery()ine2ee-session.js— derives old keys from password, unwraps MK extractable once, generates new recovery key, wraps MK under it, sends to server.app.jswires the UI handlers and a settings-local modal showing the new key with copy + confirm.settings.htmlaccount section.settings.recoveryKey*keys added to bothen.jsonandde.json.auth-http-service.test.mjs(successful rotation, wrong password 401, non-scheme-2 409).Security model
wrappedMkRecoveryandrecoveryHashare replaced server-side. No data re-encryption needed.PRE_SESSION_PATHS).Closes #44