diff --git a/core/src/main/groovy/io/snyk/plugins/artifactory/snykSecurityPlugin.properties b/core/src/main/groovy/io/snyk/plugins/artifactory/snykSecurityPlugin.properties index 4c3361b..e2041bf 100644 --- a/core/src/main/groovy/io/snyk/plugins/artifactory/snykSecurityPlugin.properties +++ b/core/src/main/groovy/io/snyk/plugins/artifactory/snykSecurityPlugin.properties @@ -20,8 +20,8 @@ snyk.api.organization= # The base URL for all Snyk API endpoints. # Documentation: https://snyk.docs.apiary.io/#introduction/api-url -# Default: https://snyk.io/api/v1/ -#snyk.api.url=https://snyk.io/api/v1/ +# Default: https://api.snyk.io/v1/ +#snyk.api.url=https://api.snyk.io/v1/ # Path to an SSL Certificate for Snyk API in PEM format. #snyk.api.sslCertificatePath= diff --git a/core/src/main/java/io/snyk/plugins/artifactory/configuration/PluginConfiguration.java b/core/src/main/java/io/snyk/plugins/artifactory/configuration/PluginConfiguration.java index 7b73881..5e6353c 100644 --- a/core/src/main/java/io/snyk/plugins/artifactory/configuration/PluginConfiguration.java +++ b/core/src/main/java/io/snyk/plugins/artifactory/configuration/PluginConfiguration.java @@ -2,7 +2,7 @@ public enum PluginConfiguration implements Configuration { // general settings - API_URL("snyk.api.url", "https://snyk.io/api/v1/"), + API_URL("snyk.api.url", "https://api.snyk.io/v1/"), API_TOKEN("snyk.api.token", ""), API_ORGANIZATION("snyk.api.organization", ""), API_SSL_CERTIFICATE_PATH("snyk.api.sslCertificatePath", ""), diff --git a/core/src/test/java/io/snyk/plugins/artifactory/configuration/PluginConfigurationTest.java b/core/src/test/java/io/snyk/plugins/artifactory/configuration/PluginConfigurationTest.java index 7704a71..c288c9e 100644 --- a/core/src/test/java/io/snyk/plugins/artifactory/configuration/PluginConfigurationTest.java +++ b/core/src/test/java/io/snyk/plugins/artifactory/configuration/PluginConfigurationTest.java @@ -19,7 +19,7 @@ class PluginConfigurationTest { @Test void checkDefaultValues() { assertAll("should be not empty", - () -> assertEquals("https://snyk.io/api/v1/", API_URL.defaultValue(), getAssertionMessage(API_URL, "default value must be 'https://snyk.io/api/v1/'")), + () -> assertEquals("https://api.snyk.io/v1/", API_URL.defaultValue(), getAssertionMessage(API_URL, "default value must be 'https://api.snyk.io/v1/'")), () -> assertEquals("false", SCANNER_BLOCK_ON_API_FAILURE.defaultValue(), getAssertionMessage(SCANNER_BLOCK_ON_API_FAILURE, "default value must be 'false'")), () -> assertEquals("low", SCANNER_VULNERABILITY_THRESHOLD.defaultValue(), getAssertionMessage(SCANNER_VULNERABILITY_THRESHOLD, "default value must be 'low'")), () -> assertEquals("low", SCANNER_LICENSE_THRESHOLD.defaultValue(), getAssertionMessage(SCANNER_LICENSE_THRESHOLD, "default value must be 'low'")) diff --git a/core/src/test/resources/io/snyk/plugins/artifactory/PropertyLoaderTest/valid-property-file/snykSecurityPlugin.properties b/core/src/test/resources/io/snyk/plugins/artifactory/PropertyLoaderTest/valid-property-file/snykSecurityPlugin.properties index c8323da..1fc8dc4 100644 --- a/core/src/test/resources/io/snyk/plugins/artifactory/PropertyLoaderTest/valid-property-file/snykSecurityPlugin.properties +++ b/core/src/test/resources/io/snyk/plugins/artifactory/PropertyLoaderTest/valid-property-file/snykSecurityPlugin.properties @@ -1,4 +1,4 @@ -snyk.api.url=https://snyk.io/api/v1/ +snyk.api.url=https://api.snyk.io/v1/ snyk.api.token=my-api-token snyk.api.organization=my-api-organization # diff --git a/helm-install/install-helm.sh b/helm-install/install-helm.sh index ea40ecd..e621ecf 100755 --- a/helm-install/install-helm.sh +++ b/helm-install/install-helm.sh @@ -28,7 +28,7 @@ pushd "$SCRIPT_DIR/.." || exit 1 if [[ $SNYK_TOKEN == "" ]]; then $SNYK auth fi - ORG=$(curl -s -H "Authorization: token $SNYK_TOKEN" https://snyk.io/api/v1/orgs | jq -r '.orgs|first|.id') + ORG=$(curl -s -H "Authorization: token $SNYK_TOKEN" https://api.snyk.io/v1/orgs | jq -r '.orgs|first|.id') # monkey patching config file pushd plugins diff --git a/snyk-sdk-tests/src/test/java/io/snyk/sdk/SnykClientTest.java b/snyk-sdk-tests/src/test/java/io/snyk/sdk/SnykClientTest.java index 0e388fa..822efbe 100644 --- a/snyk-sdk-tests/src/test/java/io/snyk/sdk/SnykClientTest.java +++ b/snyk-sdk-tests/src/test/java/io/snyk/sdk/SnykClientTest.java @@ -20,7 +20,7 @@ void createSnykClient_shouldThrowIAE_ifTokenIsNull() { void createSnykConfig_shouldReturnDefaultValues_ifNotDefined() { Config config = new Config("snyk-api-token"); - assertEquals("https://snyk.io/api/v1/", config.baseUrl); + assertEquals("https://api.snyk.io/v1/", config.baseUrl); assertEquals("snyk-sdk-java", config.userAgent); } diff --git a/snyk-sdk/src/main/java/io/snyk/sdk/SnykConfig.java b/snyk-sdk/src/main/java/io/snyk/sdk/SnykConfig.java index a39fbf0..bcfb80a 100644 --- a/snyk-sdk/src/main/java/io/snyk/sdk/SnykConfig.java +++ b/snyk-sdk/src/main/java/io/snyk/sdk/SnykConfig.java @@ -42,7 +42,7 @@ public static SnykConfig withDefaults() { public static class Builder { private String token; - private String baseUrl = "https://snyk.io/api/v1/"; + private String baseUrl = "https://api.snyk.io/v1/"; private String userAgent = "snyk-sdk-java"; private boolean trustAllCertificates = false; private String sslCertificatePath = ""; diff --git a/snyk-sdk/src/test/java/io/snyk/sdk/api/v1/SnykHttpRequestBuilderTest.java b/snyk-sdk/src/test/java/io/snyk/sdk/api/v1/SnykHttpRequestBuilderTest.java index 731b51b..032732b 100644 --- a/snyk-sdk/src/test/java/io/snyk/sdk/api/v1/SnykHttpRequestBuilderTest.java +++ b/snyk-sdk/src/test/java/io/snyk/sdk/api/v1/SnykHttpRequestBuilderTest.java @@ -16,7 +16,7 @@ void shouldIncludeBaseUrlWithPath() { assertEquals(SnykHttpRequestBuilder.create(configWithDefaultBaseUrl) .build() .uri().toString(), - "https://snyk.io/api/v1/"); + "https://api.snyk.io/v1/"); String otherBaseUrl = "https://other-host/some-prefix/"; SnykConfig configWithDifferentBaseUrl = SnykConfig.newBuilder().setBaseUrl(otherBaseUrl).build(); @@ -34,7 +34,7 @@ void shouldIncludeBaseUrlWithPath() { void shouldOnlyIncludeNonNullQueryParameters() { SnykConfig config = SnykConfig.withDefaults(); - assertEquals("https://snyk.io/api/v1/some/endpoint?org=abc123", + assertEquals("https://api.snyk.io/v1/some/endpoint?org=abc123", SnykHttpRequestBuilder.create(config) .withPath("some/endpoint") .withQueryParam("org", "abc123") @@ -48,7 +48,7 @@ void shouldOnlyIncludeNonNullQueryParameters() { @Test void shouldOnlyIncludePresentQueryParameters() { SnykConfig config = SnykConfig.withDefaults(); - assertEquals("https://snyk.io/api/v1/some/endpoint?org=abc123", + assertEquals("https://api.snyk.io/v1/some/endpoint?org=abc123", SnykHttpRequestBuilder.create(config) .withPath("some/endpoint") .withQueryParam("org", Optional.of("abc123")) @@ -62,7 +62,7 @@ void shouldOnlyIncludePresentQueryParameters() { @Test void shouldIncludeMultipleQueryParameters() { SnykConfig config = SnykConfig.withDefaults(); - assertEquals("https://snyk.io/api/v1/some/endpoint?org=abc123&foo=bar", + assertEquals("https://api.snyk.io/v1/some/endpoint?org=abc123&foo=bar", SnykHttpRequestBuilder.create(config) .withPath("some/endpoint") .withQueryParam("org", "abc123")