Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions apps/desktop/src/pages/PoliciesPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,15 @@ import { fetchPolicies } from "../lib/api";
import { Button } from "../components/ui/Button";
import { Card, CardBody, CardHeader, CardTitle } from "../components/ui/Card";

const POLICY_SECTIONS = ["agent_registry", "command_allowlist", "forbidden_actions", "tool_registry"] as const;
const POLICY_SECTIONS = [
"control_plane_runtime_policy",
"agent_registry",
"command_allowlist",
"forbidden_actions",
"tool_registry",
] as const;
const SECTION_LABELS: Record<string, string> = {
control_plane_runtime_policy: "Control-plane runtime policy",
agent_registry: "Agent registry",
command_allowlist: "Command allowlist",
forbidden_actions: "Forbidden actions",
Expand All @@ -24,7 +31,7 @@ export function PoliciesPage() {

return (
<div className="content">
<div className="section-header"><div><h1 className="page-title">Policies</h1><p className="page-subtitle">Security policy settings: agent registry, command allowlist, tool permissions, and forbidden actions</p></div><Button onClick={load} disabled={loading}>{loading ? "Refreshing..." : "Refresh"}</Button></div>
<div className="section-header"><div><h1 className="page-title">Policies</h1><p className="page-subtitle">Audit control-plane runtime rules, agent registry, command allowlist, tool permissions, and forbidden actions from one policy desk.</p></div><Button onClick={load} disabled={loading}>{loading ? "Refreshing..." : "Refresh"}</Button></div>
{error && <div className="alert alert-danger" role="alert" aria-live="assertive">{error}</div>}
{loading ? <div className="skeleton-stack-lg"><div className="skeleton skeleton-row" /><div className="skeleton skeleton-row" /></div> : (
<div className="grid-2">
Expand Down
3 changes: 3 additions & 0 deletions apps/desktop/src/pages/overview_policies_branch.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,7 @@ describe("overview + policies low-branch coverage", () => {
)
.mockRejectedValueOnce(new Error("policies error"))
.mockResolvedValueOnce({
control_plane_runtime_policy: { completion_governance: { components: ["dod_checker", "reply_auditor", "continuation_policy"] } },
agent_registry: "ALLOW_ALL",
command_allowlist: { commands: ["run"] },
forbidden_actions: null,
Expand All @@ -199,7 +200,9 @@ describe("overview + policies low-branch coverage", () => {
fireEvent.click(screen.getByRole("button", { name: "Refresh" }));
await waitFor(() => {
expect(screen.queryByText("policies error")).not.toBeInTheDocument();
expect(screen.getByText("Control-plane runtime policy")).toBeInTheDocument();
expect(screen.getByText("ALLOW_ALL")).toBeInTheDocument();
expect(screen.getByText(/"completion_governance": \{/)).toBeInTheDocument();
expect(screen.getByText(/"commands": \[/)).toBeInTheDocument();
expect(screen.getAllByText("No data").length).toBeGreaterThanOrEqual(2);
});
Expand Down
Loading