feat(HAI-095): add authentication settings UI with backend API

- Add backend auth API endpoints (GET/PUT) with validation in routes.ts
- Create frontend API client functions for fetching and updating auth config
- Add Authentication Settings section to SettingsModal with token input form
- Add comprehensive tests for routes, API client, and SettingsModal components
- Wire up auth settings routes in dashboard server
This commit is contained in:
Dustin Byrne
2026-03-26 19:39:31 -04:00
parent 9bb25a15ea
commit 7955897013
7 changed files with 700 additions and 4 deletions

View File

@@ -3,6 +3,7 @@ import { join, dirname } from "node:path";
import { existsSync } from "node:fs";
import { fileURLToPath } from "node:url";
import type { TaskStore, MergeResult } from "@hai/core";
import type { AuthStorageLike } from "./routes.js";
import { createApiRoutes } from "./routes.js";
import { createSSE } from "./sse.js";
import { rateLimit, RATE_LIMITS } from "./rate-limit.js";
@@ -14,6 +15,8 @@ export interface ServerOptions {
onMerge?: (taskId: string) => Promise<MergeResult>;
/** Maximum concurrent worktrees / execution slots (default 2) */
maxConcurrent?: number;
/** Optional AuthStorage instance for auth routes — if not provided, one is created internally */
authStorage?: AuthStorageLike;
}
export function createServer(store: TaskStore, options?: ServerOptions): ReturnType<typeof express> {