Repository navigation
Commit 1354b5c
committed
fix(runtime-config): enforce launch limits and redact args/env in debug
Address wolfyy970's #5321 re-review by mirroring #5349's hard limits at construction time, so an invalid launch document cannot be built — let alone serialized out through any Serialize path:
- enforce 16-server / 128-arg / 128-env / 64KiB limits inside from_runtime_config (now returns Result) and re-check the 64KiB bound on the encoded bytes in to_json
- drop the derived Debug on LaunchStdioServer for a manual impl that prints only the name and arg/env counts
- redact both args and env values in the mcp_launch_mapper sample output
- report environment entry issues by 1-based index rather than echoing (possibly secret) keys
- add regression tests: too many servers/args/env rejected, oversized document rejected before encoding, and debug + sample output never leak arg/env secrets
Co-authored-by: whyihaveyou <[email protected]>
Signed-off-by: whyihaveyou <[email protected]>1 parent 80dfdaf commit 1354b5c
2 files changed
Lines changed: 234 additions & 30 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
20 | 28 | | |
21 | 29 | | |
22 | 30 | | |
| |||
46 | 54 | | |
47 | 55 | | |
48 | 56 | | |
49 | | - | |
50 | | - | |
51 | | - | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
52 | 60 | | |
53 | 61 | | |
54 | 62 | | |
| |||
0 commit comments