MCPcopy Create free account
hub / github.com/vercel/vercel / readFileStorageCredentials

Function readFileStorageCredentials

packages/cli-auth/credentials-store.ts:306–336  ·  view source on GitHub ↗
(
  configPath: string,
  runtimeFlags: RuntimeFlags
)

Source from the content-addressed store, hash-verified

304}
305
306function readFileStorageCredentials(
307 configPath: string,
308 runtimeFlags: RuntimeFlags
309): Credentials {
310 try {
311 const credentials = readCredentialsFromFile(configPath);
312
313 if (cliConfig.authConfigHasUsableTokenData(credentials)) {
314 return credentials;
315 }
316
317 return (
318 tryReadKeyringCredentialsIntoFile(configPath, runtimeFlags) ?? credentials
319 );
320 } catch (error) {
321 if (!isENOENTError(error)) {
322 throw error;
323 }
324
325 const credentials = tryReadKeyringCredentialsIntoFile(
326 configPath,
327 runtimeFlags
328 );
329
330 if (credentials !== null) {
331 return credentials;
332 }
333
334 throw error;
335 }
336}
337
338function migrateCredentialsToKeyring(
339 configPath: string,

Callers 1

getFunction · 0.85

Calls 3

readCredentialsFromFileFunction · 0.85
isENOENTErrorFunction · 0.85

Tested by

no test coverage detected