Skip to content
This repository was archived by the owner on Oct 14, 2020. It is now read-only.

Commit eb58fdc

Browse files
committed
Update Finding object type in parser
1 parent 1b1f780 commit eb58fdc

File tree

1 file changed

+9
-8
lines changed

1 file changed

+9
-8
lines changed

parser-sdk/nodejs/parser-wrapper.js

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -35,20 +35,21 @@ async function updateScanStatus(findings) {
3535
scanName,
3636
{
3737
status: {
38-
findingCount: findings.length,
39-
findingSeverities: {
40-
informationalCount: severityCount(findings, 'INFORMATIONAL'),
41-
lowCount: severityCount(findings, 'LOW'),
42-
mediumCount: severityCount(findings, 'MEDIUM'),
43-
highCount: severityCount(findings, 'HIGH'),
38+
findings: {
39+
count: findings.length,
40+
severities: {
41+
informational: severityCount(findings, 'INFORMATIONAL'),
42+
low: severityCount(findings, 'LOW'),
43+
medium: severityCount(findings, 'MEDIUM'),
44+
high: severityCount(findings, 'HIGH'),
45+
},
46+
categories: Object.fromEntries(findingCategories.entries()),
4447
},
45-
findingCategories: Object.fromEntries(findingCategories.entries()),
4648
},
4749
},
4850
{ headers: { 'content-type': 'application/merge-patch+json' } }
4951
);
5052
console.log('Updated status successfully');
51-
// console.log(res);
5253
} catch (err) {
5354
console.error('Failed to update Scan Status via the kubernetes api');
5455
console.error(err);

0 commit comments

Comments
 (0)