Skip to content

Commit 84a81aa

Browse files
Update checkmarx-ast-cli to 2.3.65 (#223)
1 parent 594ed39 commit 84a81aa

6 files changed

Lines changed: 47 additions & 34 deletions

File tree

.github/workflows/ci.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@ jobs:
7272
CX_CLIENT_ID: ${{ secrets.CX_CLIENT_ID}}
7373
CX_CLIENT_SECRET: ${{ secrets.CX_CLIENT_SECRET}}
7474
CX_BASE_URI: ${{ secrets.CX_BASE_URI }}
75+
CX_BASE_AUTH_URI: ${{ secrets.CX_BASE_AUTH_URI }}
7576
CX_TENANT: ${{ secrets.CX_TENANT }}
7677
CX_APIKEY: ${{ secrets.CX_APIKEY }}
7778
run: npm test

checkmarx-ast-cli.checksums

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
2-
"windows_x64": "210d85d34d29fad7b8e9932aafac5d65303a2f1af8b15dc4c29f03a85cdfa248",
3-
"darwin_x64": "4492e953be85c342004f8d8a27440d31c0d6d11b37ecd0bbd3db5c614ce625d1",
4-
"linux_x64": "ac974d10aab9843f6035f0d82ee4184b4311916930e682f3a7ef28c87e7ee547",
5-
"linux_arm64": "254888d1a3eae8e188143cf1a15f5cc333a368811c35432ca3ffbf43f6398553",
6-
"linux_armv6": "bfae583968e4d76fdc48630d28c06aaea62d15c29e9dfcd443e3d384d8fc9d00"
2+
"windows_x64": "8bca820b5acd09e6846c43d4840bcedf2f4696958d8c19ff76722fd92e6249bc",
3+
"darwin_x64": "3f956fd60e6fce5db5d9492b39df3510bad6171bb0d917d49b988d292c6cfeab",
4+
"linux_x64": "311f67b21cd0f7c65f10439cc3a3517e8f8457f2fcac3340dd92f9cf07a73789",
5+
"linux_arm64": "456fec50d0627eef730af4d13731785a8d7e242875bab8d09a717d8efd821180",
6+
"linux_armv6": "2b99853303b53459bacec055dd34956c82ea0ff8a528438b4f3457ef1d9ae384"
77
}

checkmarx-ast-cli.version

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
2.3.60
1+
2.3.65

package-lock.json

Lines changed: 9 additions & 9 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@Checkmarx/ast-cli-javascript-wrapper-runtime-cli",
3-
"version": "1.0.40",
3+
"version": "1.0.41",
44
"description": "AST CLI Javascript wrapper runtime CLI",
55
"main": "dist/main/wrapper/CxWrapper.js",
66
"typings": "dist/main/wrapper/CxWrapper.d.ts",
@@ -56,6 +56,7 @@
5656
"typescript": "^5.6.3"
5757
},
5858
"overrides": {
59+
"adm-zip": "0.6.1",
5960
"bluebird": "3.7.2",
6061
"browserslist": "4.28.7",
6162
"flatted": "^3.4.2",
@@ -65,6 +66,7 @@
6566
"underscore": "^1.13.8",
6667
"picomatch": "^2.3.2",
6768
"brace-expansion": "^2.1.4",
69+
"qs": "6.16.0",
6870
"uuid": "^3.3.2"
6971

7072
},

src/tests/PredicateTest.test.ts

Lines changed: 28 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -9,35 +9,45 @@ const cxWrapperFactory = new CxWrapperFactory();
99
describe("Triage cases", () => {
1010
const cxScanConfig = new BaseTest();
1111

12-
it('Triage Successful case', async () => {
13-
const auth = await cxWrapperFactory.createWrapper(cxScanConfig);
14-
12+
const getScanAndResult = async (auth: any): Promise<{ scan: any, result: CxResult }> => {
1513
const scanList: CxCommandOutput = await auth.scanList("statuses=Completed,limit=100");
16-
let result: CxResult;
17-
let scan, output;
18-
while (!output && scanList && scanList.payload && scanList.payload.length > 0) {
19-
scan = scanList.payload.pop()
20-
console.log("Triage Successful case - ScanId " + scan.id)
21-
output = await auth.getResultsList(scan.id)
22-
if (output.status == "Error in the json file.") {
14+
let scan, output, result;
15+
16+
while (!output && scanList?.payload?.length > 0) {
17+
scan = scanList.payload.pop();
18+
output = await auth.getResultsList(scan.id);
19+
if (output?.status === "Error in the json file.") {
2320
output = undefined;
2421
} else {
25-
result = output.payload.find(res => res.type == CxConstants.SAST)
26-
if (!result || !result.similarityId) {
22+
result = output?.payload?.find((res: CxResult) => res.type === CxConstants.SAST);
23+
if (!result?.similarityId) {
2724
output = undefined;
2825
}
2926
}
3027
}
3128

32-
const cxShow: CxCommandOutput = await auth.triageShow(scan.projectID, result.similarityId, result.type);
29+
if (!scan) {
30+
const scanShow = await auth.scanShow("d4354650-4ee1-4e10-9b1d-0feaf6c187a7");
31+
scan = scanShow?.payload?.pop();
32+
output = await auth.getResultsList(scan.id);
33+
result = output?.payload?.find((res: CxResult) => res.type === CxConstants.SAST);
34+
}
3335

34-
expect(cxShow.exitCode).toEqual(0);
36+
return { scan, result };
37+
};
38+
39+
it('Triage Successful case', async () => {
40+
const auth = await cxWrapperFactory.createWrapper(cxScanConfig);
41+
const { scan, result } = await getScanAndResult(auth);
3542

36-
const cxUpdate: CxCommandOutput = await
37-
auth.triageUpdate(scan.projectID, result.similarityId, result.type, result.state,
38-
"Edited via JavascriptWrapper",
39-
result.severity.toLowerCase() == "high" ? CxConstants.SEVERITY_MEDIUM : CxConstants.SEVERITY_HIGH);
43+
const cxShow: CxCommandOutput = await auth.triageShow(scan.projectID, result.similarityId, result.type);
44+
expect(cxShow.exitCode).toEqual(0);
4045

46+
const cxUpdate: CxCommandOutput = await auth.triageUpdate(
47+
scan.projectID, result.similarityId, result.type, result.state,
48+
"Edited via JavascriptWrapper",
49+
result.severity.toLowerCase() === "high" ? CxConstants.SEVERITY_MEDIUM : CxConstants.SEVERITY_HIGH
50+
);
4151
expect(cxUpdate.exitCode).toEqual(0);
4252
});
4353
});

0 commit comments

Comments
 (0)