snyk 1.927.0 → 1.928.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli/935.index.js +0 -32
- package/dist/cli/935.index.js.map +1 -1
- package/package.json +1 -1
package/dist/cli/935.index.js
CHANGED
|
@@ -60,7 +60,6 @@ const formatters_1 = __webpack_require__(81329);
|
|
|
60
60
|
const utils = __webpack_require__(77978);
|
|
61
61
|
const iac_output_1 = __webpack_require__(68145);
|
|
62
62
|
const ecosystems_1 = __webpack_require__(5168);
|
|
63
|
-
const vuln_helpers_1 = __webpack_require__(14784);
|
|
64
63
|
const format_test_results_1 = __webpack_require__(59744);
|
|
65
64
|
const local_execution_1 = __webpack_require__(89627);
|
|
66
65
|
const validate_credentials_1 = __webpack_require__(4593);
|
|
@@ -207,13 +206,6 @@ async function default_1(isReportCommand, ...args) {
|
|
|
207
206
|
}
|
|
208
207
|
const err = new Error(stringifiedData);
|
|
209
208
|
if (foundVulnerabilities) {
|
|
210
|
-
if (options.failOn) {
|
|
211
|
-
const fail = shouldFail(vulnerableResults, options.failOn);
|
|
212
|
-
if (!fail) {
|
|
213
|
-
// return here to prevent failure
|
|
214
|
-
return types_1.TestCommandResult.createJsonTestCommandResult(stringifiedData, stringifiedJsonData, stringifiedSarifData);
|
|
215
|
-
}
|
|
216
|
-
}
|
|
217
209
|
err.code = 'VULNS';
|
|
218
210
|
const dataToSendNoVulns = dataToSend;
|
|
219
211
|
delete dataToSendNoVulns.vulnerabilities;
|
|
@@ -297,16 +289,6 @@ async function default_1(isReportCommand, ...args) {
|
|
|
297
289
|
throw error;
|
|
298
290
|
}
|
|
299
291
|
if (foundVulnerabilities) {
|
|
300
|
-
if (options.failOn) {
|
|
301
|
-
const fail = shouldFail(vulnerableResults, options.failOn);
|
|
302
|
-
if (!fail) {
|
|
303
|
-
// return here to prevent throwing failure
|
|
304
|
-
response += chalk_1.default.bold.green(summaryMessage);
|
|
305
|
-
response += os_1.EOL + os_1.EOL;
|
|
306
|
-
response += protect_update_notification_1.getProtectUpgradeWarningForPaths(packageJsonPathsWithSnykDepForProtect);
|
|
307
|
-
return types_1.TestCommandResult.createHumanReadableTestCommandResult(response, stringifiedJsonData, stringifiedSarifData);
|
|
308
|
-
}
|
|
309
|
-
}
|
|
310
292
|
response += chalk_1.default.bold.red(summaryMessage);
|
|
311
293
|
response += os_1.EOL + os_1.EOL;
|
|
312
294
|
const foundSpotlightVulnIds = spotlight_vuln_notification_1.containsSpotlightVulnIds(results);
|
|
@@ -345,20 +327,6 @@ async function default_1(isReportCommand, ...args) {
|
|
|
345
327
|
return types_1.TestCommandResult.createHumanReadableTestCommandResult(response, stringifiedJsonData, stringifiedSarifData);
|
|
346
328
|
}
|
|
347
329
|
exports.default = default_1;
|
|
348
|
-
function shouldFail(vulnerableResults, failOn) {
|
|
349
|
-
// find reasons not to fail
|
|
350
|
-
if (failOn === 'all') {
|
|
351
|
-
return vuln_helpers_1.hasFixes(vulnerableResults);
|
|
352
|
-
}
|
|
353
|
-
if (failOn === 'upgradable') {
|
|
354
|
-
return vuln_helpers_1.hasUpgrades(vulnerableResults);
|
|
355
|
-
}
|
|
356
|
-
if (failOn === 'patchable') {
|
|
357
|
-
return vuln_helpers_1.hasPatches(vulnerableResults);
|
|
358
|
-
}
|
|
359
|
-
// should fail by default when there are vulnerable results
|
|
360
|
-
return vulnerableResults.length > 0;
|
|
361
|
-
}
|
|
362
330
|
|
|
363
331
|
|
|
364
332
|
/***/ }),
|