-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Add
fcli fod issue list
command
- Loading branch information
Showing
4 changed files
with
90 additions
and
0 deletions.
There are no files selected for viewing
This file contains 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
26 changes: 26 additions & 0 deletions
26
fcli-core/fcli-fod/src/main/java/com/fortify/cli/fod/issue/cli/cmd/FoDIssueCommands.java
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
/******************************************************************************* | ||
* Copyright 2021, 2023 Open Text. | ||
* | ||
* The only warranties for products and services of Open Text | ||
* and its affiliates and licensors ("Open Text") are as may | ||
* be set forth in the express warranty statements accompanying | ||
* such products and services. Nothing herein should be construed | ||
* as constituting an additional warranty. Open Text shall not be | ||
* liable for technical or editorial errors or omissions contained | ||
* herein. The information contained herein is subject to change | ||
* without notice. | ||
*******************************************************************************/ | ||
package com.fortify.cli.fod.issue.cli.cmd; | ||
|
||
import com.fortify.cli.common.cli.cmd.AbstractContainerCommand; | ||
|
||
import picocli.CommandLine; | ||
|
||
@CommandLine.Command(name = "issue", | ||
subcommands = { | ||
FoDIssueListCommand.class, | ||
} | ||
) | ||
//@DefaultVariablePropertyName("applicationId") | ||
public class FoDIssueCommands extends AbstractContainerCommand { | ||
} |
52 changes: 52 additions & 0 deletions
52
fcli-core/fcli-fod/src/main/java/com/fortify/cli/fod/issue/cli/cmd/FoDIssueListCommand.java
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
/******************************************************************************* | ||
* Copyright 2021, 2023 Open Text. | ||
* | ||
* The only warranties for products and services of Open Text | ||
* and its affiliates and licensors ("Open Text") are as may | ||
* be set forth in the express warranty statements accompanying | ||
* such products and services. Nothing herein should be construed | ||
* as constituting an additional warranty. Open Text shall not be | ||
* liable for technical or editorial errors or omissions contained | ||
* herein. The information contained herein is subject to change | ||
* without notice. | ||
*******************************************************************************/ | ||
package com.fortify.cli.fod.issue.cli.cmd; | ||
|
||
import com.fortify.cli.common.output.cli.mixin.OutputHelperMixins; | ||
import com.fortify.cli.common.rest.query.IServerSideQueryParamGeneratorSupplier; | ||
import com.fortify.cli.common.rest.query.IServerSideQueryParamValueGenerator; | ||
import com.fortify.cli.fod._common.cli.mixin.FoDDelimiterMixin; | ||
import com.fortify.cli.fod._common.output.cli.cmd.AbstractFoDBaseRequestOutputCommand; | ||
import com.fortify.cli.fod._common.rest.query.FoDFiltersParamGenerator; | ||
import com.fortify.cli.fod._common.rest.query.cli.mixin.FoDFiltersParamMixin; | ||
import com.fortify.cli.fod.release.cli.mixin.FoDReleaseByQualifiedNameOrIdResolverMixin; | ||
|
||
import kong.unirest.HttpRequest; | ||
import kong.unirest.UnirestInstance; | ||
import lombok.Getter; | ||
import picocli.CommandLine.Command; | ||
import picocli.CommandLine.Mixin; | ||
|
||
@Command(name = OutputHelperMixins.List.CMD_NAME) | ||
public class FoDIssueListCommand extends AbstractFoDBaseRequestOutputCommand implements IServerSideQueryParamGeneratorSupplier { | ||
@Getter @Mixin private OutputHelperMixins.List outputHelper; | ||
@Mixin private FoDDelimiterMixin delimiterMixin; // Is automatically injected in resolver mixins | ||
@Mixin private FoDReleaseByQualifiedNameOrIdResolverMixin.RequiredOption releaseResolver; | ||
@Mixin private FoDFiltersParamMixin filterParamMixin; | ||
@Getter private IServerSideQueryParamValueGenerator serverSideQueryParamGenerator = new FoDFiltersParamGenerator(); | ||
// .add("id","applicationId") | ||
// .add("name","applicationName") | ||
// .add("criticality", "businessCriticalityType") | ||
// .add("type", "applicationType"); | ||
|
||
@Override | ||
public HttpRequest<?> getBaseRequest(UnirestInstance unirest) { | ||
return unirest.get("/api/v3/releases/{releaseId}/vulnerabilities") | ||
.routeParam("releaseId", releaseResolver.getReleaseId(unirest)); | ||
} | ||
|
||
@Override | ||
public boolean isSingular() { | ||
return false; | ||
} | ||
} |
This file contains 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