File tree 5 files changed +13
-3
lines changed
5 files changed +13
-3
lines changed Original file line number Diff line number Diff line change 1
1
# Snyk Security Changelog
2
2
3
+ ## [ 2.7.21]
4
+
5
+ ### Fixed
6
+ - Append /v1 to the endpoint when necessary
7
+
3
8
## [ 2.7.20]
4
9
### Added
5
10
- (LS OSS) Starts rendering the Tree Nodes for OSS via the LS
Original file line number Diff line number Diff line change @@ -115,7 +115,7 @@ class SnykPostStartupActivity : ProjectActivity {
115
115
getKubernetesImageCache(project)?.cacheKubernetesFileFromProject()
116
116
}
117
117
118
- if (settings.scanOnSave && (isSnykCodeLSEnabled() || isSnykOSSLSEnabled() || isSnykIaCLSEnabled())) {
118
+ if (! settings.token.isNullOrBlank() && settings.scanOnSave && (isSnykCodeLSEnabled() || isSnykOSSLSEnabled() || isSnykIaCLSEnabled())) {
119
119
getSnykTaskQueueService(project)?.scan(true )
120
120
}
121
121
Original file line number Diff line number Diff line change @@ -21,12 +21,14 @@ fun toSnykCodeApiUrl(endpointUrl: String?): String {
21
21
uri.isDev() ->
22
22
endpoint
23
23
.replace(" api." , " " )
24
+ .replace(" /v1" , " " )
24
25
.replace(" https://dev." , " https://$codeSubdomain .dev." )
25
26
.suffixIfNot(" /" )
26
27
27
28
uri.isSnykTenant() ->
28
29
endpoint
29
30
.replace(" https://api." , " https://" )
31
+ .replace(" /v1" , " " )
30
32
.replace(" https://" , " https://$codeSubdomain ." )
31
33
.suffixIfNot(" /" )
32
34
@@ -73,7 +75,8 @@ fun getEndpointUrl(): String {
73
75
" "
74
76
}
75
77
val customEndpointUrl = resolveCustomEndpoint(endpointUrl)
76
- return customEndpointUrl.removeTrailingSlashesIfPresent()
78
+ // we need to set v1 here, to make the sast-enabled calls work in LS
79
+ return customEndpointUrl.removeTrailingSlashesIfPresent().suffixIfNot(" /v1" )
77
80
}
78
81
79
82
fun isSnykCodeAvailable (endpointUrl : String? ): Boolean {
Original file line number Diff line number Diff line change @@ -271,7 +271,7 @@ class LanguageServerWrapper(
271
271
}
272
272
273
273
private fun getFeatureFlagStatusInternal (featureFlag : String ): Boolean {
274
- if (! isSnykCodeLSEnabled()) {
274
+ if (! ( isSnykCodeLSEnabled() || isSnykOSSLSEnabled() || isSnykIaCLSEnabled()) || pluginSettings().token.isNullOrBlank ()) {
275
275
return false
276
276
}
277
277
Original file line number Diff line number Diff line change @@ -107,9 +107,11 @@ class CustomEndpointsTest {
107
107
fun `toSnykCodeApiUrl returns correct deeproxy url for SaaS deployments using api url` () {
108
108
val apiUrlForProduction = toSnykCodeApiUrl(" https://api.eu.snyk.io" )
109
109
val apiUrlForDevelopment = toSnykCodeApiUrl(" https://dev.api.eu.snyk.io" )
110
+ val apiUrlForWithV1 = toSnykCodeApiUrl(" https://api.eu.snyk.io/v1" )
110
111
111
112
assertEquals(" https://deeproxy.eu.snyk.io/" , apiUrlForProduction)
112
113
assertEquals(" https://deeproxy.dev.eu.snyk.io/" , apiUrlForDevelopment)
114
+ assertEquals(" https://deeproxy.eu.snyk.io/" , apiUrlForWithV1)
113
115
}
114
116
115
117
@Test
You can’t perform that action at this time.
0 commit comments