(data: SecureStorageData)
| 76 | return null |
| 77 | }, |
| 78 | update(data: SecureStorageData): { success: boolean; warning?: string } { |
| 79 | // sync IO: called from sync context (SecureStorage interface) |
| 80 | try { |
| 81 | const { storageDir, storagePath } = getStoragePath() |
| 82 | try { |
| 83 | getFsImplementation().mkdirSync(storageDir) |
| 84 | } catch (e: unknown) { |
| 85 | const code = getErrnoCode(e) |
| 86 | if (code !== 'EEXIST') { |
| 87 | throw e |
| 88 | } |
| 89 | } |
| 90 | |
| 91 | writeFileSync_DEPRECATED(storagePath, jsonStringify(data), { |
| 92 | encoding: 'utf8', |
| 93 | flush: false, |
| 94 | }) |
| 95 | chmodSync(storagePath, 0o600) |
| 96 | return { |
| 97 | success: true, |
| 98 | warning: 'Warning: Storing credentials in plaintext.', |
| 99 | } |
| 100 | } catch { |
| 101 | return { success: false } |
| 102 | } |
| 103 | }, |
| 104 | delete(): boolean { |
| 105 | // sync IO: called from sync context (SecureStorage interface) |
| 106 | const { storagePath } = getStoragePath() |
nothing calls this directly
no test coverage detected