All of the mid-session and step-up auth work
This commit is contained in:
parent
1f31e0f1f8
commit
562bdd00f1
1 changed files with 11437 additions and 1212 deletions
|
|
@ -28,6 +28,10 @@ import {
|
|||
MutableRedirectUrlProvider,
|
||||
} from "@inspector/core/auth/index.js";
|
||||
import { NodeOAuthStorage } from "@inspector/core/auth/node/index.js";
|
||||
import {
|
||||
connectInspectorWithOAuth,
|
||||
withCliAuthRecoveryRetry,
|
||||
} from "./cliOAuth.js";
|
||||
import {
|
||||
DEFAULT_RUNNER_OAUTH_CALLBACK_URL,
|
||||
formatRunnerOAuthRedirectUrl,
|
||||
|
|
@ -122,9 +126,7 @@ async function callMethod(
|
|||
null;
|
||||
let managedPromptsState: ManagedPromptsState | null = null;
|
||||
|
||||
try {
|
||||
await inspectorClient.connect();
|
||||
|
||||
const runMethod = async (): Promise<McpResponse> => {
|
||||
let result: McpResponse;
|
||||
|
||||
if (args.method === "tools/list" || args.method === "tools/call") {
|
||||
|
|
@ -248,6 +250,26 @@ async function callMethod(
|
|||
);
|
||||
}
|
||||
|
||||
return result;
|
||||
};
|
||||
|
||||
try {
|
||||
await connectInspectorWithOAuth(
|
||||
inspectorClient,
|
||||
serverConfig,
|
||||
redirectUrlProvider,
|
||||
callbackUrlConfig!,
|
||||
serverSettings,
|
||||
);
|
||||
|
||||
const result = await withCliAuthRecoveryRetry(
|
||||
inspectorClient,
|
||||
redirectUrlProvider,
|
||||
callbackUrlConfig!,
|
||||
serverSettings,
|
||||
runMethod,
|
||||
);
|
||||
|
||||
await awaitableLog(JSON.stringify(result, null, 2));
|
||||
} finally {
|
||||
managedToolsState?.destroy();
|
||||
|
|
|
|||
Loading…
Reference in a new issue