Skip to content

Commit c51c0c9

Browse files
fix!: improve interoperability of SNYK_API environment variable (#74)
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"`.
1 parent f5fed05 commit c51c0c9

File tree

4 files changed

+4
-2
lines changed

4 files changed

+4
-2
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ It's important to note vulnerability data is moment-in-time information. By addi
138138

139139
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.
140140

141-
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`.
141+
The API base url can be set using the `SNYK_API` environment variable, and if missing it will default to `https://api.snyk.io`.
142142

143143
```
144144
parlay snyk enrich testing/sbom.cyclonedx.json

lib/snyk/self.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,5 +88,5 @@ func APIBaseURL() string {
8888
if snykApiEnv != "" {
8989
return snykApiEnv
9090
}
91-
return "https://api.snyk.io/rest"
91+
return "https://api.snyk.io"
9292
}

snyk/issues/issues.go

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

snyk/users/users.go

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)