snyk 1.1255.0 → 1.1256.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.
@@ -2,4 +2,6 @@ export declare const EXIT_CODES: {
2
2
  VULNS_FOUND: number;
3
3
  ERROR: number;
4
4
  NO_SUPPORTED_PROJECTS_DETECTED: number;
5
+ EX_UNAVAILABLE: number;
6
+ EX_NOPERM: number;
5
7
  };
package/dist/cli/index.js CHANGED
@@ -38811,6 +38811,8 @@ exports.EXIT_CODES = {
38811
38811
  VULNS_FOUND: 1,
38812
38812
  ERROR: 2,
38813
38813
  NO_SUPPORTED_PROJECTS_DETECTED: 3,
38814
+ EX_UNAVAILABLE: 69,
38815
+ EX_NOPERM: 77,
38814
38816
  };
38815
38817
 
38816
38818
 
@@ -38918,6 +38920,15 @@ async function handleError(args, error) {
38918
38920
  }
38919
38921
  let command = 'bad-command';
38920
38922
  let exitCode = exit_codes_1.EXIT_CODES.ERROR;
38923
+ // If Snyk CLI is running in CI mode (SNYK_CI=1), differentiate authorization
38924
+ if (process.env.SNYK_CI === '1') {
38925
+ if (error.code === 401 || error.code === 403) {
38926
+ exitCode = exit_codes_1.EXIT_CODES.EX_NOPERM;
38927
+ }
38928
+ else if (error.code >= 400 && error.code < 500) {
38929
+ exitCode = exit_codes_1.EXIT_CODES.EX_UNAVAILABLE;
38930
+ }
38931
+ }
38921
38932
  const vulnsFound = error.code === 'VULNS';
38922
38933
  if (args.command === 'test' && ((_a = args.options) === null || _a === void 0 ? void 0 : _a.unmanaged)) {
38923
38934
  exitCode = vulnsFound ? exit_codes_1.EXIT_CODES.VULNS_FOUND : error.code;