fix(security): add safeStorage fallback for production builds (#38)
* fix(security): add safeStorage fallback for production builds - Replace hard keytar dependency with multi-strategy key storage: 1. safeStorage (Electron built-in) - preferred 2. keytar (system keychain) - fallback 3. File-based encryption - last resort - Dynamically import keytar to avoid hard failure in production - Refactor cloudHandler to use const instead of let (Clean Code) - Fix 'Failed to load cloud accounts' error in packaged app The keytar native module fails to load from asar archives in production builds. This fix ensures the app works even when system keychain access is unavailable. * refactor(security): address code review feedback - Replace sync file ops with async (fs/promises) - Add atomic file writes to prevent data races - Implement concurrency lock for key generation - Add SecurityError class with specific error codes: - KEY_STORAGE_FAILED, ENCRYPTION_FAILED, DECRYPTION_FAILED - INVALID_FORMAT, AUTH_TAG_MISMATCH, CORRUPTED_DATA - Enhance error categorization in decrypt() for better diagnostics - Add security warnings for file-based fallback mode * fix: align error handling after merge * feat: migrate legacy encrypted account data * chore: enable beta prerelease workflow *skip release* --------- Co-authored-by: Draculabo <[email protected]>
This commit is contained in:
1 parent
e844aa9545
commit
92dc2f6f21
8 files changed
+738
-89
No files matched your search
+1
-1
@@ -194,7 +194,7 @@ const appendReleaseNotesPlugin = {
|
||||
};
|
||||
|
||||
const releaseConfig = {
|
||||
branches: ['main', 'master'],
|
||||
branches: ['main', { name: 'beta', prerelease: true }],
|
||||
plugins: [
|
||||
[
|
||||
'@semantic-release/commit-analyzer',
|
||||
|
||||
Reference in new issue
Block a user