feat: add Cloudsmith vulnerability policy components#5676
Open
felixgateru wants to merge 2 commits into
Open
Conversation
|
👋 Commands for maintainers:
|
PR Risk ReviewRisk: 25/100 (low) SummaryWell-structured addition of three new Cloudsmith vulnerability policy CRUD components (create, get, delete) with comprehensive tests, documentation, and frontend mappers following established patterns in the codebase. Concerns
|
Add createVulnerabilityPolicy, getVulnerabilityPolicy, and deleteVulnerabilityPolicy actions for managing organization-scoped package vulnerability policies via the Cloudsmith v1 API. - client: add Organization and VulnerabilityPolicy types, create/get/ delete/list policy methods, list/get organization methods, and org/policy node metadata resolution - list_resources: add organization and vulnerabilityPolicy resource types - register actions and add example outputs - frontend: add mappers, types, specs, and registry entries - regenerate component docs Signed-off-by: Felix Gateru <felix.gateru@gmail.com>
Signed-off-by: Felix Gateru <felix.gateru@gmail.com>
e2f7a58 to
e68ff83
Compare
|
Risk: 25/100 (low) SummaryAdds three new Cloudsmith integration action components (create, get, delete) for organization-scoped vulnerability policy management, with Go backend, TypeScript mappers, tests, and documentation. Concerns
Recommended reviewers: forestileao |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changed
Extended the Cloudsmith integration with three new action components: Create Vulnerability Policy, Get Vulnerability Policy, and Delete Vulnerability Policy.
Why
To manage organization-scoped package vulnerability policies as part of a workflow instead of the Cloudsmith UI. This enables policy-as-code use cases: provisioning guardrails when bootstrapping an organization, auditing/drift-detection of a policy's current settings, and tearing down policies for short-lived environments.
How
Backend
Extended
pkg/integrations/cloudsmith/with:client.go— addedOrganizationandVulnerabilityPolicystructs, theVulnerabilityPolicyRequestbody, and client methodsCreateVulnerabilityPolicy,GetVulnerabilityPolicy,DeleteVulnerabilityPolicy, plusListOrganizations/create_vulnerability_policy.go—cloudsmith.createVulnerabilityPolicy: organization, name (required), description, minimum severity (select, defaultCritical), package query, and quarantine-on-violation / allow-unknown-severity booleans. Severity is validated at Setup and Execute. Emitscloudsmith.vulnerabilityPolicy.created.get_vulnerability_policy.go—cloudsmith.getVulnerabilityPolicy: organization + policy. Emitscloudsmith.vulnerabilityPolicy.fetched.delete_vulnerability_policy.go—cloudsmith.deleteVulnerabilityPolicy: organization + policy.cloudsmith.go— registered the three actions and noted org-scoped permissions in the integration instructions.Frontend
Added
web_src/src/pages/app/mappers/cloudsmith/:create_vulnerability_policy.ts,get_vulnerability_policy.ts,delete_vulnerability_policy.ts— node mappers with execution details and canvas metadata (organization via thebuilding-2icon, policy viashield).types.ts—VulnerabilityPolicyData,DeleteVulnerabilityPolicyData, node metadata and configuration interfaces.index.ts— registered mappers and event-state registries (created/fetched/deleted).test_helpers.ts—buildVulnerabilityPolicyData.