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.
@@ -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
- if (!options['app-vulns'] || options['exclude-app-vulns']) {
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
- // we can't print the warning message with JSON output as that would make
111
- // the JSON output invalid.
112
- if (!options['app-vulns'] && !options['json']) {
113
- console.log(theme.color.status.warn(appVulnsReleaseWarningMsg));
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);