From cc329fdda6b6853afca5483a7a0e562ab50ad54d Mon Sep 17 00:00:00 2001 From: Daniel Ekelund Date: Fri, 18 Nov 2022 16:13:31 +0100 Subject: [PATCH] feat: support sev.threshold for unm.-deps --- src/lib/ecosystems/resolve-test-facts.ts | 5 +++++ src/lib/ecosystems/unmanaged/types.ts | 1 + 2 files changed, 6 insertions(+) diff --git a/src/lib/ecosystems/resolve-test-facts.ts b/src/lib/ecosystems/resolve-test-facts.ts index 558311d3fe..6979d1a8d3 100644 --- a/src/lib/ecosystems/resolve-test-facts.ts +++ b/src/lib/ecosystems/resolve-test-facts.ts @@ -31,6 +31,7 @@ import { getSelf, } from './unmanaged/utils'; import { sleep } from '../common'; +import { SEVERITY } from '../snyk-test/common'; export async function resolveAndTestFacts( ecosystem: Ecosystem, @@ -91,6 +92,7 @@ async function fetchIssues( start_time, dep_graph_data, component_details, + target_severity: SEVERITY, orgId: string, ) { const response: GetIssuesResponse = await getIssues( @@ -98,6 +100,7 @@ async function fetchIssues( dep_graph: dep_graph_data, start_time, component_details, + target_severity, }, orgId, ); @@ -148,6 +151,7 @@ export async function resolveAndTestFactsUnmanagedDeps( const displayTargetFile = ''; let orgId = options.org || ''; + const target_severity: SEVERITY = options.severityThreshold || SEVERITY.LOW; if (orgId === '') { const self = await getSelf(); @@ -181,6 +185,7 @@ export async function resolveAndTestFactsUnmanagedDeps( start_time, dep_graph_data, component_details, + target_severity, orgId, ); diff --git a/src/lib/ecosystems/unmanaged/types.ts b/src/lib/ecosystems/unmanaged/types.ts index 781b1d3ea1..5cea207ce5 100644 --- a/src/lib/ecosystems/unmanaged/types.ts +++ b/src/lib/ecosystems/unmanaged/types.ts @@ -163,6 +163,7 @@ export interface IssuesRequestAttributes { start_time: number; dep_graph: IssuesRequestDepGraphDataOpenAPI; component_details: IssuesRequestComponentDetails; + target_severity: SEVERITY; } export interface Data {