Skip to content

Commit

Permalink
Improve Audit result table views
Browse files Browse the repository at this point in the history
Signed-off-by: Michael Sverdlov <[email protected]>
  • Loading branch information
sverdlov93 committed Aug 29, 2023
1 parent f5875ab commit 29f031f
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 10 deletions.
6 changes: 3 additions & 3 deletions utils/tests/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -139,10 +139,10 @@ func ChangeDirAndAssert(t *testing.T, dirPath string) {
}

// ChangeDirWithCallback changes working directory to the given path and return function that change working directory back to the original path.
func ChangeDirWithCallback(t *testing.T, callbackDir, chdirPath string) func() {
ChangeDirAndAssert(t, chdirPath)
func ChangeDirWithCallback(t *testing.T, originWd, destinationWd string) func() {
ChangeDirAndAssert(t, destinationWd)
return func() {
ChangeDirAndAssert(t, callbackDir)
ChangeDirAndAssert(t, originWd)
}
}

Expand Down
16 changes: 9 additions & 7 deletions xray/services/scan.go
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,8 @@ func (ss *ScanService) ScanGraph(scanParams XrayGraphScanParams) (string, error)
utils.SetContentType("application/json", &httpClientsDetails.Headers)
var err error
var requestBody []byte
if scanParams.AuditGraph != nil {
requestBody, err = json.Marshal(scanParams.AuditGraph)
if scanParams.DependenciesGraph != nil {
requestBody, err = json.Marshal(scanParams.DependenciesGraph)
} else {
requestBody, err = json.Marshal(scanParams.BinaryGraph)
}
Expand Down Expand Up @@ -165,11 +165,13 @@ func (ss *ScanService) GetScanGraphResults(scanId string, includeVulnerabilities
type XrayGraphScanParams struct {
// A path in Artifactory that this Artifact is intended to be deployed to.
// This will provide a way to extract the watches that should be applied on this graph
RepoPath string
ProjectKey string
Watches []string
ScanType ScanType
AuditGraph *xrayUtils.GraphNode
RepoPath string
ProjectKey string
Watches []string
ScanType ScanType
// Dependencies Tree
DependenciesGraph *xrayUtils.GraphNode
// Binary tree received from indexer-app
BinaryGraph *xrayUtils.BinaryGraphNode
IncludeVulnerabilities bool
IncludeLicenses bool
Expand Down

0 comments on commit 29f031f

Please sign in to comment.