Repository navigation
refactor: address maintainability and security violations in McpController - #2069
kishore08-07 wants to merge 3 commits into
Conversation
Address SonarQube maintainability and security violations Critical: - Replace wildcard ResponseEntity<?> with ResponseEntity<Object> (S1452) - Add default cases to switch statements in handleMcpRequest and getResourceType (S131) Major: - Remove unused variables (clientCapabilities, clientInfo) (S1481) - Remove unused request parameter in handleToolsListRequest and update call sites (S1172) - Remove unused getHeader method (S1144) Minor / Security: - Replace @RequestMapping with @GetMapping (S4488) - Sanitize user-controlled inputs in log statements (S5145) - Remove redundant switch blocks (S6201) - Replace switch with if in buildMcpToolConverter (S1301) Introduce sanitize() helper method for safe logging of HTTP inputs Signed-off-by: kishore08-07 <[email protected]>
|
@lbroudoux , @SebastienDegodez requesting your review whenever you have time. |
|
This pull request has been automatically marked as stale because it has not had recent activity 😴 It will be closed in 30 days if no further activity occurs. To unstale this pull request, add a comment with detailed explanation. There can be many reasons why some specific pull request has no activity. The most probable cause is lack of time, not lack of interest. Microcks is a Cloud Native Computing Foundation project not owned by a single for-profit company. It is a community-driven initiative ruled under open governance model. Let us figure out together how to push this pull request forward. Connect with us through one of many communication channels we established here. Thank you for your patience ❤️ |
Description
This PR addresses SonarQube maintainability and security issues in
McpControlleras part of #2058.The changes fix 18 violations across critical, major and minor severity levels without changing existing behaviour.
Critical:
ResponseEntity<?>withResponseEntity<Object>(S1452)handleMcpRequestandgetResourceType(S131)Major:
clientCapabilities, clientInfo) (S1481 & S1854)handleToolsListRequest(S1172)getHeadermethod (S1144)Minor:
@RequestMappingwith@GetMapping(S4488)buildMcpToolConverter(S1301)Introduce sanitize() helper method for safe logging of HTTP inputs
Related issue(s)
See also #2058