TestScope_ApproveRejectIsAccountOnly: HITL approve/reject is barred for an agent-scoped credential EVEN ON ITS OWN BOUND AGENT — self-approval would defeat the human-in-the-loop gate. (The human magic-link flow is a separate, token-gated handler and is unaffected.) requireAccountScope runs first, so
(t *testing.T)
| 149 | // token-gated handler and is unaffected.) requireAccountScope runs first, so the |
| 150 | // 403 fires before any approve/reject dependency is consulted. |
| 151 | func TestScope_ApproveRejectIsAccountOnly(t *testing.T) { |
| 152 | srv := scopeTestServer(t) |
| 153 | for _, path := range []string{ |
| 154 | "/v1/agents/support%40acme.com/messages/msg_1/approve", |
| 155 | "/v1/agents/support%40acme.com/messages/msg_1/reject", |
| 156 | } { |
| 157 | code, body := sendJSON(t, "POST", srv.URL+path, "agtSupport", map[string]any{}) |
| 158 | if code != 403 || errCode(body) != "forbidden" { |
| 159 | t.Errorf("agent key POST %s (own bound agent): status %d body %v, want 403 forbidden", path, code, body) |
| 160 | } |
| 161 | } |
| 162 | } |
| 163 | |
| 164 | // TestScope_AgentKeyPinnedToBoundAgent: a per-agent runtime route lets an |
| 165 | // agent-scoped credential act as its bound agent but 403s on any other agent; |
nothing calls this directly
no test coverage detected