Migrate credential encryption to the async safeStorage API
CI / verify (push) Canceled after 0s

Electron 45 deprecates the synchronous safeStorage methods and Electron 46
removes them. Credential encryption now uses encryptStringAsync,
decryptStringAsync and isAsyncEncryptionAvailable.

- secret-store: async encryptField/decryptField/encryptCredentials/
  decryptCredentials, decryptFieldWithStatus exposes shouldReEncrypt.
  Unavailable or failing encryption still rejects with the existing
  SECRET_STORE_* codes; legacy plaintext stays readable.
- config-store: the first load runs asynchronously through init();
  writes encrypt before the atomic write. A synchronous load() of an
  encrypted config before init() fails with SECRET_STORE_NOT_READY and
  schedules a refresh. Values flagged with shouldReEncrypt are
  re-encrypted once after loading.
- main: await configStore.init() after app ready, before the first load.
- MCP access store and online backup keyring await the async helpers;
  MCP saves keep their call order.

Existing enc:v1 values written with encryptString stay readable: on
Windows both APIs use the same v10 format and Local State key, verified
in both directions with real Electron 41 and 45.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
SucukdeluxeandClaude Opus 5.5 committed 2026-10-22 07:57:54 +02:00
1 parent 94e7b91797
commit 0b30a9180a
7 files changed
+125 -65

No files matched your search

+1 -1
View File
@@ -82,7 +82,7 @@ function createOnlineBackupManager({
const settings = await loadSettings();
const recoveryPublicKey = await loadRecoveryPublicKey();
const created = createBackup(settings, appVersion(), createdAt, retention, recoveryPublicKey);
let prepared = keyring.prepare(created.key, createdAt, created.expiresAt ?? null);
let prepared = await keyring.prepare(created.key, createdAt, created.expiresAt ?? null);
const metadata = await uploadBackup(created.record);
if (metadata?.sourceIp) prepared = Object.freeze({ ...prepared, sourceIp: metadata.sourceIp });
try {