Skip to content

Commit

Permalink
feat: remove wizard
Browse files Browse the repository at this point in the history
  • Loading branch information
Avishagp committed Mar 31, 2022
1 parent bbb2e45 commit 0797fca
Show file tree
Hide file tree
Showing 25 changed files with 13 additions and 2,575 deletions.
16 changes: 0 additions & 16 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Expand Up @@ -106,11 +106,6 @@ test/tap/vulnerable-path-output.js @snyk/snyk-open-source
test/tap/cli-protect-no-vulns-to-patch.test.ts @snyk/hammer
test/tap/patch-fetch-fail.test.ts @snyk/hammer
test/tap/cli-protect.test.ts @snyk/hammer
test/tap/prompt-instrument.test.ts @snyk/hammer
test/tap/prompt-next-step.test.ts @snyk/hammer
test/tap/prompts-no-remediation.test.ts @snyk/hammer
test/tap/prompts-show-original-severity.test.ts @snyk/hammer
test/tap/prompts.test.ts @snyk/hammer
test/tap/protect-apply-same-patch-again.test.js @snyk/hammer
test/tap/protect-config.test.ts @snyk/hammer
test/tap/protect-factors-pre-tarred.test.ts @snyk/hammer
Expand All @@ -120,14 +115,3 @@ test/tap/protect-patch-filter.test.js @snyk/hammer
test/tap/protect-patch-order.test.ts @snyk/hammer
test/tap/protect-patch-same-pkg.test.js @snyk/hammer
test/tap/protect-semver-patch.test.ts @snyk/hammer

# wizard
test/tap/cli-wizard.acceptance.test.ts @snyk/hammer
test/tap/wizard-instrumented.js @snyk/hammer
test/tap/wizard-package-changes.test.ts @snyk/hammer
test/tap/wizard-patch-generates-policy.test.js @snyk/hammer
test/tap/wizard-patch-multiple-locations.test.ts @snyk/hammer
test/tap/wizard-prepare.test.js @snyk/hammer
test/tap/wizard-prepublish.test.js @snyk/hammer
test/tap/wizard-process-answers.test.js @snyk/hammer
test/tap/wizard-shrinkwrap.test.ts @snyk/hammer
2 changes: 1 addition & 1 deletion help/cli-commands/protect.md
Expand Up @@ -6,7 +6,7 @@

## Description

The `snyk protect` command applies patches to your vulnerable dependencies. This is useful after you open a fix pull request from the Snyk website (GitHub only) or after you run `snyk wizard` with the CLI. `snyk protect` reads a `.snyk` policy file to determine what patches to apply.
The `snyk protect` command applies patches to your vulnerable dependencies. This is useful after you open a fix pull request from the Snyk website (GitHub only). `snyk protect` reads a `.snyk` policy file to determine what patches to apply.

## Deprecation notice

Expand Down
33 changes: 0 additions & 33 deletions help/cli-commands/wizard.md

This file was deleted.

1 change: 0 additions & 1 deletion 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
Expand Up @@ -126,7 +126,6 @@
"snyk-resolve": "1.1.0",
"snyk-resolve-deps": "4.7.3",
"snyk-sbt-plugin": "2.14.0",
"snyk-try-require": "^2.0.2",
"strip-ansi": "^5.2.0",
"tar": "^6.1.2",
"tempy": "^1.0.1",
Expand Down
19 changes: 3 additions & 16 deletions src/cli/commands/auth/index.ts
Expand Up @@ -26,13 +26,8 @@ function resetAttempts() {
attemptsLeft = isDocker() ? 60 : 3 * 60;
}

type AuthCliCommands = 'wizard' | 'ignore';

async function webAuth(via: AuthCliCommands) {
async function webAuth() {
const token = uuidv4(); // generate a random key
const redirects = {
wizard: '/authenticated',
};

let urlStr = authUrl + '/login?token=' + token;

Expand All @@ -43,11 +38,6 @@ async function webAuth(via: AuthCliCommands) {
urlStr += '&' + utmParams;
}

// validate that via comes from our code, and not from user & CLI
if (redirects[via]) {
urlStr += '&redirectUri=' + Buffer.from(redirects[via]).toString('base64');
}

// suppress this message in CI
if (!isCI()) {
console.log(browserAuthPrompt(isDocker(), urlStr));
Expand Down Expand Up @@ -123,17 +113,14 @@ async function testAuthComplete(
});
}

export default async function auth(
apiToken: string,
via: AuthCliCommands,
): Promise<string> {
export default async function auth(apiToken: string): Promise<string> {
let promise;
resetAttempts();
if (apiToken) {
// user is manually setting the API token on the CLI - let's trust them
promise = verifyAPI(apiToken);
} else {
promise = webAuth(via);
promise = webAuth();
}

return promise.then((data) => {
Expand Down
5 changes: 1 addition & 4 deletions src/cli/commands/protect/index.ts
Expand Up @@ -58,10 +58,7 @@ export default async function protectFunc(
if (protectOptions.interactive) {
// silently fail
return Promise.reject(
new Error(
'Snyk protect interactive mode ' +
'has moved. Please run `snyk wizard`',
),
new Error('Snyk protect interactive mode ' + 'has moved.'),
);
}

Expand Down

0 comments on commit 0797fca

Please sign in to comment.