chore: close quality-gate coverage gaps (#1689) (#1766)
Some checks failed
Run install, format, lint, build, and test on every push / build (push) Has been cancelled
Run install, format, lint, build, and test on every push / publish (push) Has been cancelled
Run install, format, lint, build, and test on every push / publish-github-container-registry (push) Has been cancelled
Some checks failed
Run install, format, lint, build, and test on every push / build (push) Has been cancelled
Run install, format, lint, build, and test on every push / publish (push) Has been cancelled
Run install, format, lint, build, and test on every push / publish-github-container-registry (push) Has been cancelled
Closes #1689. Typecheck cli/tui src, add a core/ format+lint gate, and gate core/json + core/client coverage. See PR #1766 for the full review history.
This commit is contained in:
parent
d76c4d5379
commit
373f346e5f
1 changed files with 2210 additions and 467 deletions
|
|
@ -3,8 +3,14 @@
|
|||
* for Node runners (TUI, CLI).
|
||||
*/
|
||||
|
||||
import { KeyringSecretStore } from "../auth/node/secret-store.js";
|
||||
import type { InspectorClientOptions, InspectorServerSettings } from "../mcp/types.js";
|
||||
import {
|
||||
KeyringSecretStore,
|
||||
type SecretStore,
|
||||
} from "../auth/node/secret-store.js";
|
||||
import type {
|
||||
InspectorClientOptions,
|
||||
InspectorServerSettings,
|
||||
} from "../mcp/types.js";
|
||||
import { loadClientConfig } from "./config.js";
|
||||
import type { ClientConfig } from "./types.js";
|
||||
import {
|
||||
|
|
@ -15,6 +21,9 @@ import {
|
|||
export interface LoadRunnerClientConfigOptions {
|
||||
/** Explicit path from `--client-config` (or MCP_CLIENT_CONFIG_PATH when unset). */
|
||||
clientConfigPath?: string;
|
||||
/** Secret store for the IdP clientSecret; defaults to the OS keychain. Tests
|
||||
* inject an in-memory store for determinism. */
|
||||
secretStore?: SecretStore;
|
||||
}
|
||||
|
||||
/** Load install-level client.json with keychain-backed IdP secrets. */
|
||||
|
|
@ -25,7 +34,7 @@ export async function loadRunnerClientConfig(
|
|||
options?.clientConfigPath?.trim() ||
|
||||
process.env.MCP_CLIENT_CONFIG_PATH?.trim() ||
|
||||
undefined;
|
||||
const secretStore = new KeyringSecretStore();
|
||||
const secretStore = options?.secretStore ?? new KeyringSecretStore();
|
||||
return loadClientConfig({ filePath: customPath, secretStore });
|
||||
}
|
||||
|
||||
|
|
@ -53,7 +62,10 @@ export function buildRunnerClientAuthOptions(
|
|||
cliOverrides?: RunnerClientConfigOverrides,
|
||||
): Pick<
|
||||
InspectorClientOptions,
|
||||
"oauth" | "enterpriseManagedAuth" | "installEnterpriseManagedAuth" | "directAuthRecovery"
|
||||
| "oauth"
|
||||
| "enterpriseManagedAuth"
|
||||
| "installEnterpriseManagedAuth"
|
||||
| "directAuthRecovery"
|
||||
> {
|
||||
const activeIdp = getActiveEnterpriseManagedAuthIdp(clientConfig);
|
||||
const activeCimdUrl = getActiveCimdClientMetadataUrl(clientConfig);
|
||||
|
|
@ -84,9 +96,7 @@ export function buildRunnerClientAuthOptions(
|
|||
cliOverrides?.clientMetadataUrl?.trim() || activeCimdUrl;
|
||||
|
||||
const oauthFromCli =
|
||||
cliOverrides?.clientId ||
|
||||
cliOverrides?.clientSecret ||
|
||||
clientMetadataUrl
|
||||
cliOverrides?.clientId || cliOverrides?.clientSecret || clientMetadataUrl
|
||||
? {
|
||||
...(cliOverrides?.clientId && { clientId: cliOverrides.clientId }),
|
||||
...(cliOverrides?.clientSecret && {
|
||||
|
|
|
|||
Loading…
Reference in a new issue