snyk 1.1228.0 → 1.1229.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.
@@ -5656,14 +5656,18 @@ async function scan(options, policyEnginePath, rulesBundlePath, rulesClientURL)
5656
5656
  exports.scan = scan;
5657
5657
  async function scanWithConfig(options, policyEnginePath, rulesBundlePath, rulesClientURL, policyPath, outputPath) {
5658
5658
  const env = { ...process.env };
5659
+ const apiUrl = config_1.default.API_REST_URL;
5660
+ if (apiUrl.startsWith('http://')) {
5661
+ console.warn('\nYou configured the Snyk CLI to use an API URL with an HTTP scheme. This option is insecure and might prevent the Snyk CLI from working correctly.');
5662
+ }
5659
5663
  env['SNYK_IAC_TEST_API_REST_URL'] =
5660
- process.env['SNYK_IAC_TEST_API_REST_URL'] || getApiUrl();
5664
+ process.env['SNYK_IAC_TEST_API_REST_URL'] || apiUrl;
5661
5665
  env['SNYK_IAC_TEST_API_REST_TOKEN'] =
5662
5666
  process.env['SNYK_IAC_TEST_API_REST_TOKEN'] || getApiToken();
5663
5667
  env['SNYK_IAC_TEST_API_REST_OAUTH_TOKEN'] =
5664
5668
  process.env['SNYK_IAC_TEST_API_REST_OAUTH_TOKEN'] || api_token_1.getOAuthToken();
5665
5669
  env['SNYK_IAC_TEST_API_V1_URL'] =
5666
- process.env['SNYK_IAC_TEST_API_V1_URL'] || getApiUrl();
5670
+ process.env['SNYK_IAC_TEST_API_V1_URL'] || apiUrl;
5667
5671
  env['SNYK_IAC_TEST_API_V1_TOKEN'] =
5668
5672
  process.env['SNYK_IAC_TEST_API_V1_TOKEN'] || getApiToken();
5669
5673
  env['SNYK_IAC_TEST_API_V1_OAUTH_TOKEN'] =
@@ -5801,9 +5805,6 @@ async function remove(path) {
5801
5805
  });
5802
5806
  });
5803
5807
  }
5804
- function getApiUrl() {
5805
- return config_1.default.API_REST_URL;
5806
- }
5807
5808
  function getApiToken() {
5808
5809
  return api_token_1.api() || '';
5809
5810
  }