-
Notifications
You must be signed in to change notification settings - Fork 3
Added 'Access Denied' screen for unauthorized MCP users #376
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added 'Access Denied' screen for unauthorized MCP users #376
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR adds an authorization layer to the Managed Control Plane (MCP) page to display an "Access Denied" screen when users lack permission to view MCP resources. The implementation checks user authorization by attempting to access CRD resources and handles 401/403 errors appropriately.
Key Changes
- Added
ManagedControlPlaneAuthorizationwrapper component that checks user permissions via CRD access - Created reusable
Centercomponent for centering content vertically and horizontally - Enhanced
Infoboxcomponent with size-specific icon styling andnoMarginprop
Reviewed Changes
Copilot reviewed 11 out of 12 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
src/spaces/mcp/authorization/ManagedControlPlaneAuthorization.tsx |
New authorization wrapper component that checks CRD access and shows access denied screen for unauthorized users |
src/spaces/mcp/pages/McpPage.tsx |
Wraps MCP page content with authorization check and updates loading indicator to use Center component |
src/lib/api/types/crossplane/CRDList.ts |
Adds CRDRequestAuthCheck resource with jq filter for lightweight authorization checks |
src/components/Ui/Center/Center.tsx |
New utility component for centering content with flexbox |
src/components/Ui/Center/Center.module.css |
Styles for the Center component |
src/components/Ui/Infobox/Infobox.tsx |
Adds noMargin prop and size-specific icon styling |
src/components/Ui/Infobox/Infobox.module.css |
Adds icon-sm, no-margin styles, and updates size-sm styling |
src/components/Ui/NotFoundBanner/NotFoundBanner.tsx |
Wraps content with Center component for consistent positioning |
src/components/ControlPlanes/ControlPlaneCard/ControlPlaneCard.tsx |
Fixes logic to show either warning or connect button (not both) |
src/lib/shared/McpContext.tsx |
Removes trailing whitespace |
public/locales/en.json |
Adds translation keys for access denied messages |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
src/spaces/mcp/authorization/ManagedControlPlaneAuthorization.tsx
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Copilot reviewed 11 out of 12 changed files in this pull request and generated 1 comment.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
src/spaces/mcp/authorization/ManagedControlPlaneAuthorization.tsx
Outdated
Show resolved
Hide resolved
Co-authored-by: Copilot <[email protected]>
Co-authored-by: Copilot <[email protected]>
|
@lucasgoral I've opened a new pull request, #383, to work on those changes. Once the pull request is ready, I'll request review from you. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
GJ! lgtm :)
What this PR does / why we need it: