Skip to content
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

AST-16676: added query mapping option #39

Merged
9 commits merged into from
Sep 26, 2022
4 changes: 4 additions & 0 deletions cmd/args.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,10 @@ func GetArgs(cmd *cobra.Command, productName string) internal.Args {
if err != nil {
panic(err)
}
args.QueryMappingFile, err = cmd.Flags().GetString(queryMapping)
if err != nil {
panic(err)
}

args.OutputPath, err = os.Getwd()
if err != nil {
Expand Down
21 changes: 12 additions & 9 deletions cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,17 @@ import (
)

const (
userArg = "user"
passArg = "pass"
urlArg = "url"
exportArg = "export"
projectsActiveSinceArg = "projects-active-since"
debugArg = "debug"
verboseArg = "verbose"
projectsIds = "project-id"
teamName = "project-team"
userArg = "user"
passArg = "pass"
urlArg = "url"
exportArg = "export"
projectsActiveSinceArg = "projects-active-since"
debugArg = "debug"
verboseArg = "verbose"
projectsIds = "project-id"
teamName = "project-team"
queryMapping = "query-mapping"
queryMappingPathDefault = "https://raw.githubusercontent.com/Checkmarx/sast-to-ast-export/master/data/mapping.json"

projectsActiveSinceDefaultValue = 180
)
Expand Down Expand Up @@ -108,6 +110,7 @@ func init() {
rootCmd.Flags().StringP(userArg, "", "", "SAST username")
rootCmd.Flags().StringP(passArg, "", "", "SAST password")
rootCmd.Flags().StringP(urlArg, "", "", "SAST url")
rootCmd.Flags().StringP(queryMapping, "", queryMappingPathDefault, "Path to file query mapping IDs from AST for triage")
rootCmd.Flags().StringP(teamName, "", "", "Team name filter")
rootCmd.Flags().StringP(projectsIds, "", "", "Project ID filter")
rootCmd.Flags().StringSliceP(exportArg, "", export.GetOptions(), "SAST export options")
Expand Down
Loading