Commit f17b984
committed
feat(agentos-api): stub policy endpoints to avoid /policies 404
The Policies tab in the obs-branch UI calls /api/policies + /opa-policies
+ /agents/:name/policy. In the upstream design these proxy to an external
SRS (Security/Runtime/Safety) service; we don't run SRS in this
deployment so the UI was showing "/policies → 404".
Add minimal stubs so the UI gets empty list responses + can render its
clean EmptyState components:
GET /policies → {policies: []} 200
GET /policies/:id → {error: NOT_FOUND} 404
POST /policies → {error: SRS_NOT_CONFIGURED} 503
PUT /policies/:id → 503
DELETE /policies/:id → 503
GET /agents/:name/policy → {binding: null} 200
PUT /agents/:name/policy → {binding: null} 200
GET /opa-policies → {policies: []} 200
GET /opa-policies/:id → 404
POST/PUT/DELETE /opa-policies → 503
When the SRS proxy lands, drop these stubs and replace with a reverse-
proxy to the SRS service (existing pattern uses a Caddy header injection
for the x-api-key).
Deployed to prod (enterprise.clawagent.sh). Policies tab now shows
empty states instead of an error toast.1 parent bcacedc commit f17b984
1 file changed
Lines changed: 21 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
832 | 832 | | |
833 | 833 | | |
834 | 834 | | |
| 835 | + | |
| 836 | + | |
| 837 | + | |
| 838 | + | |
| 839 | + | |
| 840 | + | |
| 841 | + | |
| 842 | + | |
| 843 | + | |
| 844 | + | |
| 845 | + | |
| 846 | + | |
| 847 | + | |
| 848 | + | |
| 849 | + | |
| 850 | + | |
| 851 | + | |
| 852 | + | |
| 853 | + | |
| 854 | + | |
| 855 | + | |
835 | 856 | | |
836 | 857 | | |
0 commit comments