()
| 121 | } |
| 122 | |
| 123 | func (s *Server) registerAgentProtection() { |
| 124 | huma.Register(s.API, huma.Operation{ |
| 125 | OperationID: "getAgentProtection", |
| 126 | Method: http.MethodGet, |
| 127 | Path: "/v1/agents/{email}/protection", |
| 128 | Summary: "Get an agent's protection config (beta)", |
| 129 | Description: "Read the agent's protection posture — inbound/outbound trust gate, content-scan sensitivity, and hold-queue mechanism. Account scope only: an agent-scoped credential cannot read its own protection config. " + protectionBetaDoc, |
| 130 | Tags: []string{"agents"}, |
| 131 | Security: []map[string][]string{{"bearer": {}}}, |
| 132 | }, s.handleGetProtection) |
| 133 | |
| 134 | huma.Register(s.API, huma.Operation{ |
| 135 | OperationID: "putAgentProtection", |
| 136 | Method: http.MethodPut, |
| 137 | Path: "/v1/agents/{email}/protection", |
| 138 | Summary: "Replace an agent's protection config (beta)", |
| 139 | Description: "Replace the agent's protection posture wholesale. The three top-level keys (inbound, outbound, holds) are required; leaves default. Account scope only. " + protectionBetaDoc, |
| 140 | Tags: []string{"agents"}, |
| 141 | Security: []map[string][]string{{"bearer": {}}}, |
| 142 | }, s.handlePutProtection) |
| 143 | } |
| 144 | |
| 145 | func (s *Server) handleGetProtection(ctx context.Context, in *getProtectionInput) (*protectionOutput, error) { |
| 146 | // Protection config is account administration — an agent-scoped credential |
no test coverage detected