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

Function doReadAsync

src/utils/secureStorage/macOsKeychainStorage.ts:178–196  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

176} satisfies SecureStorage
177
178async function doReadAsync(): Promise<SecureStorageData | null> {
179 try {
180 const storageServiceName = getMacOsKeychainStorageServiceName(
181 CREDENTIALS_SERVICE_SUFFIX,
182 )
183 const username = getUsername()
184 const { stdout, code } = await execFileNoThrow(
185 'security',
186 ['find-generic-password', '-a', username, '-w', '-s', storageServiceName],
187 { useCwd: false, preserveOutputOnError: false },
188 )
189 if (code === 0 && stdout) {
190 return jsonParse(stdout.trim())
191 }
192 } catch (_e) {
193 // fall through
194 }
195 return null
196}
197
198let keychainLockedCache: boolean | undefined
199

Callers 1

readAsyncFunction · 0.85

Calls 4

execFileNoThrowFunction · 0.85
jsonParseFunction · 0.85
getUsernameFunction · 0.70

Tested by

no test coverage detected