4

我已经在我的 IntelliJ IDE 上安装了 snyk 漏洞分析插件,但是当我尝试运行分析时,它给了我如下错误:

在此处输入图像描述

虽然我知道它要求我为我的 snyk 服务器提供一些身份验证凭据,但我无法理解在 IDE 中的何处提供它。我试图查看是否可以找到任何选项来从 IDE 工具栏设置 snyk 身份验证,但我找不到任何选项。有谁知道如何解决这个问题?

4

2 回答 2

2

Not a very polished plug-in with regard to installation, I must say; apparently they just expect you to know that their CLI tool must be installed in order to be able to use the plug-in. No mention of that on the JetBrains Marketplace Snyk plug-in page.

But from the error message I just guessed and went ahead: Installation instructions for the CLI tool.

For example, if you have Homebrew installed, run this from the CLI:

  • brew tap snyk/tap && brew install snyk
  • snyk auth

enter image description here

I later found out that the need for their CLI tool is mentioned on their support page about the plug-in, though. But it says there ‘The plugin will automatically download the CLI in the background.’</p>

Once the CLI tool is installed, the plugin is a joy to use:

enter image description here

于 2021-02-04T21:12:33.470 回答
0

或者(我自己不能再尝试了,因为即使在卸载 CLI 工具后,插件仍然可以工作)获取 API 令牌并将其输入到插件的配置中可能就足够了:

  • 在app.snyk.io创建一个免费用户帐户
  • 导航到app.snyk.io/account
  • 单击API 令牌框中的表单输入字段以显示自动生成的令牌
  • 将其复制到剪贴板

app.snyk.io 用户帐户页面的屏幕截图

转到IntelliJ IDEAPreferencesToolsSnyk(在 macOS 上;对于 Windows,它以FileSettings开头,我相信)并将令牌粘贴到Token字段中。

IntelliJ 首选项的屏幕截图

于 2021-02-04T22:18:53.727 回答