test(19.7-05): security review pins for the MCP endpoint's outer layers
- TestEndpointGuards: a foreign browser Origin is 403 before the bearer is read, a body over the endpoint cap is 413, a long GET stream ends once its grant stops verifying (T-19.7-18, T-19.7-19) - TestDispatch: an argument key the input struct does not declare is refused before dispatch (T-19.7-17) - the gate requires TestEndpointGuards (untagged and tagged) and runs the demo's deploy check (T-19.7-37)
This commit is contained in:
@@ -121,6 +121,13 @@ func TestDispatch(t *testing.T) {
|
||||
if !res.IsError || !strings.Contains(resultText(t, res), "invalid arguments") {
|
||||
t.Fatalf("missing required title = %+v", res)
|
||||
}
|
||||
// The reflected schema refuses keys the input struct does not
|
||||
// declare (additionalProperties false), so nothing undeclared
|
||||
// reaches the route's body.
|
||||
res = call("disp_thing", map[string]any{"id": "abc", "title": "T", "user_id": 1})
|
||||
if !res.IsError || !strings.Contains(resultText(t, res), "invalid arguments") {
|
||||
t.Fatalf("undeclared key = %+v", res)
|
||||
}
|
||||
if thingHits.Load() != before {
|
||||
t.Fatal("a refused call reached the route")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user