fix: update the save configuration of the cli tools

This commit is contained in:
2026-07-19 20:56:53 +07:00
parent d741708d44
commit c9d17d3586
2 changed files with 23 additions and 1 deletions
+19
View File
@@ -292,6 +292,25 @@ describe("dashboard guard CLI Tools access", () => {
expect(response.body.error).toBe("CLI Tools are available only from the local machine");
});
it("allows authenticated remote users to access CLI tool configuration", async () => {
const response = await proxy(request("/api/cli-tools/config/claude", {
host: "router.example.com",
}, "user-token"));
expect(response).toBe(mocks.nextResponse);
});
it("rejects unauthenticated remote CLI tool configuration access", async () => {
mocks.verifyDashboardAuthToken.mockResolvedValue(false);
const response = await proxy(request("/api/cli-tools/config/claude", {
host: "router.example.com",
}));
expect(response.status).toBe(401);
expect(response.body.error).toBe("Unauthorized");
});
it("allows a local administrator to use CLI Tools", async () => {
mocks.getUserById.mockResolvedValue({ id: "user-1", isActive: true, role: "admin" });