@@ -39,44 +39,44 @@ func TestConvertResults(t *testing.T) {
3939 // dockerScanInputResults := testUtils.ReadCmdScanResults(t, filepath.Join(testDataDir, "dockerscan", "docker_results.json"))
4040
4141 testCases := []struct {
42- cmdType utils.CommandType
43- contentFormat conversionFormat
42+ cmdType utils.CommandType
43+ contentFormat conversionFormat
4444 // inputResults *results.SecurityCommandResults
4545 expectedContentPath string
4646 }{
4747 {
48- cmdType : utils .SourceCode ,
49- contentFormat : SimpleJson ,
48+ cmdType : utils .SourceCode ,
49+ contentFormat : SimpleJson ,
5050 // inputResults: auditInputResults,
5151 expectedContentPath : filepath .Join (testDataDir , "audit" , "audit_simple_json.json" ),
5252 },
5353 {
54- cmdType : utils .SourceCode ,
55- contentFormat : Sarif ,
54+ cmdType : utils .SourceCode ,
55+ contentFormat : Sarif ,
5656 // inputResults: auditInputResults,
5757 expectedContentPath : filepath .Join (testDataDir , "audit" , "audit_sarif.json" ),
5858 },
5959 {
60- cmdType : utils .SourceCode ,
61- contentFormat : Summary ,
60+ cmdType : utils .SourceCode ,
61+ contentFormat : Summary ,
6262 // inputResults: auditInputResults,
6363 expectedContentPath : filepath .Join (testDataDir , "audit" , "audit_summary.json" ),
6464 },
6565 {
66- cmdType : utils .DockerImage ,
67- contentFormat : SimpleJson ,
66+ cmdType : utils .DockerImage ,
67+ contentFormat : SimpleJson ,
6868 // inputResults: dockerScanInputResults,
6969 expectedContentPath : filepath .Join (testDataDir , "dockerscan" , "docker_simple_json.json" ),
7070 },
7171 {
72- cmdType : utils .DockerImage ,
73- contentFormat : Sarif ,
72+ cmdType : utils .DockerImage ,
73+ contentFormat : Sarif ,
7474 // inputResults: dockerScanInputResults,
7575 expectedContentPath : filepath .Join (testDataDir , "dockerscan" , "docker_sarif.json" ),
7676 },
7777 {
78- cmdType : utils .DockerImage ,
79- contentFormat : Summary ,
78+ cmdType : utils .DockerImage ,
79+ contentFormat : Summary ,
8080 // inputResults: dockerScanInputResults,
8181 expectedContentPath : filepath .Join (testDataDir , "dockerscan" , "docker_summary.json" ),
8282 },
@@ -85,7 +85,7 @@ func TestConvertResults(t *testing.T) {
8585 for _ , testCase := range testCases {
8686 t .Run (fmt .Sprintf ("%s convert to %s" , testCase .cmdType , testCase .contentFormat ), func (t * testing.T ) {
8787 var validationParams validations.ValidationParams
88- var inputResults * results.SecurityCommandResults
88+ var inputResults * results.SecurityCommandResults
8989 switch testCase .cmdType {
9090 case utils .SourceCode :
9191 inputResults , validationParams = getAuditTestResults (testCase .contentFormat == Summary )
@@ -156,7 +156,7 @@ func validateSummaryConversion(t *testing.T, expectedResults formats.ResultsSumm
156156 // content, err := utils.GetAsJsonBytes(actualResults, true, true)
157157 // assert.NoError(t, err)
158158 // os.WriteFile("/Users/assafa/Documents/code/jfrog-projects/jfrog-cli-security/tests/testdata/output/dockerscan/docker_summary.json", content, 0644)
159-
159+
160160 validations .ValidateCommandSummaryOutput (t , validationParams )
161161}
162162
@@ -225,9 +225,9 @@ func getAuditTestResults(unique bool) (*results.SecurityCommandResults, validati
225225 }},
226226 },
227227 },
228- IssueId : "XRAY-609848" ,
228+ IssueId : "XRAY-609848" ,
229229 ExtendedInformation : & services.ExtendedInformation {
230- ShortDescription : "ReDoS in Async may lead to denial of service while parsing" ,
230+ ShortDescription : "ReDoS in Async may lead to denial of service while parsing" ,
231231 JfrogResearchSeverity : "Low" ,
232232 JfrogResearchSeverityReasons : []services.JfrogResearchSeverityReason {
233233 {Name : "The reported CVSS was either wrongly calculated" , Description : "The reported CVSS does not reflect the severity of the vulnerability" , IsPositive : true },
@@ -237,7 +237,7 @@ func getAuditTestResults(unique bool) (*results.SecurityCommandResults, validati
237237 },
238238 {
239239 Cves : []services.Cve {{
240- Id : "CVE-2020-8203" ,
240+ Id : "CVE-2020-8203" ,
241241 CvssV2Score : "5.8" ,
242242 CvssV3Score : "7.4" ,
243243 }},
@@ -301,7 +301,7 @@ func getAuditTestResults(unique bool) (*results.SecurityCommandResults, validati
301301 },
302302 Violations : []services.Violation {
303303 {
304- ViolationType : utils .ViolationTypeSecurity .String (),
304+ ViolationType : utils .ViolationTypeSecurity .String (),
305305 Cves : []services.Cve {{
306306 Id : "CVE-2024-39249" ,
307307 }},
@@ -322,7 +322,7 @@ func getAuditTestResults(unique bool) (*results.SecurityCommandResults, validati
322322 ExtendedInformation : & services.ExtendedInformation {JfrogResearchSeverity : "Low" },
323323 },
324324 {
325- ViolationType : utils .ViolationTypeSecurity .String (),
325+ ViolationType : utils .ViolationTypeSecurity .String (),
326326 Cves : []services.Cve {{
327327 Id : "CVE-2018-3721" ,
328328 }},
@@ -343,9 +343,9 @@ func getAuditTestResults(unique bool) (*results.SecurityCommandResults, validati
343343 },
344344 {
345345 ViolationType : utils .ViolationTypeLicense .String (),
346- LicenseKey : "MIT" ,
347- LicenseName : "MIT full name" ,
348- Severity : severityutils .High .String (),
346+ LicenseKey : "MIT" ,
347+ LicenseName : "MIT full name" ,
348+ Severity : severityutils .High .String (),
349349 Components : map [string ]services.Component {
350350 "npm://lodash:4.17.0" : {
351351 ImpactPaths : [][]services.ImpactPathNode {{
@@ -361,8 +361,8 @@ func getAuditTestResults(unique bool) (*results.SecurityCommandResults, validati
361361 },
362362 Licenses : []services.License {
363363 {
364- Key : "MIT" ,
365- Name : "MIT full name" ,
364+ Key : "MIT" ,
365+ Name : "MIT full name" ,
366366 Components : map [string ]services.Component {
367367 "npm://lodash:4.17.0" : {
368368 ImpactPaths : [][]services.ImpactPathNode {{
@@ -522,11 +522,11 @@ func getDockerScanTestResults(unique bool) (*results.SecurityCommandResults, val
522522 {ComponentId : "docker://platform.jfrog.io/swamp-docker/swamp:latest" },
523523 {
524524 ComponentId : "generic://sha256:f21c087a3964a446bce1aa4e3ec7cf82020dd77ad14f1cf4ea49cbb32eda1595/sha256__f21c087a3964a446bce1aa4e3ec7cf82020dd77ad14f1cf4ea49cbb32eda1595.tar" ,
525- FullPath : "sha256__f21c087a3964a446bce1aa4e3ec7cf82020dd77ad14f1cf4ea49cbb32eda1595.tar" ,
525+ FullPath : "sha256__f21c087a3964a446bce1aa4e3ec7cf82020dd77ad14f1cf4ea49cbb32eda1595.tar" ,
526526 },
527527 {
528528 ComponentId : "deb://debian:bookworm:libssl3:3.0.13-1~deb12u1" ,
529- FullPath : "libssl3:3.0.13-1~deb12u1" ,
529+ FullPath : "libssl3:3.0.13-1~deb12u1" ,
530530 },
531531 }},
532532 },
@@ -546,11 +546,11 @@ func getDockerScanTestResults(unique bool) (*results.SecurityCommandResults, val
546546 {ComponentId : "docker://platform.jfrog.io/swamp-docker/swamp:latest" },
547547 {
548548 ComponentId : "generic://sha256:f21c087a3964a446bce1aa4e3ec7cf82020dd77ad14f1cf4ea49cbb32eda1595/sha256__f21c087a3964a446bce1aa4e3ec7cf82020dd77ad14f1cf4ea49cbb32eda1595.tar" ,
549- FullPath : "sha256__f21c087a3964a446bce1aa4e3ec7cf82020dd77ad14f1cf4ea49cbb32eda1595.tar" ,
549+ FullPath : "sha256__f21c087a3964a446bce1aa4e3ec7cf82020dd77ad14f1cf4ea49cbb32eda1595.tar" ,
550550 },
551551 {
552552 ComponentId : "deb://debian:bookworm:libssl3:3.0.13-1~deb12u1" ,
553- FullPath : "libssl3:3.0.13-1~deb12u1" ,
553+ FullPath : "libssl3:3.0.13-1~deb12u1" ,
554554 },
555555 }},
556556 },
@@ -559,11 +559,11 @@ func getDockerScanTestResults(unique bool) (*results.SecurityCommandResults, val
559559 {ComponentId : "docker://platform.jfrog.io/swamp-docker/swamp:latest" },
560560 {
561561 ComponentId : "generic://sha256:f21c087a3964a446bce1aa4e3ec7cf82020dd77ad14f1cf4ea49cbb32eda1595/sha256__f21c087a3964a446bce1aa4e3ec7cf82020dd77ad14f1cf4ea49cbb32eda1595.tar" ,
562- FullPath : "sha256__f21c087a3964a446bce1aa4e3ec7cf82020dd77ad14f1cf4ea49cbb32eda1595.tar" ,
562+ FullPath : "sha256__f21c087a3964a446bce1aa4e3ec7cf82020dd77ad14f1cf4ea49cbb32eda1595.tar" ,
563563 },
564564 {
565565 ComponentId : "deb://debian:bookworm:openssl:3.0.13-1~deb12u1" ,
566- FullPath : "openssl:3.0.13-1~deb12u1" ,
566+ FullPath : "openssl:3.0.13-1~deb12u1" ,
567567 },
568568 }},
569569 FixedVersions : []string {"[3.0.14-1~deb12u2]" },
@@ -575,7 +575,7 @@ func getDockerScanTestResults(unique bool) (*results.SecurityCommandResults, val
575575 },
576576 Violations : []services.Violation {
577577 {
578- ViolationType : utils .ViolationTypeSecurity .String (),
578+ ViolationType : utils .ViolationTypeSecurity .String (),
579579 Cves : []services.Cve {{
580580 Id : "CVE-2024-6119" ,
581581 }},
@@ -587,19 +587,19 @@ func getDockerScanTestResults(unique bool) (*results.SecurityCommandResults, val
587587 {ComponentId : "docker://platform.jfrog.io/swamp-docker/swamp:latest" },
588588 {
589589 ComponentId : "generic://sha256:f21c087a3964a446bce1aa4e3ec7cf82020dd77ad14f1cf4ea49cbb32eda1595/sha256__f21c087a3964a446bce1aa4e3ec7cf82020dd77ad14f1cf4ea49cbb32eda1595.tar" ,
590- FullPath : "sha256__f21c087a3964a446bce1aa4e3ec7cf82020dd77ad14f1cf4ea49cbb32eda1595.tar" ,
590+ FullPath : "sha256__f21c087a3964a446bce1aa4e3ec7cf82020dd77ad14f1cf4ea49cbb32eda1595.tar" ,
591591 },
592592 {
593593 ComponentId : "deb://debian:bookworm:libssl3:3.0.13-1~deb12u1" ,
594- FullPath : "libssl3:3.0.13-1~deb12u1" ,
594+ FullPath : "libssl3:3.0.13-1~deb12u1" ,
595595 },
596596 }},
597597 },
598598 },
599599 IssueId : "XRAY-632747" ,
600600 ExtendedInformation : & services.ExtendedInformation {JfrogResearchSeverity : "Medium" },
601- WatchName : "security-watch" ,
602- Policies : []services.Policy {{Policy : "debian-security" }},
601+ WatchName : "security-watch" ,
602+ Policies : []services.Policy {{Policy : "debian-security" }},
603603 },
604604 },
605605 ScannedStatus : "completed" ,
@@ -614,7 +614,7 @@ func getDockerScanTestResults(unique bool) (*results.SecurityCommandResults, val
614614 ),
615615 },
616616 Invocations : []* sarif.Invocation {sarif .NewInvocation ().WithWorkingDirectory (sarif .NewSimpleArtifactLocation ("temp/folders/T/jfrog.cli.temp.-11-11" ))},
617- Results : []* sarif.Result {validations .CreateDummyApplicableResults ("CVE-2024-6119" , formats.Location {File : "file:///usr/local/bin/node" })},
617+ Results : []* sarif.Result {validations .CreateDummyApplicableResults ("CVE-2024-6119" , formats.Location {File : "file:///usr/local/bin/node" })},
618618 },
619619 )
620620 // Secrets scan results
0 commit comments