diff --git a/package-lock.json b/package-lock.json index 03892bbe09..eb5510c09a 100644 --- a/package-lock.json +++ b/package-lock.json @@ -15,7 +15,7 @@ "@open-policy-agent/opa-wasm": "^1.6.0", "@snyk/cli-interface": "2.11.0", "@snyk/cloud-config-parser": "^1.14.3", - "@snyk/code-client": "^4.13.0", + "@snyk/code-client": "^4.14.0", "@snyk/dep-graph": "^1.27.1", "@snyk/docker-registry-v2-client": "^2.7.3", "@snyk/fix": "file:packages/snyk-fix", @@ -1977,9 +1977,9 @@ } }, "node_modules/@snyk/code-client": { - "version": "4.13.0", - "resolved": "https://registry.npmjs.org/@snyk/code-client/-/code-client-4.13.0.tgz", - "integrity": "sha512-eOjjsehMfc2Y5gOmLTqqK2gefm9oOORy8Mt1bw3NtVieRW9cBYT93iGwjUzZQ0dJ2Y5nMBNX9f9aY17KZ2FniQ==", + "version": "4.14.0", + "resolved": "https://registry.npmjs.org/@snyk/code-client/-/code-client-4.14.0.tgz", + "integrity": "sha512-QdwWmQDlT5SjG7NwbVHqma2k/fop0GEX/vm8qeWJUbv13BUGfo1ecoN8wR0vlYjF8cI7vd1QJ/8XuLrPlDnErA==", "dependencies": { "@deepcode/dcignore": "^1.0.4", "@types/flat-cache": "^2.0.0", @@ -21500,9 +21500,9 @@ } }, "@snyk/code-client": { - "version": "4.13.0", - "resolved": "https://registry.npmjs.org/@snyk/code-client/-/code-client-4.13.0.tgz", - "integrity": "sha512-eOjjsehMfc2Y5gOmLTqqK2gefm9oOORy8Mt1bw3NtVieRW9cBYT93iGwjUzZQ0dJ2Y5nMBNX9f9aY17KZ2FniQ==", + "version": "4.14.0", + "resolved": "https://registry.npmjs.org/@snyk/code-client/-/code-client-4.14.0.tgz", + "integrity": "sha512-QdwWmQDlT5SjG7NwbVHqma2k/fop0GEX/vm8qeWJUbv13BUGfo1ecoN8wR0vlYjF8cI7vd1QJ/8XuLrPlDnErA==", "requires": { "@deepcode/dcignore": "^1.0.4", "@types/flat-cache": "^2.0.0", diff --git a/package.json b/package.json index fb898aee47..dbd55cd807 100644 --- a/package.json +++ b/package.json @@ -62,7 +62,7 @@ "@open-policy-agent/opa-wasm": "^1.6.0", "@snyk/cli-interface": "2.11.0", "@snyk/cloud-config-parser": "^1.14.3", - "@snyk/code-client": "^4.13.0", + "@snyk/code-client": "^4.14.0", "@snyk/dep-graph": "^1.27.1", "@snyk/docker-registry-v2-client": "^2.7.3", "@snyk/fix": "file:packages/snyk-fix", diff --git a/src/lib/code-config.ts b/src/lib/code-config.ts index fd603fb2c4..cd6c6195c7 100644 --- a/src/lib/code-config.ts +++ b/src/lib/code-config.ts @@ -1,7 +1,6 @@ import config from './config'; -import { config as userConfig } from './user-config'; -export function getCodeClientProxyUrl() { +export function getCodeClientProxyUrl(): string { const url = new URL(config.API); const domain = url.origin; return ( @@ -9,12 +8,3 @@ export function getCodeClientProxyUrl() { domain.replace(/\/\/(ap[pi]\.)?/, '//deeproxy.') ); } - -export function getBase64Encoding( - enabled = userConfig.get('use-base64-encoding'), -): boolean { - if (enabled) { - return enabled.toLowerCase() === 'true'; - } - return false; -} diff --git a/src/lib/plugins/sast/analysis.ts b/src/lib/plugins/sast/analysis.ts index f7cd9784e4..b623e671cb 100644 --- a/src/lib/plugins/sast/analysis.ts +++ b/src/lib/plugins/sast/analysis.ts @@ -7,7 +7,6 @@ import { ReportingDescriptor, Result } from 'sarif'; import { SEVERITY } from '../../snyk-test/legacy'; import { api } from '../../api-token'; import config from '../../config'; -import { getBase64Encoding } from '../../code-config'; import { spinner } from '../../spinner'; import { Options } from '../../types'; import { SastSettings, Log } from './types'; @@ -58,9 +57,6 @@ async function getCodeAnalysis( ? sastSettings.localCodeEngine.url : getCodeClientProxyUrl(); - const base64Encoding = getBase64Encoding(); - debug(`base64 encoding enabled: ${base64Encoding}`); - // TODO(james) This mirrors the implementation in request.ts and we need to use this for deeproxy calls // This ensures we support lowercase http(s)_proxy values as well // The weird IF around it ensures we don't create an envvar with @@ -86,7 +82,7 @@ async function getCodeAnalysis( ? severityToAnalysisSeverity(options.severityThreshold) : AnalysisSeverity.info; const result = await analyzeFolders({ - connection: { baseURL, sessionToken, source, requestId, base64Encoding }, + connection: { baseURL, sessionToken, source, requestId }, analysisOptions: { severity }, fileOptions: { paths: [root] }, analysisContext: { diff --git a/test/jest/acceptance/snyk-code-config/snyk-code-config.spec.ts b/test/jest/acceptance/snyk-code-config/snyk-code-config.spec.ts deleted file mode 100644 index 7819e86748..0000000000 --- a/test/jest/acceptance/snyk-code-config/snyk-code-config.spec.ts +++ /dev/null @@ -1,13 +0,0 @@ -import { runSnykCLI } from '../../util/runSnykCLI'; - -jest.setTimeout(1000 * 60); - -test('it does not enable base64 encoding by default', async () => { - const { code, stdout } = await runSnykCLI('config get use-base64-encoding', { - env: { - ...process.env, - }, - }); - expect(code).toEqual(0); - expect(stdout).toEqual(''); -}); diff --git a/test/jest/unit/snyk-code/snyk-code-config.spec.ts b/test/jest/unit/snyk-code/snyk-code-config.spec.ts deleted file mode 100644 index 9ef81f36e9..0000000000 --- a/test/jest/unit/snyk-code/snyk-code-config.spec.ts +++ /dev/null @@ -1,15 +0,0 @@ -import { getBase64Encoding } from '../../../../src/lib/code-config'; - -describe('test base64 setting', () => { - test('if not defined, base64 encoding is disabled', () => { - expect(getBase64Encoding()).toBe(false); - }); - - test('if set to true, base64 encoding is enabled', () => { - expect(getBase64Encoding('true')).toBe(true); - }); - - test('if set to false, base64 encoding is disabled', () => { - expect(getBase64Encoding('false')).toBe(false); - }); -}); diff --git a/test/jest/unit/snyk-code/snyk-code-test.spec.ts b/test/jest/unit/snyk-code/snyk-code-test.spec.ts index 5a13dd2342..5677af7b80 100644 --- a/test/jest/unit/snyk-code/snyk-code-test.spec.ts +++ b/test/jest/unit/snyk-code/snyk-code-test.spec.ts @@ -685,7 +685,6 @@ describe('Test snyk code', () => { sessionToken, source, requestId: 'test-id', - base64Encoding: false, }, analysisOptions: { severity, @@ -781,7 +780,6 @@ describe('Test snyk code', () => { sessionToken, source, requestId: 'test-id', - base64Encoding: false, }, analysisOptions: { severity,