fix(server): put /api/status behind password auth

Only /api/health remains public for liveness probes. /api/status
exposes hostname, version, and server ID which shouldn't be
accessible without authentication.
This commit is contained in:
Mohamed Boudra
2026-05-01 21:16:56 +07:00
parent a4a6713550
commit 829f3f7460
4 changed files with 4 additions and 5 deletions
+1 -2
View File
@@ -122,6 +122,5 @@ export function shouldBypassBearerAuth(method: string, path: string): boolean {
if (method === "OPTIONS") {
return true;
}
// Public liveness/version endpoints used by local supervisors and health probes.
return path === "/api/health" || path === "/api/status";
return path === "/api/health";
}
@@ -97,7 +97,7 @@ describe("daemon bearer auth", () => {
expect(health.status).toBe(200);
const status = await fetch(`http://127.0.0.1:${daemonHandle.port}/api/status`);
expect(status.status).toBe(200);
expect(status.status).toBe(401);
} finally {
await daemonHandle.close();
}