Improve UI error handling for SSRF-blocked URL scenarios#1344
Improve UI error handling for SSRF-blocked URL scenarios#1344JanithaSampathBandara wants to merge 4 commits into
Conversation
|
ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
🚧 Files skipped from review as they are similar to previous changes (2)
📝 WalkthroughWalkthroughThis PR changes validation and endpoint-test error handling across five components to prefer server response body fields ( ChangesError Message Enrichment in Validation
Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
JanithaSampathBandara seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account. You have signed the CLA already but the status is still pending? Let us recheck it. |
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In
`@portals/publisher/src/main/webapp/source/src/app/components/Apis/Create/OpenAPI/Steps/ProvideOpenAPI.jsx`:
- Around line 165-171: In the MCP server URL validation catch block inside
ProvideOpenAPI.jsx update the error selection so it mirrors the non‑MCP path:
when calling setValidity({ url: { message: ... } }) use the chain
error.response?.body?.description || error.response?.body?.message ||
error.message instead of jumping directly from description to error.message;
locate the catch handler that calls setValidity, onValidate(false),
setIsValidating(false) and replace the message expression to include the
intermediate error.response?.body?.message fallback.
In
`@portals/publisher/src/main/webapp/source/src/app/components/MCPServers/Create/MCPServerCreateProxy.jsx`:
- Around line 234-239: The fallback hardcoded string assigned to errorMessage
bypasses i18n; replace the literal 'Failed to validate MCP Server URL' with a
call to intl.formatMessage (using an existing message id or add a new one) when
constructing errorMessage so that setValidationError receives a localized string
(ensure intl is in scope in MCPServerCreateProxy.jsx and keep the existing
precedence of error.response.body.description || error.response.body.message ||
intl.formatMessage(...)); this will ensure the validationError shown to the user
is localized.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: ba807d46-e7f5-49af-bea9-aa4026db48d6
📒 Files selected for processing (5)
portals/publisher/src/main/webapp/source/src/app/components/Apis/Create/AsyncAPI/Steps/ProvideAsyncAPI.jsxportals/publisher/src/main/webapp/source/src/app/components/Apis/Create/Components/DefaultAPIForm.jsxportals/publisher/src/main/webapp/source/src/app/components/Apis/Create/GraphQL/Steps/ProvideGraphQL.jsxportals/publisher/src/main/webapp/source/src/app/components/Apis/Create/OpenAPI/Steps/ProvideOpenAPI.jsxportals/publisher/src/main/webapp/source/src/app/components/MCPServers/Create/MCPServerCreateProxy.jsx
|



Purpose
This PR adds UI improvements related to the outbound request security feature introduced to mitigate Server-Side Request Forgery (SSRF) attacks.
Previously, outbound request validation failures could surface as generic HTTP errors in the UI, making it difficult for users to understand the actual validation issue.
This improvement provides clearer validation feedback for blocked or untrusted remote URLs.
Goals
Approach
Updated UI components responsible for endpoint validation to properly extract and display backend validation errors returned by outbound request security checks.
Improved:
Handled scenarios including:
Release Note
Improved UI error handling for outbound request security validation failures.
Testing
Verified: