MCPcopy Index your code
hub / github.com/codeaashu/claude-code / update

Function update

src/utils/secureStorage/plainTextStorage.ts:44–69  ·  view source on GitHub ↗
(data: SecureStorageData)

Source from the content-addressed store, hash-verified

42 }
43 },
44 update(data: SecureStorageData): { success: boolean; warning?: string } {
45 // sync IO: called from sync context (SecureStorage interface)
46 try {
47 const { storageDir, storagePath } = getStoragePath()
48 try {
49 getFsImplementation().mkdirSync(storageDir)
50 } catch (e: unknown) {
51 const code = getErrnoCode(e)
52 if (code !== 'EEXIST') {
53 throw e
54 }
55 }
56
57 writeFileSync_DEPRECATED(storagePath, jsonStringify(data), {
58 encoding: 'utf8',
59 flush: false,
60 })
61 chmodSync(storagePath, 0o600)
62 return {
63 success: true,
64 warning: 'Warning: Storing credentials in plaintext.',
65 }
66 } catch {
67 return { success: false }
68 }
69 },
70 delete(): boolean {
71 // sync IO: called from sync context (SecureStorage interface)
72 const { storagePath } = getStoragePath()

Callers

nothing calls this directly

Calls 5

getStoragePathFunction · 0.85
getFsImplementationFunction · 0.85
getErrnoCodeFunction · 0.85
writeFileSync_DEPRECATEDFunction · 0.85
jsonStringifyFunction · 0.85

Tested by

no test coverage detected