我已经在我的 IntelliJ IDE 上安装了 snyk 漏洞分析插件,但是当我尝试运行分析时,它给了我如下错误:
虽然我知道它要求我为我的 snyk 服务器提供一些身份验证凭据,但我无法理解在 IDE 中的何处提供它。我试图查看是否可以找到任何选项来从 IDE 工具栏设置 snyk 身份验证,但我找不到任何选项。有谁知道如何解决这个问题?
我已经在我的 IntelliJ IDE 上安装了 snyk 漏洞分析插件,但是当我尝试运行分析时,它给了我如下错误:
虽然我知道它要求我为我的 snyk 服务器提供一些身份验证凭据,但我无法理解在 IDE 中的何处提供它。我试图查看是否可以找到任何选项来从 IDE 工具栏设置 snyk 身份验证,但我找不到任何选项。有谁知道如何解决这个问题?
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
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:
或者(我自己不能再尝试了,因为即使在卸载 CLI 工具后,插件仍然可以工作)获取 API 令牌并将其输入到插件的配置中可能就足够了:
转到IntelliJ IDEA ➤ Preferences ➤ Tools ➤ Snyk(在 macOS 上;对于 Windows,它以File ➤ Settings开头,我相信)并将令牌粘贴到Token字段中。