refactor(auth): remove keys auth module and align tests

- remove server auth module and client keys page/routes/api to simplify flow

- update mcp and scenario tests to match uuid routes and step schema
This commit is contained in:
2026-04-10 16:42:43 +03:00
parent 673aa0f458
commit 259dac806e
23 changed files with 69 additions and 612 deletions
-2
View File
@@ -1,7 +1,6 @@
import { Module } from "@nestjs/common";
import { McpController } from "./mcp.controller";
import { McpService } from "./mcp.service";
import { AuthModule } from "../auth/auth.module";
import { SessionModule } from "../session/session.module";
import { EnvironmentModule } from "../environment/environment.module";
import { BrowserModule } from "../browser/browser.module";
@@ -10,7 +9,6 @@ import { ScenarioModule } from "../scenario/scenario.module";
@Module({
imports: [
AuthModule,
SessionModule,
EnvironmentModule,
BrowserModule,
-49
View File
@@ -3,7 +3,6 @@ import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
import { StreamableHTTPServerTransport } from "@modelcontextprotocol/sdk/server/streamableHttp.js";
import { z } from "zod";
import type { Request, Response } from "express";
import { AuthService } from "../auth/auth.service";
import { SessionService } from "../session/session.service";
import { SessionContextService } from "../session/session-context.service";
import { EnvironmentService } from "../environment/environment.service";
@@ -17,7 +16,6 @@ import pkg from "../../package.json";
@Injectable()
export class McpService {
constructor(
private readonly authService: AuthService,
private readonly sessionService: SessionService,
private readonly sessionContextService: SessionContextService,
private readonly environmentService: EnvironmentService,
@@ -33,53 +31,6 @@ export class McpService {
}
private registerTools(server: McpServer): void {
// ── Auth ──────────────────────────────────────────────────────────────────
server.registerTool(
"list_keys",
{ description: "List available key identifiers from the keys directory" },
async () => {
const keys = this.authService.listKeys();
return {
content: [{ type: "text" as const, text: JSON.stringify(keys) }],
};
},
);
server.registerTool(
"login",
{
description:
"Log in using a file key against a named environment and store the session",
inputSchema: {
key: z
.string()
.describe(
"Key identifier (filename without extension from keys/ dir)",
),
environmentName: z
.string()
.describe("Environment name to resolve login/cabinet URLs"),
sessionName: z
.string()
.optional()
.describe(
"Session name to store credentials under. Auto-UUID if omitted.",
),
},
},
async ({ key, environmentName, sessionName }) => {
const result = await this.authService.login(
key,
environmentName,
sessionName,
);
return {
content: [{ type: "text" as const, text: JSON.stringify(result) }],
};
},
);
// ── Sessions ──────────────────────────────────────────────────────────────
server.registerTool(