feat(api): agent-bridge state + server + agents + cert + bypass + upstream-ca routes (F5)

12 REST routes under /api/tools/agent-bridge/ covering all AgentBridge
backend surfaces: server lifecycle, per-agent state/DNS/mappings/detect,
cert status/download/regenerate, bypass pattern CRUD, upstream CA config.
All routes use Zod validation and route errors through sanitizeErrorMessage.

feat(authz): mark agent-bridge LOCAL_ONLY + SPAWN_CAPABLE (F5)

Adds /api/tools/agent-bridge/ to both LOCAL_ONLY_API_PREFIXES and
SPAWN_CAPABLE_PREFIXES in routeGuard.ts — satisfying Hard Rules #15 + #17.
This commit is contained in:
diegosouzapw
2026-05-28 00:24:38 -03:00
parent cb6a8c1641
commit 19c4ff9bb0
13 changed files with 588 additions and 0 deletions

View File

@@ -31,6 +31,7 @@ export const LOCAL_ONLY_API_PREFIXES: ReadonlyArray<string> = [
"/api/services/", // T-10: embedded service lifecycle (spawn child processes)
"/dashboard/providers/services/", // T-07: reverse proxy to embedded service UIs
"/api/copilot/", // unauthenticated LLM driver — CLI-only by default; admins can opt-in to remote access via manage-scope bypass
"/api/tools/agent-bridge/", // AgentBridge: spawns MITM server + DNS edits (Hard Rules #15 + #17)
];
/**
@@ -51,6 +52,7 @@ export const LOCAL_ONLY_API_PREFIXES: ReadonlyArray<string> = [
export const SPAWN_CAPABLE_PREFIXES: ReadonlyArray<string> = [
"/api/cli-tools/runtime/",
"/api/services/", // T-10: can run npm install + spawn node processes
"/api/tools/agent-bridge/", // start/stop MITM server + DNS edits (Hard Rules #15 + #17)
];
/**