Skip to content

Commit

Permalink
feat: Automated Snyk region configuration (IDE-732)
Browse files Browse the repository at this point in the history
  • Loading branch information
acke committed Oct 25, 2024
1 parent 7b45967 commit fd72442
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/main/kotlin/snyk/common/lsp/SnykLanguageClient.kt
Original file line number Diff line number Diff line change
Expand Up @@ -270,8 +270,11 @@ class SnykLanguageClient :
fun hasAuthenticated(param: HasAuthenticatedParam) {
if (disposed) return
val oldToken = pluginSettings().token
if (oldToken == param.token) return
val oldApiUrl = pluginSettings().customEndpointUrl
if (oldToken == param.token && oldApiUrl == param.apiUrl) return
pluginSettings().token = param.token
pluginSettings().customEndpointUrl = param.apiUrl

ApplicationManager.getApplication().saveSettings()

if (oldToken.isNullOrBlank() && !param.token.isNullOrBlank() && pluginSettings().scanOnSave) {
Expand All @@ -288,7 +291,6 @@ class SnykLanguageClient :
return CompletableFuture.completedFuture(SdkHelper.getSdks(project))
}


@JsonNotification(value = "$/snyk.addTrustedFolders")
fun addTrustedPaths(param: SnykTrustedFoldersParams) {
if (disposed) return
Expand Down
1 change: 1 addition & 0 deletions src/main/kotlin/snyk/common/lsp/Types.kt
Original file line number Diff line number Diff line change
Expand Up @@ -477,6 +477,7 @@ data class IssueData(

data class HasAuthenticatedParam(
@SerializedName("token") val token: String?,
@SerializedName("apiUrl") val apiUrl: String?,
)

data class SnykTrustedFoldersParams(
Expand Down

0 comments on commit fd72442

Please sign in to comment.