-
Notifications
You must be signed in to change notification settings - Fork 8.5k
[Contextual Security][Fleet] Add Cloud Connector Edit Button and Management Flyout #244542
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
base: main
Are you sure you want to change the base?
Conversation
d628fcd to
7e07779
Compare
…atus --include-path /api/alerting/rule/ --include-path /api/alerting/rules --include-path /api/actions --include-path /api/security/role --include-path /api/spaces --include-path /api/streams --include-path /api/fleet --include-path /api/saved_objects/_import --include-path /api/saved_objects/_export --include-path /api/maintenance_window --include-path /api/agent_builder --update
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 enhances the cloud connector management experience by adding inline editing capabilities and a comprehensive management flyout to the integration setup flow. It introduces new Fleet API endpoints for tracking connector usage and updating connector metadata, along with corresponding React hooks and comprehensive test coverage.
Key Changes:
- Added an inline edit button to the cloud connector selector dropdown
- Created a management flyout component to view, edit, and track connector usage
- Implemented new Fleet API endpoints for usage tracking and connector updates
Reviewed changes
Copilot reviewed 20 out of 20 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
utils.ts |
Added cloud connector name validation utilities with max length constant and validation functions |
utils.test.ts |
Comprehensive test coverage for name validation functions including edge cases |
use_update_cloud_connector.ts |
New React hook for updating cloud connector metadata with optimistic updates and notifications |
use_cloud_connector_usage.ts |
New React hook for fetching paginated connector usage data |
use_cloud_connector_usage.test.ts |
Test coverage for usage hook including error and edge cases |
use_cloud_connector_setup.ts |
Refactored to use shared name validation utility |
use_cloud_connector_setup.test.ts |
Updated mock to include new validation function |
cloud_connector_selector.tsx |
Added edit button with flyout integration and state management |
cloud_connector_selector.test.tsx |
Simplified tests focused on new flyout functionality |
cloud_connector_name_field.tsx |
Refactored to use shared validation utilities and added test subject support |
cloud_connector_policies_flyout/index.tsx |
New flyout component with name editing, usage table, and pagination |
cloud_connector_policies_flyout/index.test.tsx |
Comprehensive test coverage for flyout functionality |
test_subjects.ts |
Added test subjects for new flyout and edit button components |
rest_spec/cloud_connector.ts |
Added request/response schemas for usage API endpoint |
cloud_connector/index.ts |
Registered new usage API route with versioning |
cloud_connector/handlers.ts |
Implemented usage handler that queries package policies by connector ID |
cloud_connector.ts (types) |
Added TypeScript interfaces for usage response data |
routes.ts |
Added usage endpoint pattern to route constants |
bundle.serverless.json |
Generated OAS documentation for new usage endpoint |
bundle.json |
Generated OAS documentation for new usage endpoint |
Comments suppressed due to low confidence (1)
x-pack/solutions/security/packages/kbn-cloud-security-posture/public/src/components/fleet_extensions/cloud_connector/cloud_connector_policies_flyout/index.tsx:1
- Using
as anytype assertions bypasses TypeScript's type safety. ThecloudConnectorVarsprop is typed asRecord<string, any>but could be properly typed based on the provider. Consider using a discriminated union type or proper type guards to avoid unsafe type assertions.
/*
x-pack/platform/plugins/shared/fleet/server/routes/cloud_connector/handlers.ts
Show resolved
Hide resolved
...ic/src/components/fleet_extensions/cloud_connector/cloud_connector_policies_flyout/index.tsx
Outdated
Show resolved
Hide resolved
|
Pinging @elastic/contextual-security-apps (Team:Cloud Security) |
|
Pinging @elastic/fleet (Team:Fleet) |
…atus --include-path /api/alerting/rule/ --include-path /api/alerting/rules --include-path /api/actions --include-path /api/security/role --include-path /api/spaces --include-path /api/streams --include-path /api/fleet --include-path /api/saved_objects/_import --include-path /api/saved_objects/_export --include-path /api/maintenance_window --include-path /api/agent_builder --update
⏳ Build in-progress
Failed CI StepsTest Failures
History
cc @seanrathier |
Summary
This PR adds an inline edit button to the cloud connector selector dropdown and introduces a comprehensive management flyout, enabling users to view, edit, and track usage of their reusable cloud connectors directly from the integration setup flow. Includes new Fleet API endpoints to support usage tracking and connector updates.
closes https://github.com/elastic/security-team/issues/14608
Key Changes
1. Inline Edit Button in Selector
Added a pencil icon button next to the selected cloud connector option in the dropdown selector that opens a management flyout.
2. Cloud Connector Management Flyout
New
CloudConnectorPoliciesFlyoutcomponent provides a comprehensive view of the selected connector.Flyout Header:
Flyout Body - Usage Tracking:
3. New Fleet Cloud Connector APIs
Usage API -
GET /api/fleet/cloud_connectors/{id}/usagepageandperPageUpdate API -
PUT /api/fleet/cloud_connectors/{id}4. Frontend API Integration Hooks
useCloudConnectorUsage- Fetches integration usage data with:useUpdateCloudConnector- Updates connector metadata with:get-cloud-connectorsandcloud-connector-usageChecklist
Reviewers should verify this PR satisfies this list as well.
release_note:breakinglabel should be applied in these situations.release_note:*label is applied per the guidelinesbackport:*labels.