Commit ddcf539
authored
fix(actor): read /v1/actor response from top level instead of res.actor (#32)
Huntress's GET /v1/actor returns the actor shape ({ reseller, account,
user }) at the TOP LEVEL of the response body — unlike most other
endpoints, it is not wrapped in { actor: ... }. ActorResource.get()
requested { actor: Actor } and returned res.actor, which was always
undefined in production.
Downstream, huntress-mcp JSON.stringify(undefined) produced a
{ type: 'text', text: undefined } content block, failing MCP Zod
validation (invalid_union on content[0]) on every huntress_accounts_actor
call — surfaced by the EpiOn tool audit.
The unit test never caught it because the MSW mock wrapped the payload
as { actor: {...} }, mirroring the SDK's wrong assumption. The mock now
serves the real unwrapped shape and the test asserts the full Actor.1 parent 40fe583 commit ddcf539
3 files changed
Lines changed: 13 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
8 | | - | |
9 | | - | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
10 | 11 | | |
11 | 12 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
| 12 | + | |
| 13 | + | |
12 | 14 | | |
13 | 15 | | |
14 | | - | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
15 | 19 | | |
16 | 20 | | |
17 | 21 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
16 | | - | |
| 16 | + | |
17 | 17 | | |
18 | | - | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
19 | 22 | | |
20 | 23 | | |
21 | 24 | | |
| |||
0 commit comments