Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
162 changes: 2 additions & 160 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,6 @@
"@sentry/node": "^7.120.4",
"@snyk/cli-interface": "2.15.0",
"@snyk/cloud-config-parser": "^1.14.5",
"@snyk/code-client": "^4.26.2",
"@snyk/dep-graph": "^2.16.3",
"@snyk/docker-registry-v2-client": "^4.0.2",
"@snyk/error-catalog-nodejs-public": "^5.79.0",
Expand Down
7 changes: 7 additions & 0 deletions src/cli/commands/fix/validate-fix-command-is-supported.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { getEcosystemForTest } from '../../../lib/ecosystems';

import { isFeatureFlagSupportedForOrg } from '../../../lib/feature-flags';
import { FeatureNotSupportedByEcosystemError } from '../../../lib/errors/not-supported-by-ecosystem';
import { CustomError } from '../../../lib/errors/custom-error';
Comment thread
fsargent marked this conversation as resolved.
Outdated
import { Options, TestOptions } from '../../../lib/types';
import { AuthFailedError } from '../../../lib/errors';
import chalk from 'chalk';
Expand All @@ -18,6 +19,12 @@ export async function validateFixCommandIsSupported(
throw new FeatureNotSupportedByEcosystemError('snyk fix', 'docker');
}

if (options.code) {
throw new CustomError(
'`snyk fix` is not supported for Snyk Code projects.',
);
}

const ecosystem = getEcosystemForTest(options);
if (ecosystem) {
throw new FeatureNotSupportedByEcosystemError('snyk fix', ecosystem);
Expand Down
7 changes: 7 additions & 0 deletions src/cli/commands/test/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import { MissingArgError } from '../../../lib/errors';
import * as theme from '../../../lib/theme';

import * as snyk from '../../../lib';
import { CustomError } from '../../../lib/errors/custom-error';
import { Options, TestOptions } from '../../../lib/types';
import { MethodArgs } from '../../args';
import { TestCommandResult } from '../../commands/types';
Expand Down Expand Up @@ -110,6 +111,12 @@ export default async function test(
throw new MissingArgError();
}

if (options.code) {
Comment thread
fsargent marked this conversation as resolved.
throw new CustomError(
'Snyk Code testing is handled by the native CLI workflow. Use the packaged Snyk CLI binary to run `snyk code test`.',
);
}

if (options.docker) {
// order is important here, we want:
// 1) exclude-app-vulns set -> no app vulns
Expand Down
15 changes: 0 additions & 15 deletions src/lib/code-config.ts

This file was deleted.

3 changes: 0 additions & 3 deletions src/lib/config/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ interface Config {
timeout: number;
PROJECT_NAME: string;
TOKEN: string;
CODE_CLIENT_PROXY_URL: string;
DISABLE_ANALYTICS: unknown;
CACHE_PATH?: string;
DRIFTCTL_PATH?: string;
Expand Down Expand Up @@ -90,6 +89,4 @@ if (!config.ROOT) {
config.PUBLIC_VULN_DB_URL = 'https://security.snyk.io';
config.PUBLIC_LICENSE_URL = 'https://snyk.io';

config.CODE_CLIENT_PROXY_URL = process.env.SNYK_CODE_CLIENT_PROXY_URL || '';

export default config;
3 changes: 0 additions & 3 deletions src/lib/ecosystems/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,6 @@ export function getEcosystemForTest(options: Options): Ecosystem | null {
if (options.unmanaged) {
return 'cpp';
}
if (options.code) {
return 'code';
}
return null;
}

Expand Down
2 changes: 0 additions & 2 deletions src/lib/ecosystems/plugins.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import * as cppPlugin from 'snyk-cpp-plugin';
import * as dockerPlugin from 'snyk-docker-plugin';
import { codePlugin } from '../plugins/sast';
import { Ecosystem, EcosystemPlugin } from './types';

const EcosystemPlugins: {
Expand All @@ -9,7 +8,6 @@ const EcosystemPlugins: {
cpp: cppPlugin as EcosystemPlugin,
// TODO: not any
docker: dockerPlugin as any,
code: codePlugin,
};

export function getPlugin(ecosystem: Ecosystem): EcosystemPlugin {
Expand Down
2 changes: 1 addition & 1 deletion src/lib/ecosystems/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { SEVERITY } from '../snyk-test/common';
import { RemediationChanges } from '../snyk-test/legacy';
import { Options, ProjectAttributes, Tag } from '../types';

export type Ecosystem = 'cpp' | 'docker' | 'code';
export type Ecosystem = 'cpp' | 'docker';

export type FindingType = 'iacIssue';

Expand Down
Loading