File tree Expand file tree Collapse file tree 4 files changed +10
-8
lines changed Expand file tree Collapse file tree 4 files changed +10
-8
lines changed Original file line number Diff line number Diff line change 1
- import { CxManifestStatus } from './CxManifestStatus ' ;
1
+ import { CxRealtimeEngineStatus } from './CxRealtimeEngineStatus ' ;
2
2
3
3
export interface Location {
4
4
line : number ;
@@ -12,7 +12,7 @@ export default class CxOssResult {
12
12
version : string ;
13
13
filepath : string ;
14
14
locations : Location [ ] ;
15
- status : CxManifestStatus ;
15
+ status : CxRealtimeEngineStatus ;
16
16
vulnerabilities : { cve : string , description : string , severity : string } [ ] ;
17
17
18
18
static parseResult ( resultObject : any ) : CxOssResult [ ] {
@@ -32,7 +32,7 @@ export default class CxOssResult {
32
32
endIndex : loc . EndIndex
33
33
} ) )
34
34
: [ ] ;
35
- ossResult . status = member . Status as CxManifestStatus ;
35
+ ossResult . status = member . Status as CxRealtimeEngineStatus ;
36
36
ossResult . vulnerabilities = Array . isArray ( member . Vulnerabilities )
37
37
? member . Vulnerabilities . map ( ( vul : any ) => ( {
38
38
cve : vul . CVE ,
@@ -55,7 +55,7 @@ export default class CxOssResult {
55
55
endIndex : loc . EndIndex
56
56
} ) )
57
57
: [ ] ;
58
- ossResult . status = packages . Status as CxManifestStatus ;
58
+ ossResult . status = packages . Status as CxRealtimeEngineStatus ;
59
59
ossResult . vulnerabilities = Array . isArray ( packages . Vulnerabilities )
60
60
? packages . Vulnerabilities . map ( ( vul : any ) => ( {
61
61
cve : vul . CVE ,
Original file line number Diff line number Diff line change 1
- export enum CxManifestStatus {
1
+ export enum CxRealtimeEngineStatus {
2
2
malicious = "Malicious" ,
3
3
ok = "OK" ,
4
4
unknown = "Unknown" ,
Original file line number Diff line number Diff line change
1
+ import { CxRealtimeEngineStatus } from "../oss/CxRealtimeEngineStatus" ;
2
+
1
3
export default class CxSecretsResult {
2
4
title : string ;
3
5
description : string ;
4
6
filepath : string ;
5
- severity : string ;
7
+ severity : CxRealtimeEngineStatus ;
6
8
locations : { line : number , startIndex : number , endIndex : number } [ ] ;
7
9
8
10
static parseResult ( resultObject : any ) : CxSecretsResult [ ] {
@@ -13,7 +15,7 @@ export default class CxSecretsResult {
13
15
secretsResult . title = member . Title ;
14
16
secretsResult . description = member . Description ;
15
17
secretsResult . filepath = member . FilePath ;
16
- secretsResult . severity = member . Severity ;
18
+ secretsResult . severity = member . Severity as CxRealtimeEngineStatus ;
17
19
secretsResult . locations = Array . isArray ( member . Locations )
18
20
? member . Locations . map ( ( l : any ) => ( {
19
21
line : l . Line ,
Original file line number Diff line number Diff line change @@ -184,7 +184,7 @@ describe("ScanCreate cases", () => {
184
184
185
185
it . skip ( 'ScanSecrets Successful case' , async ( ) => {
186
186
const wrapper = new CxWrapper ( cxScanConfig ) ;
187
- const cxCommandOutput : CxCommandOutput = await wrapper . secretsScanResults ( "tsc /tests/data/secret-exposed.txt" ) ;
187
+ const cxCommandOutput : CxCommandOutput = await wrapper . secretsScanResults ( "src /tests/data/secret-exposed.txt" ) ;
188
188
console . log ( "Json object from scanOSS successful case: " + JSON . stringify ( cxCommandOutput ) ) ;
189
189
expect ( cxCommandOutput . payload ) . toBeDefined ( ) ;
190
190
expect ( cxCommandOutput . exitCode ) . toBe ( 0 ) ;
You can’t perform that action at this time.
0 commit comments