feat(account): add multi-account switcher and passphrase vault

- Enable Windows multi-account sign-in via loopback PKCE OAuth and unified borderless quota cards with Ultra 5x/20x tier detection and instant cached-list preloading
- Keep active-account quota strictly on live host telemetry while supporting configurable background OAuth refresh intervals (10m-24h, default 1h) for saved backup accounts
- Add optional scrypt + AES-256-GCM secondary passphrase encryption with per-email AAD binding, unlock backoff, key zeroing, at-rest token minimization, and OAuth client_id allowlisting
- Harden account mutations with inline two-step switch/remove confirmations, HMAC action nonces, Webview context checks, standalone web 403 isolation, and user-only vault directory ACLs
This commit is contained in:
fish
2026-11-25 03:42:06 +09:00
parent b9dc2b960c
commit 1330b31ef7
32 changed files with 6737 additions and 364 deletions
+12
View File
@@ -175,6 +175,18 @@ async function handleProtectedApi(pathname, method, data, req) {
contentType: 'application/json',
});
}
if (
!isTestHarnessEnv &&
pathname === '/api/accounts/update' &&
req?.headers &&
!req.headers.origin &&
!req.headers['sec-fetch-site']
) {
return new Response(JSON.stringify({ error: 'Forbidden non-webview account mutation' }), {
status: 403,
contentType: 'application/json',
});
}
const out = await forwardApiCall(pathname, method, data);
return new Response(out.body, {
status: out.status,