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

Function createKeyringEntry

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

Source from the content-addressed store, hash-verified

172}
173
174function createKeyringEntry(
175 configPath: string,
176 runtimeFlags: RuntimeFlags
177): KeyringEntry {
178 try {
179 if (runtimeFlags.keyringUnavailableForTesting) {
180 throw new Error(`${KEYRING_UNAVAILABLE_ENV} is set`);
181 }
182
183 const { Entry } = loadKeyringModule();
184
185 return new Entry(KEYRING_SERVICE, getKeyringAccount(configPath));
186 } catch (error) {
187 const wrappedError = new Error(KEYRING_UNAVAILABLE_ERROR);
188 (wrappedError as Error & { cause?: unknown }).cause = error;
189 throw wrappedError;
190 }
191}
192
193function isKeyringUnavailableError(error: unknown): boolean {
194 return error instanceof Error && error.message === KEYRING_UNAVAILABLE_ERROR;

Callers 3

Calls 1

getKeyringAccountFunction · 0.85

Tested by

no test coverage detected