Added fod xxx-scan update commands#1024
Open
kadraman wants to merge 1 commit into
Open
Conversation
…updated on a scan (closes fortify#913)
There was a problem hiding this comment.
Pull request overview
This PR adds support in the FoD module for updating scan attributes via new xxx-scan update subcommands, leveraging the new FoD API PUT /api/v3scans/{scanId} capability requested in #913.
Changes:
- Introduce
updatecommands for SAST/DAST/MAST/OSS scan command groups, backed by a sharedAbstractFoDScanUpdateCommand. - Add a request DTO (
FoDScanPutRequest) and helper method (FoDScanHelper.updateScan) to perform thePUT /api/v3scans/{scanId}call. - Extend CLI attribute options with a required
--attrs/--attributesvariant and add i18n entries for the new commands/options.
Reviewed changes
Copilot reviewed 14 out of 14 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| fcli-core/fcli-fod/src/main/resources/com/fortify/cli/fod/i18n/FoDMessages.properties | Adds usage/option text for new *-scan update commands. |
| fcli-core/fcli-fod/src/main/java/com/fortify/cli/fod/sast_scan/cli/cmd/FoDSastScanUpdateCommand.java | Adds fod sast-scan update command implementation. |
| fcli-core/fcli-fod/src/main/java/com/fortify/cli/fod/sast_scan/cli/cmd/FoDSastScanCommands.java | Registers SAST update subcommand. |
| fcli-core/fcli-fod/src/main/java/com/fortify/cli/fod/oss_scan/cli/cmd/FoDOssScanUpdateCommand.java | Adds fod oss-scan update command implementation. |
| fcli-core/fcli-fod/src/main/java/com/fortify/cli/fod/oss_scan/cli/cmd/FoDOssScanCommands.java | Registers OSS update subcommand. |
| fcli-core/fcli-fod/src/main/java/com/fortify/cli/fod/mast_scan/cli/cmd/FoDMastScanUpdateCommand.java | Adds fod mast-scan update command implementation. |
| fcli-core/fcli-fod/src/main/java/com/fortify/cli/fod/mast_scan/cli/cmd/FoDMastScanCommands.java | Registers MAST update subcommand. |
| fcli-core/fcli-fod/src/main/java/com/fortify/cli/fod/dast_scan/cli/cmd/FoDDastScanUpdateCommand.java | Adds fod dast-scan update command implementation (currently hidden). |
| fcli-core/fcli-fod/src/main/java/com/fortify/cli/fod/dast_scan/cli/cmd/FoDDastScanCommands.java | Registers DAST update subcommand. |
| fcli-core/fcli-fod/src/main/java/com/fortify/cli/fod/attribute/cli/mixin/FoDAttributeUpdateOptions.java | Adds required --attrs/--attributes option variant. |
| fcli-core/fcli-fod/src/main/java/com/fortify/cli/fod/_common/scan/helper/FoDScanPutRequest.java | Introduces PUT request body model for scan updates. |
| fcli-core/fcli-fod/src/main/java/com/fortify/cli/fod/_common/scan/helper/FoDScanHelper.java | Adds updateScan() helper method invoking the new API. |
| fcli-core/fcli-fod/src/main/java/com/fortify/cli/fod/_common/scan/cli/cmd/AbstractFoDScanUpdateCommand.java | Implements shared CLI logic for resolving scan + building merged attributes payload + calling update. |
| fcli-core/fcli-fod/src/main/java/com/fortify/cli/fod/_common/rest/FoDUrls.java | Adds V3_SCAN URL constant for /api/v3scans/{scanId}. |
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.
As per #913