Skip to content

Commit

Permalink
feat: skip the license details
Browse files Browse the repository at this point in the history
  • Loading branch information
mathild3r committed May 27, 2021
1 parent 0e30b5b commit 1884886
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 61 deletions.
6 changes: 3 additions & 3 deletions src/lib/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ export function convertSnykTestOutputToSPDX(data: SnykTestOutput): SPDXv3 {
documentNamespace: generateDocumentNameSpace(outputFileName),
description: `Snyk test result for project ${data.projectName} in SPDX SBOM format`,
created: Date.now().toString(),
vulnerabilities: data.vulnerabilities.map((i: SnykIssue) =>
convertSnykIssueToSpdx(i),
),
vulnerabilities: data.vulnerabilities
.filter((i: SnykIssue) => i.type == undefined)
.map((i: SnykIssue) => convertSnykIssueToSpdx(i)),
};
}
1 change: 1 addition & 0 deletions src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,7 @@ export interface SnykIssue {
references: SnykIssueReference[];
creationTime: string;
identifiers: SnykIssueIdentifiers;
type : string | undefined;
}

export interface SnykIssueSemver {
Expand Down
53 changes: 0 additions & 53 deletions test/lib/__snapshots__/index.spec.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -1068,58 +1068,5 @@ Upgrade \`jinja2\` to version 2.8.1 or higher.
],
"summary": "Sandbox Bypass",
},
Object {
"details": "MIT license",
"externalReferences": Array [
Object {
"externalReferencesRelationships": Array [],
"modified": undefined,
"published": "2021-05-23T11:15:36.845Z",
"withdrawn": undefined,
},
],
"id": "snyk:lic:pip:pytz:MIT",
"name": "snyk:lic:pip:pytz:MIT",
"relationships": Array [
Object {
"affect": Object {
"to": Array [
"[email protected]",
"[email protected]",
"[email protected]",
],
"type": "AFFECTS",
},
"foundBy": Object {
"to": undefined,
"type": "FOUND_BY",
},
"ratedBy": Object {
"cwes": Array [],
"rating": Array [
Object {
"method": "undefined",
"score": Array [
Object {
"base": undefined,
"exploitability": undefined,
"impact": "[2005a,)",
},
],
"severity": "high",
"vector": undefined,
},
],
"to": undefined,
"type": "RATED_BY",
},
"suppliedBy": Object {
"to": undefined,
"type": "SUPPLIED_BY",
},
},
],
"summary": "MIT license",
},
]
`;
8 changes: 3 additions & 5 deletions test/lib/index.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,10 +71,8 @@ describe('convertSnykTestOutputToSPDX', () => {
});
expect(res.vulnerabilities.sort()).toMatchSnapshot();
// TODO: comment out once functionality in place
// expect(
// (res.vulnerabilities as any).find(
// (i: any) => i.id === 'snyk:lic:pip:pytz:MIT',
// ),
// ).toEqual([]);
expect(
res.vulnerabilities.find((i) => i.id === 'snyk:lic:pip:pytz:MIT'),
).toEqual(undefined);
});
});

0 comments on commit 1884886

Please sign in to comment.