Skip to content

Commit 4b3cdc7

Browse files
Add scan id flag to risk management command (AST-000)
1 parent dd12e8d commit 4b3cdc7

2 files changed

Lines changed: 3 additions & 7 deletions

File tree

internal/params/binds.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,6 @@ var EnvVarsBinds = []struct {
7373
{AiProxyCheckmarxAiRouteKey, AiProxyCheckmarxAiRouteEnv, "api/ai-proxy/redirect/azure"},
7474
{ASCAPortKey, ASCAPortEnv, ""},
7575
{ScsRepoTokenKey, ScsRepoTokenEnv, ""},
76-
{RiskManagementPathKey, RiskManagementPathEnv, "api/risk-management/projects/%s/results"},
76+
{RiskManagementPathKey, RiskManagementPathEnv, "api/risk-management/projects/%s/results?scanID=%s"},
7777
{ConfigFilePathKey, ConfigFilePathEnv, ""},
7878
}

internal/wrappers/risk-management-http.go

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
package wrappers
22

33
import (
4-
"bytes"
54
"encoding/json"
65
"fmt"
76
"net/http"
@@ -24,11 +23,8 @@ func NewHTTPRiskManagementWrapper(path string) RiskManagementWrapper {
2423
func (r *RiskManagementHTTPWrapper) GetTopVulnerabilitiesByProjectID(projectID string, scanID string) (*ASPMResult, *WebError, error) {
2524
clientTimeout := viper.GetUint(commonParams.ClientTimeoutKey)
2625

27-
model := GetASPMResultRequest{ScanId: scanID}
28-
jsonBytes, err := json.Marshal(model)
29-
30-
path := fmt.Sprintf(r.path, projectID)
31-
resp, err := SendHTTPRequest(http.MethodGet, path, bytes.NewBuffer(jsonBytes), true, clientTimeout)
26+
path := fmt.Sprintf(r.path, projectID, scanID)
27+
resp, err := SendHTTPRequest(http.MethodGet, path, nil, true, clientTimeout)
3228
if err != nil {
3329
return nil, nil, err
3430
}

0 commit comments

Comments
 (0)