Fix Zai and Minimax auth for usage

This commit is contained in:
gsxdsm
2026-04-13 07:38:38 -07:00
parent bbe2542362
commit a2d54c4a42
9 changed files with 332 additions and 95 deletions

View File

@@ -291,6 +291,12 @@ describe("runDashboard — AuthStorage & ModelRegistry wiring", () => {
expect(serverOpts.authStorage.setApiKey).toBeTypeOf("function");
expect(serverOpts.authStorage.clearApiKey).toBeTypeOf("function");
expect(serverOpts.authStorage.hasApiKey).toBeTypeOf("function");
expect(serverOpts.authStorage.getApiKeyProviders()).toEqual([
{ id: "kimi-coding", name: "Kimi" },
{ id: "minimax", name: "Minimax" },
{ id: "openrouter", name: "OpenRouter" },
{ id: "zai", name: "Zai" },
]);
});
it("creates AuthStorage via AuthStorage.create()", async () => {
@@ -642,4 +648,3 @@ describe("runDashboard — per-project engine manager (multi-project)", () => {
});
});

View File

@@ -247,9 +247,18 @@ const mocks = vi.hoisted(() => {
const authStorage = {
getApiKey: vi.fn().mockResolvedValue(undefined),
reload: vi.fn(),
getOAuthProviders: vi.fn().mockReturnValue([]),
hasAuth: vi.fn().mockReturnValue(false),
login: vi.fn(),
logout: vi.fn(),
set: vi.fn(),
remove: vi.fn(),
get: vi.fn(),
};
const modelRegistry = {
getAll: vi.fn().mockReturnValue([]),
registerProvider: vi.fn(),
refresh: vi.fn(),
};