mirror of
https://github.com/lWolvesl/antigravity-usage-monitor.git
synced 2026-11-27 01:19:25 +08:00
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:
@@ -2,7 +2,16 @@ import fs from 'node:fs';
|
||||
import path from 'node:path';
|
||||
import { pathToFileURL } from 'node:url';
|
||||
import vm from 'node:vm';
|
||||
import { createHash, randomUUID } from 'node:crypto';
|
||||
import {
|
||||
createCipheriv,
|
||||
createDecipheriv,
|
||||
createHash,
|
||||
createHmac,
|
||||
randomBytes,
|
||||
randomUUID,
|
||||
scrypt,
|
||||
timingSafeEqual,
|
||||
} from 'node:crypto';
|
||||
import { isDeepStrictEqual } from 'node:util';
|
||||
import * as metrics from '../trajectory-metrics.mjs';
|
||||
import { stripModuleSyntax } from '../scripts/build-bundle.mjs';
|
||||
@@ -25,6 +34,8 @@ const BACKEND_MODULE_FILES = [
|
||||
'../backend/fs-atomic.mjs',
|
||||
'../backend/context-windows.mjs',
|
||||
'../backend/account-oauth.mjs',
|
||||
'../backend/account-login.mjs',
|
||||
'../backend/account-vault-crypto.mjs',
|
||||
'../backend/account-switch.mjs',
|
||||
'../backend/http-helpers.mjs',
|
||||
'../backend/settings-schema.mjs',
|
||||
@@ -106,7 +117,7 @@ export function backendHarness({
|
||||
}
|
||||
};
|
||||
const ctx={
|
||||
...metricsImplementation, URL, AbortSignal, Buffer, TextDecoder, ...timerApi, isDeepStrictEqual, createHash, randomUUID,
|
||||
...metricsImplementation, URL, AbortSignal, Buffer, TextDecoder, ...timerApi, isDeepStrictEqual, createCipheriv, createDecipheriv, createHash, createHmac, randomBytes, randomUUID, scrypt, timingSafeEqual,
|
||||
...(clock ? { Date: class extends Date {
|
||||
constructor(...args) { super(...(args.length ? args : [clock()])); }
|
||||
static now() { return clock(); }
|
||||
|
||||
Reference in New Issue
Block a user