MCPcopy
hub / github.com/upstash/context7 / resolveAuth

Function resolveAuth

packages/cli/src/commands/setup.ts:136–143  ·  view source on GitHub ↗
(options: SetupOptions)

Source from the content-addressed store, hash-verified

134}
135
136async function resolveAuth(options: SetupOptions): Promise<AuthOptions | null> {
137 if (options.apiKey) return { mode: "api-key", apiKey: options.apiKey };
138 if (options.oauth) return { mode: "oauth" };
139
140 const apiKey = await authenticateAndGenerateKey();
141 if (!apiKey) return null;
142 return { mode: "api-key", apiKey };
143}
144
145async function resolveMode(options: SetupOptions): Promise<SetupMode> {
146 if (options.cli) return "cli";

Callers 1

setupMcpFunction · 0.85

Calls 1

Tested by

no test coverage detected