Commit 0eabf30
authored
Codebase quality, security & performance improvements (#52)
* Add plan 2: codebase quality, security & performance improvements
Comprehensive plan covering URL encoding, WIQL escaping, JSON Pointer
escaping, CSV formula injection mitigation, error handling improvements,
input validation, performance optimizations, Docker security, CI/CD
enhancements, and expanded test coverage.
* Implement US1-US5: security, quality, performance, infrastructure
US1: URL-encode all user-controlled path segments in Azure API client
and modules; escape WIQL project/date fields; add RFC 6901 JSON Pointer
escaping for patch paths.
US2: Add CSV formula injection mitigation via sanitize_csv_value helper
that prefixes dangerous characters (=, +, -, @) with a single quote.
US3: Remove duplicate board types from models.rs; replace all unwrap()
on serialization in 11 MCP tool files with map_err; add non-empty
string validation to team_id, board_id, work_item_type, title, link_type.
US4: Parallelize comment fetching with bounded concurrency (10); add
recursion depth limits (64) to JSON processing; add HTTP connection
limits (256) and timeouts (60s) with semaphore; use HashSet for board
work item type deduplication.
US5: Add non-root user to Docker runtime; add clippy and cargo-audit
to CI; add Linux aarch64 to CD release with cleanup steps.
* Implement US6-US8: comprehensive test coverage
US6: Add 9 new compact_llm unit tests covering empty structures, Unicode,
control characters, deeply nested objects, max depth truncation, long
strings, empty string values, and mixed arrays.
US7: Add 24 new error-propagation tests and ~25 content-verification
tests across all 8 integration test files, covering every MCP tool's
error paths and output structure.
US8: Add HTTP server integration tests (connection acceptance, invalid
method rejection) and 4 CLI argument parsing unit tests.
* Apply cargo fmt formatting
* Fix HTTP server test and add test-support constructor
Add new_with_api constructor to AzureMcpServer (behind test-support
feature flag) to enable HTTP server integration tests with MockAzureDevOpsApi.
Fix Accept header in HTTP test and work item Type assertion.
* Mark US9 final verification complete in plan
All T9.1 verification checkboxes confirmed and marked complete.
make all passes with zero warnings, all 134 tests green.
* Update Cargo.lock for futures dependency
* Fix rustfmt formatting for Rust 1.94.0
Reformat build.rs and test_tools_work_items.rs to match the latest
stable rustfmt (1.94.0) line-length rules for push_str and assert!.
* Remove dead code, fix SSE timeout, and correct GET test
- Remove unused `BoardDetail::get_work_item_types()` and `HashSet` import
- Remove 60s connection timeout that would kill SSE streams; MCP
Streamable HTTP uses GET for long-lived SSE connections
- Fix invalid-method test to use PUT instead of GET (GET is valid for SSE)
- Add `test_http_server_accepts_get_for_sse` verifying GET is accepted1 parent 8dd0571 commit 0eabf30
File tree
46 files changed
+3196
-146
lines changed- .github/workflows
- docs/plans
- src
- azure
- mcp/tools
- support
- teams
- boards
- work_item_types
- work_items
- server
- tests
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
46 files changed
+3196
-146
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
75 | 75 | | |
76 | 76 | | |
77 | 77 | | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
78 | 88 | | |
79 | 89 | | |
80 | 90 | | |
81 | 91 | | |
82 | | - | |
83 | 92 | | |
84 | 93 | | |
85 | 94 | | |
| 95 | + | |
86 | 96 | | |
87 | 97 | | |
88 | 98 | | |
| |||
105 | 115 | | |
106 | 116 | | |
107 | 117 | | |
| 118 | + | |
108 | 119 | | |
109 | 120 | | |
110 | 121 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
34 | 34 | | |
35 | 35 | | |
36 | 36 | | |
| 37 | + | |
| 38 | + | |
37 | 39 | | |
38 | 40 | | |
39 | 41 | | |
40 | 42 | | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
41 | 46 | | |
42 | 47 | | |
43 | 48 | | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
44 | 65 | | |
45 | 66 | | |
46 | 67 | | |
| |||
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
40 | 40 | | |
41 | 41 | | |
42 | 42 | | |
| 43 | + | |
43 | 44 | | |
44 | 45 | | |
45 | 46 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
33 | 33 | | |
34 | 34 | | |
35 | 35 | | |
| 36 | + | |
| 37 | + | |
36 | 38 | | |
37 | 39 | | |
38 | 40 | | |
39 | 41 | | |
| 42 | + | |
| 43 | + | |
40 | 44 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
171 | 171 | | |
172 | 172 | | |
173 | 173 | | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
174 | 183 | | |
175 | 184 | | |
176 | 185 | | |
| |||
0 commit comments