snyk 1.1016.0 → 1.1017.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.
@@ -2270,7 +2270,6 @@ const keys = [
2270
2270
  'json-file-output',
2271
2271
  'sarif-file-output',
2272
2272
  'scan',
2273
- 'experimental',
2274
2273
  'var-file',
2275
2274
  'detectionDepth',
2276
2275
  'cloud-context',
@@ -2351,10 +2350,15 @@ const scan_1 = __webpack_require__(50277);
2351
2350
  const index_1 = __webpack_require__(55935);
2352
2351
  const policy_1 = __webpack_require__(32615);
2353
2352
  const assert_iac_options_1 = __webpack_require__(15335);
2353
+ const unsupported_entitlement_error_1 = __webpack_require__(78673);
2354
2354
  async function test(paths, options) {
2355
+ var _a;
2355
2356
  assert_iac_options_1.assertIacV2Options(options);
2356
2357
  const testConfig = await prepareTestConfig(paths, options);
2357
2358
  const { orgSettings } = testConfig;
2359
+ if (!((_a = orgSettings.entitlements) === null || _a === void 0 ? void 0 : _a.infrastructureAsCode)) {
2360
+ throw new unsupported_entitlement_error_1.UnsupportedEntitlementError('infrastructureAsCode');
2361
+ }
2358
2362
  const testSpinner = output_1.buildSpinner(options);
2359
2363
  output_1.printHeader(options);
2360
2364
  testSpinner === null || testSpinner === void 0 ? void 0 : testSpinner.start(text_1.spinnerMessage);
@@ -2457,8 +2461,7 @@ async function test(...args) {
2457
2461
  const options = set_default_test_options_1.setDefaultTestOptions(originalOptions);
2458
2462
  if (originalOptions.iac) {
2459
2463
  // temporary placeholder for the "new" flow that integrates with UPE
2460
- if ((await feature_flags_1.hasFeatureFlag('iacCliUnifiedEngine', options)) &&
2461
- options.experimental) {
2464
+ if (await feature_flags_1.hasFeatureFlag('iacIntegratedExperience', options)) {
2462
2465
  return await iacTestCommandV2.test(paths, originalOptions);
2463
2466
  }
2464
2467
  else {
@@ -4408,31 +4411,36 @@ function getVulnerabilityAnalyticsByPackageManager(testOutput) {
4408
4411
  "use strict";
4409
4412
 
4410
4413
  Object.defineProperty(exports, "__esModule", ({ value: true }));
4411
- exports.computeIacAnalytics = exports.addIacAnalytics = void 0;
4412
- const createDebugLogger = __webpack_require__(15158);
4414
+ exports.addIacAnalytics = void 0;
4413
4415
  const constants_1 = __webpack_require__(64895);
4416
+ const analytics = __webpack_require__(82744);
4414
4417
  const iac_type_1 = __webpack_require__(55098);
4415
- const debugLog = createDebugLogger('snyk-iac');
4416
4418
  function addIacAnalytics(testOutput) {
4417
4419
  const iacAnalytics = computeIacAnalytics(testOutput);
4418
- debugLog(iacAnalytics);
4420
+ analytics.add('iac-type', iacAnalytics.iacType);
4421
+ analytics.add('packageManager', iacAnalytics.packageManager);
4422
+ analytics.add('iac-issues-count', iacAnalytics.iacIssuesCount);
4423
+ analytics.add('iac-ignored-issues-count', iacAnalytics.iacIgnoredIssuesCount);
4424
+ analytics.add('iac-files-count', iacAnalytics.iacFilesCount);
4425
+ analytics.add('iac-resources-count', iacAnalytics.iacResourcesCount);
4426
+ analytics.add('iac-error-codes', iacAnalytics.iacErrorCodes);
4427
+ analytics.add('iac-test-binary-version', iacAnalytics.iacTestBinaryVersion);
4419
4428
  }
4420
4429
  exports.addIacAnalytics = addIacAnalytics;
4421
4430
  function computeIacAnalytics(testOutput) {
4422
4431
  var _a, _b, _c, _d, _e, _f;
4423
4432
  const iacType = iac_type_1.getIacType(testOutput);
4424
4433
  return {
4425
- 'iac-type': iacType,
4434
+ iacType,
4426
4435
  packageManager: Object.keys(iacType),
4427
- 'iac-issues-count': ((_b = (_a = testOutput.results) === null || _a === void 0 ? void 0 : _a.vulnerabilities) === null || _b === void 0 ? void 0 : _b.length) || 0,
4428
- 'iac-ignored-issues-count': ((_c = testOutput.results) === null || _c === void 0 ? void 0 : _c.scanAnalytics.ignoredCount) || 0,
4429
- 'iac-files-count': Object.values(iacType).reduce((acc, packageManagerAnalytics) => acc + packageManagerAnalytics.count, 0),
4430
- 'iac-resources-count': ((_e = (_d = testOutput.results) === null || _d === void 0 ? void 0 : _d.resources) === null || _e === void 0 ? void 0 : _e.length) || 0,
4431
- 'iac-error-codes': [...new Set((_f = testOutput.errors) === null || _f === void 0 ? void 0 : _f.map((error) => error.code))] || [],
4432
- 'iac-test-binary-version': constants_1.policyEngineReleaseVersion,
4436
+ iacIssuesCount: ((_b = (_a = testOutput.results) === null || _a === void 0 ? void 0 : _a.vulnerabilities) === null || _b === void 0 ? void 0 : _b.length) || 0,
4437
+ iacIgnoredIssuesCount: ((_c = testOutput.results) === null || _c === void 0 ? void 0 : _c.scanAnalytics.ignoredCount) || 0,
4438
+ iacFilesCount: Object.values(iacType).reduce((acc, packageManagerAnalytics) => acc + packageManagerAnalytics.count, 0),
4439
+ iacResourcesCount: ((_e = (_d = testOutput.results) === null || _d === void 0 ? void 0 : _d.resources) === null || _e === void 0 ? void 0 : _e.length) || 0,
4440
+ iacErrorCodes: [...new Set((_f = testOutput.errors) === null || _f === void 0 ? void 0 : _f.map((error) => error.code))] || [],
4441
+ iacTestBinaryVersion: constants_1.policyEngineReleaseVersion,
4433
4442
  };
4434
4443
  }
4435
- exports.computeIacAnalytics = computeIacAnalytics;
4436
4444
 
4437
4445
 
4438
4446
  /***/ }),