TestScope_UpdateAgentIsAccountOnly: mutating agent config is barred for an agent-scoped credential even on its own bound agent.
(t *testing.T)
| 110 | // TestScope_UpdateAgentIsAccountOnly: mutating agent config is barred for an |
| 111 | // agent-scoped credential even on its own bound agent. |
| 112 | func TestScope_UpdateAgentIsAccountOnly(t *testing.T) { |
| 113 | srv := scopeTestServer(t) |
| 114 | body := map[string]any{"name": "Renamed"} |
| 115 | |
| 116 | code, _ := sendJSON(t, "PATCH", srv.URL+"/v1/agents/support%40acme.com", "acct", body) |
| 117 | if code != 200 { |
| 118 | t.Errorf("account key PATCH agent: status %d, want 200", code) |
| 119 | } |
| 120 | code, resp := sendJSON(t, "PATCH", srv.URL+"/v1/agents/support%40acme.com", "agtSupport", body) |
| 121 | if code != 403 || errCode(resp) != "forbidden" { |
| 122 | t.Errorf("agent key PATCH own agent: status %d body %v, want 403 forbidden", code, resp) |
| 123 | } |
| 124 | } |
| 125 | |
| 126 | // TestScope_ProtectionPutIsAccountOnly: writing protection config is barred for |
| 127 | // an agent-scoped credential even on its own bound agent (#13). A valid body is |
nothing calls this directly
no test coverage detected