snyk 1.1043.0 → 1.1045.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/784.index.js +22 -7
- package/dist/cli/784.index.js.map +1 -1
- package/dist/cli/895.index.js +1 -1
- package/dist/cli/895.index.js.map +1 -1
- package/dist/cli/917.index.js +26 -11
- package/dist/cli/917.index.js.map +1 -1
- package/dist/cli/index.js +15 -1
- package/dist/cli/index.js.map +1 -1
- package/dist/lib/errors/failed-to-run-test-error.d.ts +2 -1
- package/package.json +3 -2
package/dist/cli/784.index.js
CHANGED
|
@@ -68,6 +68,7 @@ const is_multi_project_scan_1 = __webpack_require__(62435);
|
|
|
68
68
|
const ecosystems_1 = __webpack_require__(5168);
|
|
69
69
|
const monitor_2 = __webpack_require__(62406);
|
|
70
70
|
const process_command_args_1 = __webpack_require__(52369);
|
|
71
|
+
const feature_flags_1 = __webpack_require__(63011);
|
|
71
72
|
const SEPARATOR = '\n-------------------------------------------------------\n';
|
|
72
73
|
const debug = Debug('snyk');
|
|
73
74
|
const appVulnsReleaseWarningMsg = `${theme.icon.WARNING} Important: Beginning January 24th, 2023, application dependencies in container
|
|
@@ -104,13 +105,27 @@ async function monitor(...args0) {
|
|
|
104
105
|
// TODO remove 'app-vulns' options and warning message once
|
|
105
106
|
// https://github.com/snyk/cli/pull/3433 is merged
|
|
106
107
|
if (options.docker) {
|
|
107
|
-
|
|
108
|
+
// order is important here, we want:
|
|
109
|
+
// 1) exclude-app-vulns set -> no app vulns
|
|
110
|
+
// 2) app-vulns set -> app-vulns
|
|
111
|
+
// 3) neither set -> containerAppVulnsEnabled
|
|
112
|
+
if (options['exclude-app-vulns']) {
|
|
108
113
|
options['exclude-app-vulns'] = true;
|
|
109
114
|
}
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
115
|
+
else if (options['app-vulns']) {
|
|
116
|
+
options['exclude-app-vulns'] = false;
|
|
117
|
+
}
|
|
118
|
+
else {
|
|
119
|
+
options['exclude-app-vulns'] = !(await feature_flags_1.hasFeatureFlag('containerCliAppVulnsEnabled', options));
|
|
120
|
+
// we can't print the warning message with JSON output as that would make
|
|
121
|
+
// the JSON output invalid.
|
|
122
|
+
// We also only want to print the message if the user did not overwrite
|
|
123
|
+
// the default with one of the flags.
|
|
124
|
+
if (options['exclude-app-vulns'] &&
|
|
125
|
+
!options['json'] &&
|
|
126
|
+
!options['sarif']) {
|
|
127
|
+
console.log(theme.color.status.warn(appVulnsReleaseWarningMsg));
|
|
128
|
+
}
|
|
114
129
|
}
|
|
115
130
|
}
|
|
116
131
|
// Handles no image arg provided to the container command until
|
|
@@ -6017,7 +6032,7 @@ async function runTest(projectType, root, options) {
|
|
|
6017
6032
|
}
|
|
6018
6033
|
throw new errors_1.FailedToRunTestError(error.userMessage ||
|
|
6019
6034
|
error.message ||
|
|
6020
|
-
`Failed to test ${projectType} project`, error.code);
|
|
6035
|
+
`Failed to test ${projectType} project`, error.code, error.innerError);
|
|
6021
6036
|
}
|
|
6022
6037
|
finally {
|
|
6023
6038
|
spinner_1.spinner.clear(spinnerLbl)();
|
|
@@ -6116,7 +6131,7 @@ function handleTestHttpErrorResponse(res, body) {
|
|
|
6116
6131
|
case 401:
|
|
6117
6132
|
case 403:
|
|
6118
6133
|
err = errors_1.AuthFailedError(userMessage, statusCode);
|
|
6119
|
-
err.innerError = body.stack;
|
|
6134
|
+
err.innerError = body.stack || body;
|
|
6120
6135
|
break;
|
|
6121
6136
|
case 404:
|
|
6122
6137
|
err = new errors_1.NotFoundError(userMessage);
|