Commit 1185f01
committed
feat(http): enforce required per-request _meta on the 2026 stateless path (P1)
The audit (+ codex review) flagged a conformance gap: the schema makes
RequestParams._meta REQUIRED (RequestMetaObject with protocolVersion/clientInfo/
clientCapabilities) and the Base Protocol MUSTs -32602/HTTP-400 on missing required
fields and on header/body protocol-version disagreement, but the 2026 server parsed
_meta loosely and never rejected. Now the 2026 transport path validates every
JsonRpcMessage::Request before dispatch: missing params._meta, a missing required
RequestMetaObject key, or an _meta.protocolVersion that disagrees with the
MCP-Protocol-Version header all return JSON-RPC -32602 at HTTP 400. Enforcement is
2026-only; 2025-11-25 is unaffected. Our bilingual client already attaches complete
_meta on every 2026 request (incl. the server/discover probe), so negotiation is
unchanged.
Tests: discover_stateless_2026 gains 3 negative-path wire cases (missing _meta;
missing clientCapabilities; header/body version mismatch) → all assert HTTP 400 +
-32602. Revert-and-fail recorded: stashing the enforcement makes missing_meta fail
(request gets 200). The enforcement surfaced two lambda lifecycle tests sending
un-_meta'd tools/list under 2026 — gated 2025-only (they exercise the removed
initialize/initialized handshake) along with their now-2025-only fixtures.
Default suite: 0 failures, 0 warnings (build + test). Lambda 2025: 105 pass.1 parent d09b380 commit 1185f01
3 files changed
Lines changed: 139 additions & 5 deletions
File tree
- crates
- turul-http-mcp-server/src
- turul-mcp-aws-lambda/src
- turul-mcp-server/tests
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1437 | 1437 | | |
1438 | 1438 | | |
1439 | 1439 | | |
1440 | | - | |
1441 | | - | |
1442 | | - | |
1443 | | - | |
1444 | | - | |
| 1440 | + | |
| 1441 | + | |
| 1442 | + | |
| 1443 | + | |
| 1444 | + | |
| 1445 | + | |
| 1446 | + | |
| 1447 | + | |
| 1448 | + | |
| 1449 | + | |
| 1450 | + | |
| 1451 | + | |
| 1452 | + | |
| 1453 | + | |
| 1454 | + | |
| 1455 | + | |
| 1456 | + | |
| 1457 | + | |
| 1458 | + | |
| 1459 | + | |
| 1460 | + | |
| 1461 | + | |
| 1462 | + | |
| 1463 | + | |
| 1464 | + | |
| 1465 | + | |
| 1466 | + | |
| 1467 | + | |
| 1468 | + | |
| 1469 | + | |
| 1470 | + | |
| 1471 | + | |
| 1472 | + | |
| 1473 | + | |
| 1474 | + | |
| 1475 | + | |
| 1476 | + | |
| 1477 | + | |
| 1478 | + | |
| 1479 | + | |
| 1480 | + | |
| 1481 | + | |
| 1482 | + | |
| 1483 | + | |
| 1484 | + | |
| 1485 | + | |
| 1486 | + | |
| 1487 | + | |
| 1488 | + | |
| 1489 | + | |
| 1490 | + | |
| 1491 | + | |
| 1492 | + | |
| 1493 | + | |
| 1494 | + | |
| 1495 | + | |
1445 | 1496 | | |
1446 | 1497 | | |
1447 | 1498 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
915 | 915 | | |
916 | 916 | | |
917 | 917 | | |
| 918 | + | |
918 | 919 | | |
919 | 920 | | |
920 | 921 | | |
| |||
934 | 935 | | |
935 | 936 | | |
936 | 937 | | |
| 938 | + | |
937 | 939 | | |
938 | 940 | | |
939 | 941 | | |
| 942 | + | |
940 | 943 | | |
941 | 944 | | |
942 | 945 | | |
943 | 946 | | |
944 | 947 | | |
| 948 | + | |
945 | 949 | | |
946 | 950 | | |
947 | 951 | | |
948 | 952 | | |
949 | 953 | | |
| 954 | + | |
950 | 955 | | |
951 | 956 | | |
952 | 957 | | |
953 | 958 | | |
954 | 959 | | |
955 | 960 | | |
956 | 961 | | |
| 962 | + | |
957 | 963 | | |
958 | 964 | | |
959 | 965 | | |
960 | 966 | | |
961 | 967 | | |
| 968 | + | |
962 | 969 | | |
963 | 970 | | |
964 | 971 | | |
965 | 972 | | |
966 | 973 | | |
| 974 | + | |
967 | 975 | | |
968 | 976 | | |
969 | 977 | | |
970 | 978 | | |
971 | 979 | | |
| 980 | + | |
972 | 981 | | |
| 982 | + | |
973 | 983 | | |
974 | 984 | | |
975 | 985 | | |
| 986 | + | |
976 | 987 | | |
977 | 988 | | |
978 | 989 | | |
| |||
986 | 997 | | |
987 | 998 | | |
988 | 999 | | |
| 1000 | + | |
989 | 1001 | | |
990 | 1002 | | |
991 | 1003 | | |
| |||
1002 | 1014 | | |
1003 | 1015 | | |
1004 | 1016 | | |
| 1017 | + | |
1005 | 1018 | | |
1006 | 1019 | | |
1007 | 1020 | | |
| |||
1026 | 1039 | | |
1027 | 1040 | | |
1028 | 1041 | | |
| 1042 | + | |
1029 | 1043 | | |
1030 | 1044 | | |
1031 | 1045 | | |
| |||
1039 | 1053 | | |
1040 | 1054 | | |
1041 | 1055 | | |
| 1056 | + | |
1042 | 1057 | | |
1043 | 1058 | | |
1044 | 1059 | | |
| |||
1222 | 1237 | | |
1223 | 1238 | | |
1224 | 1239 | | |
| 1240 | + | |
| 1241 | + | |
| 1242 | + | |
1225 | 1243 | | |
1226 | 1244 | | |
1227 | 1245 | | |
| |||
1279 | 1297 | | |
1280 | 1298 | | |
1281 | 1299 | | |
| 1300 | + | |
1282 | 1301 | | |
1283 | 1302 | | |
1284 | 1303 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
194 | 194 | | |
195 | 195 | | |
196 | 196 | | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
0 commit comments