diff --git a/fcli-core/fcli-fod/src/main/java/com/fortify/cli/fod/_common/scan/cli/mixin/FoDScanResolverMixin.java b/fcli-core/fcli-fod/src/main/java/com/fortify/cli/fod/_common/scan/cli/mixin/FoDScanResolverMixin.java index 26266c32eb..87cf88220e 100644 --- a/fcli-core/fcli-fod/src/main/java/com/fortify/cli/fod/_common/scan/cli/mixin/FoDScanResolverMixin.java +++ b/fcli-core/fcli-fod/src/main/java/com/fortify/cli/fod/_common/scan/cli/mixin/FoDScanResolverMixin.java @@ -57,7 +57,10 @@ public String getScanId(UnirestInstance unirest) { } public final String getDelimiter() { - return delimiterMixin.getDelimiter(); + if( delimiterMixin!=null ) { + return delimiterMixin.getDelimiter(); + } + return null; } } @@ -95,7 +98,7 @@ public static class RequiredOption extends AbstractFoDScanResolverMixin { } public static class RequiredOptionMulti extends AbstractFoDMultiScanResolverMixin { - @EnvSuffix("SCANS") @Option(names = {"--scans"}, required=true, split=",", descriptionKey = "fcli.fod.scan.scan-id") + @EnvSuffix("SCANS") @Option(names = {"--scans"}, required=true, split=",", descriptionKey = "fcli.fod.scan.scan-ids") @Getter private String[] releaseQualifiedScanOrIds; } @@ -105,7 +108,7 @@ public static class PositionalParameter extends AbstractFoDScanResolverMixin { } public static class PositionalParameterMulti extends AbstractFoDMultiScanResolverMixin { - @EnvSuffix("SCANS") @Parameters(index = "0", arity = "1..", paramLabel = "scan-id's", descriptionKey = "fcli.fod.scan.scan-id") + @EnvSuffix("SCANS") @Parameters(index = "0", arity = "1..", paramLabel = "scan-id's", descriptionKey = "fcli.fod.scan.scan-ids") @Getter private String[] releaseQualifiedScanOrIds; } diff --git a/fcli-core/fcli-fod/src/main/java/com/fortify/cli/fod/_common/scan/helper/FoDScanHelper.java b/fcli-core/fcli-fod/src/main/java/com/fortify/cli/fod/_common/scan/helper/FoDScanHelper.java index 8b9ee3a72e..da64cf39bf 100644 --- a/fcli-core/fcli-fod/src/main/java/com/fortify/cli/fod/_common/scan/helper/FoDScanHelper.java +++ b/fcli-core/fcli-fod/src/main/java/com/fortify/cli/fod/_common/scan/helper/FoDScanHelper.java @@ -70,7 +70,7 @@ public static final JsonNode renameFields(JsonNode record, FoDScanType scanType) return obj; } public static final FoDScanDescriptor getScanDescriptor(UnirestInstance unirest, String releaseQualifiedScanOrId, String delimiter) { - String[] elts = releaseQualifiedScanOrId.split(delimiter); + String[] elts = (delimiter != null) ? releaseQualifiedScanOrId.split(delimiter) : new String[]{releaseQualifiedScanOrId}; switch (elts.length) { case 2: var pollingResult = unirest.get(FoDUrls.SCAN_POLLING_SUMMARY) diff --git a/fcli-core/fcli-fod/src/main/resources/com/fortify/cli/fod/i18n/FoDMessages.properties b/fcli-core/fcli-fod/src/main/resources/com/fortify/cli/fod/i18n/FoDMessages.properties index 10d1d56f1f..f9bf7afcca 100644 --- a/fcli-core/fcli-fod/src/main/resources/com/fortify/cli/fod/i18n/FoDMessages.properties +++ b/fcli-core/fcli-fod/src/main/resources/com/fortify/cli/fod/i18n/FoDMessages.properties @@ -10,7 +10,7 @@ usage.description = ### top level product command ### delim = Change the default delimiter character when using options that accept \ - "application[:microservice]:release" as an argument or parameter. + "application[:microservice]:release" as an argument or parameter. fcli.fod.usage.header = Interact with Fortify on Demand (FoD). fcli.fod.usage.description.0 = The commands in this module allow for interacting with \ Fortify on Demand (FoD). This includes functionality like managing applications, \ @@ -26,8 +26,9 @@ fcli.fod.app.app-name = Application name. fcli.fod.app.app-name-or-id = Application id or name. Note that numeric values are always interpreted \ as id's. If you have numeric application names, you will need to specify the application id. fcli.fod.app.app-type = Application type. Valid values: ${COMPLETION-CANDIDATES} -fcli.fod.app.release.microservice-and-release-name = Initial release to be created on the application, in the format : for a microservices application, or just for non-microservices applications. -fcli.fod.scan.scan-id = Scan id(s). +fcli.fod.app.release.microservice-and-release-name = Initial release to be created on the application, in the format : for a microservices application, or just for non-microservices applications. +fcli.fod.scan.scan-id = Scan id. +fcli.fod.scan.scan-ids = Scan id(s). fcli.fod.scan.entitlement-frequency = The entitlement frequency type to use. Valid values: ${COMPLETION-CANDIDATES}. fcli.fod.scan.analysis-status = Scan analysis status. Valid values: ${COMPLETION-CANDIDATES}. fcli.fod.scan.scan-type = Scan type. Valid values: ${COMPLETION-CANDIDATES}. @@ -120,7 +121,7 @@ fcli.fod.session.login.client-id.1 = Environment variable:%n \ fcli.fod.session.login.client-secret.0 = FoD client secret. fcli.fod.session.login.client-secret.1 = Environment variable:%n \ ${fcli.env.default.prefix}_FOD_CLIENT_SECRET -fcli.fod.session.login.scopes = FoD scopes to request. Default value: ${DEFAULT-VALUE} +fcli.fod.session.login.scopes = FoD scopes to request. Default value: ${DEFAULT-VALUE} fcli.fod.session.logout.usage.header = Terminate FoD session. fcli.fod.session.logout.usage.description = This command terminates an FoD session previously created \ @@ -137,7 +138,7 @@ fcli.fod.rest.usage.description = These commands allow for direct interaction wi (no need to manually specify Authorization header), rich output formatting options, and query functionality. fcli.fod.rest.call.usage.header = Call an individual FoD REST API endpoint. fcli.fod.rest.call.no-paging = By default, this command will load all pages of data from FoD (from the \ - given offset if specified as a request parameter). Use this option to return only a single page. + given offset if specified as a request parameter). Use this option to return only a single page. fcli.fod.rest.call.no-transform = By default, this command performs generic transformations on FoD REST \ responses, like only outputting the actual response data (contents of the 'items' property). Use this \ option to output the original response contents without transformations. @@ -150,7 +151,7 @@ fcli.fod.rest.lookup.usage.header = Retrieve FoD REST API lookup values. fcli.fod.rest.lookup.usage.description = Use this command to retrieve the values of lookup items (types) \ that are used with various commands and when using the FoD REST API directly. fcli.fod.rest.lookup.[0] = The type of lookup items to return. Valid values: ${COMPLETION-CANDIDATES}. \ - Leave empty to list all the valid lookup items of the REST API. + Leave empty to list all the valid lookup items of the REST API. # fcli fod action # Apart from the top-level usage header, which includes a FoD reference, all headers @@ -285,7 +286,7 @@ fcli.fod.app.output.header.microserviceName = Microservice fcli.fod.app.create.usage.header = Create a new application. fcli.fod.app.create.usage.description = This command allows a new application and its first release to be created. \ Please note some attributes might be mandatory depending on the configuration of your tenant. Please check the \ - Fortify on Demand web portal first. + Fortify on Demand web portal first. fcli.fod.app.create.application-name = The name of the application to create. fcli.fod.app.create.type = The type of the application. Valid values: ${COMPLETION-CANDIDATES}. fcli.fod.app.create.release-name = The name of the release to create for the application. @@ -378,7 +379,7 @@ fcli.fod.assessment-type.usage.header = Manage FoD assessment types. fcli.fod.assessment-type.output.header.assessmentTypeId = Id fcli.fod.assessment-type.output.header.unitInfo = Units fcli.fod.assessment-type.list.usage.header = List assessment types. -fcli.fod.assessment-type.list.scan-types = Comma-separated list of scan types for which to list assessment types. Default value: ${DEFAULT-VALUE}. Valid values: ${COMPLETION-CANDIDATES}. +fcli.fod.assessment-type.list.scan-types = Comma-separated list of scan types for which to list assessment types. Default value: ${DEFAULT-VALUE}. Valid values: ${COMPLETION-CANDIDATES}. # fcli fod entitlement fcli.fod.entitlement.usage.header = View FoD entitlements. @@ -394,7 +395,7 @@ fcli.fod.scan.usage.header = Manage FoD scans. fcli.fod.scan.usage.description = The commands listed below allow for generically managing scans on FoD. \ Commands for setting up, starting, downloading and importing existing scan results can be found on the \ relevant 'fcli fod xxx-scan' entities, for example SAST scan setup and start can be found in \ - 'fcli fod sast-scan'. + 'fcli fod sast-scan'. fcli.fod.scan.output.header.scanId = Id fcli.fod.scan.output.header.scanType = Type fcli.fod.scan.output.header.analysisStatusType = Analysis Status @@ -422,7 +423,7 @@ fcli.fod.scan.wait-for.any-state = One or more scan states against which to matc # fcli fod sast-scan fcli.fod.sast-scan.usage.header = Manage FoD SAST scans. -fcli.fod.sast-scan.description = The commands listed below allow for starting and managing SAST scans on FoD. +fcli.fod.sast-scan.description = The commands listed below allow for starting and managing SAST scans on FoD. fcli.fod.sast-scan.output.header.scanId = Id fcli.fod.sast-scan.output.header.analysisStatusType = Analysis Status fcli.fod.sast-scan.output.header.startedDateTime = Started @@ -492,7 +493,7 @@ fcli.fod.sast-scan.download-latest.file = File path and name where to save the F # fcli fod dast-scan fcli.fod.dast-scan.usage.header = Manage FoD DAST scans. -fcli.fod.dast-scan.description = The commands listed below allow for starting and managing DAST scans on FoD. +fcli.fod.dast-scan.description = The commands listed below allow for starting and managing DAST scans on FoD. fcli.fod.dast-scan.output.header.scanId = Id fcli.fod.dast-scan.output.header.analysisStatusType = Analysis Status fcli.fod.dast-scan.output.header.startedDateTime = Started @@ -655,7 +656,7 @@ fcli.fod.dast-scan.setup-api.false-positive-removal = ${fcli.fod.dast-scan.setup # fcli fod mast-scan fcli.fod.mast-scan.usage.header = Manage FoD MAST scans. -fcli.fod.mast-scan.description = The commands listed below allow for starting and managing MAST scans on FoD. +fcli.fod.mast-scan.description = The commands listed below allow for starting and managing MAST scans on FoD. fcli.fod.mast-scan.output.header.scanId = Id fcli.fod.mast-scan.output.header.analysisStatusType = Analysis Status fcli.fod.mast-scan.output.header.startedDateTime = Started @@ -713,7 +714,7 @@ fcli.fod.mast-scan.download-latest.file = File path and name where to save the F # fcli fod oss-scan fcli.fod.oss-scan.usage.header = Manage FoD OSS scans. -fcli.fod.oss-scan.description = The commands listed below allow for starting and managing OSS scans on FoD. +fcli.fod.oss-scan.description = The commands listed below allow for starting and managing OSS scans on FoD. fcli.fod.oss-scan.output.header.scanId = Id fcli.fod.oss-scan.output.header.analysisStatusType = Analysis Status fcli.fod.oss-scan.output.header.startedDateTime = Started