Skip to content

Commit

Permalink
fix!: improve interoperability of SNYK_API environment variable
Browse files Browse the repository at this point in the history
BREAKING CHANGE: The SNYK_API environment variable should be set to the same
value as intended for the Snyk CLI and no longer requires the "/rest" suffix.
Instead, only the base URL of the Snyk API shall be used.

To adapt to the new version, change the SNYK_API environment variable to omit
the "/rest", e.g. `SNYK_API="https://api.snyk.io"`.
  • Loading branch information
paulrosca-snyk committed Oct 24, 2024
1 parent 0ea7ec6 commit 3fffbb4
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ It's important to note vulnerability data is moment-in-time information. By addi

Note the Snyk commands require you to be a Snyk customer, and require passing a valid Snyk API token in the `SNYK_TOKEN` environment variable.

The API base url can be set using the `SNYK_API` environment variable, and if missing it will default to `https://api.snyk.io/rest`.
The API base url can be set using the `SNYK_API` environment variable, and if missing it will default to `https://api.snyk.io`.

```
parlay snyk enrich testing/sbom.cyclonedx.json
Expand Down
2 changes: 1 addition & 1 deletion lib/snyk/self.go
Original file line number Diff line number Diff line change
Expand Up @@ -88,5 +88,5 @@ func APIBaseURL() string {
if snykApiEnv != "" {
return snykApiEnv
}
return "https://api.snyk.io/rest"
return "https://api.snyk.io"
}
1 change: 1 addition & 0 deletions snyk/issues/issues.go

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

1 change: 1 addition & 0 deletions snyk/users/users.go

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

0 comments on commit 3fffbb4

Please sign in to comment.