Skip to content

feat(amazonq): implement aws/identity messages to Q LSP #5468

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,15 @@
import software.aws.toolkits.jetbrains.services.amazonq.lsp.model.aws.LspServerConfigurations
import software.aws.toolkits.jetbrains.services.amazonq.lsp.model.aws.UpdateConfigurationParams
import software.aws.toolkits.jetbrains.services.amazonq.lsp.model.aws.credentials.UpdateCredentialsPayload
import software.aws.toolkits.jetbrains.services.amazonq.lsp.model.aws.dependencies.SyncModuleDependenciesParams

Check warning on line 14 in plugins/amazonq/shared/jetbrains-community/src/software/aws/toolkits/jetbrains/services/amazonq/lsp/AmazonQLanguageServer.kt

View workflow job for this annotation

GitHub Actions / Qodana Community for JVM

Unused import directive

Unused import directive

Check warning

Code scanning / QDJVMC

Unused import directive Warning

Unused import directive
import software.aws.toolkits.jetbrains.services.amazonq.lsp.model.aws.identity.GetSsoTokenParams
import software.aws.toolkits.jetbrains.services.amazonq.lsp.model.aws.identity.GetSsoTokenResult
import software.aws.toolkits.jetbrains.services.amazonq.lsp.model.aws.identity.InvalidateSsoTokenParams
import software.aws.toolkits.jetbrains.services.amazonq.lsp.model.aws.identity.InvalidateSsoTokenResult
import software.aws.toolkits.jetbrains.services.amazonq.lsp.model.aws.identity.ListProfilesResult
import software.aws.toolkits.jetbrains.services.amazonq.lsp.model.aws.identity.SsoTokenChangedParams
import software.aws.toolkits.jetbrains.services.amazonq.lsp.model.aws.identity.UpdateProfileParams
import software.aws.toolkits.jetbrains.services.amazonq.lsp.model.aws.identity.UpdateProfileResult
import software.aws.toolkits.jetbrains.services.amazonq.lsp.model.aws.dependencies.DidChangeDependencyPathsParams
import java.util.concurrent.CompletableFuture

Expand All @@ -28,6 +37,21 @@
@JsonNotification("aws/credentials/token/delete")
fun deleteTokenCredentials(): CompletableFuture<Unit>

@JsonRequest("aws/identity/listProfiles")
fun listProfiles(): CompletableFuture<ListProfilesResult>

@JsonRequest("aws/identity/getSsoToken")
fun getSsoToken(params: GetSsoTokenParams): CompletableFuture<GetSsoTokenResult>

@JsonRequest("aws/identity/invalidateSsoToken")
fun invalidateSsoToken(params: InvalidateSsoTokenParams): CompletableFuture<InvalidateSsoTokenResult>

@JsonRequest("aws/identity/updateProfile")
fun updateProfile(params: UpdateProfileParams): CompletableFuture<UpdateProfileResult>

@JsonNotification("aws/identity/ssoTokenChanged")
fun ssoTokenChanged(params: SsoTokenChangedParams): CompletableFuture<Unit>

@JsonRequest("aws/getConfigurationFromServer")
fun getConfigurationFromServer(params: GetConfigurationFromServerParams): CompletableFuture<LspServerConfigurations>

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
// Copyright 2025 Amazon.com, Inc. or its affiliates. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0

package software.aws.toolkits.jetbrains.services.amazonq.lsp.model.aws.identity

class GetSsoTokenOptions(
val loginOnInvalidToken: Boolean

Check warning on line 7 in plugins/amazonq/shared/jetbrains-community/src/software/aws/toolkits/jetbrains/services/amazonq/lsp/model/aws/identity/GetSsoTokenOptions.kt

View workflow job for this annotation

GitHub Actions / Qodana Community for JVM

Unused symbol

Property "loginOnInvalidToken" is never used

Check warning

Code scanning / QDJVMC

Unused symbol Warning

Property "loginOnInvalidToken" is never used
)
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
// Copyright 2025 Amazon.com, Inc. or its affiliates. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0

package software.aws.toolkits.jetbrains.services.amazonq.lsp.model.aws.identity

class GetSsoTokenParams(
val source: GetSsoTokenSource,
val clientName: String,

Check warning on line 8 in plugins/amazonq/shared/jetbrains-community/src/software/aws/toolkits/jetbrains/services/amazonq/lsp/model/aws/identity/GetSsoTokenParams.kt

View workflow job for this annotation

GitHub Actions / Qodana Community for JVM

Unused symbol

Property "clientName" is never used

Check warning

Code scanning / QDJVMC

Unused symbol Warning

Property "clientName" is never used
val options: GetSsoTokenOptions
)
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
// Copyright 2025 Amazon.com, Inc. or its affiliates. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0

package software.aws.toolkits.jetbrains.services.amazonq.lsp.model.aws.identity

import software.aws.toolkits.jetbrains.services.amazonq.lsp.model.aws.credentials.UpdateCredentialsPayload

class GetSsoTokenResult(
val ssoToken: SsoToken,

Check warning on line 9 in plugins/amazonq/shared/jetbrains-community/src/software/aws/toolkits/jetbrains/services/amazonq/lsp/model/aws/identity/GetSsoTokenResult.kt

View workflow job for this annotation

GitHub Actions / Qodana Community for JVM

Unused symbol

Property "ssoToken" is never used

Check warning

Code scanning / QDJVMC

Unused symbol Warning

Property "ssoToken" is never used
val updateCredentialsParams: UpdateCredentialsPayload

Check warning on line 10 in plugins/amazonq/shared/jetbrains-community/src/software/aws/toolkits/jetbrains/services/amazonq/lsp/model/aws/identity/GetSsoTokenResult.kt

View workflow job for this annotation

GitHub Actions / Qodana Community for JVM

Unused symbol

Property "updateCredentialsParams" is never used

Check warning

Code scanning / QDJVMC

Unused symbol Warning

Property "updateCredentialsParams" is never used
)
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
// Copyright 2025 Amazon.com, Inc. or its affiliates. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0

package software.aws.toolkits.jetbrains.services.amazonq.lsp.model.aws.identity

class GetSsoTokenSource(
val kind: String,

Check warning on line 7 in plugins/amazonq/shared/jetbrains-community/src/software/aws/toolkits/jetbrains/services/amazonq/lsp/model/aws/identity/GetSsoTokenSource.kt

View workflow job for this annotation

GitHub Actions / Qodana Community for JVM

Unused symbol

Property "kind" is never used

Check warning

Code scanning / QDJVMC

Unused symbol Warning

Property "kind" is never used
val ssoRegistrationScopes: List<String>,

Check warning on line 8 in plugins/amazonq/shared/jetbrains-community/src/software/aws/toolkits/jetbrains/services/amazonq/lsp/model/aws/identity/GetSsoTokenSource.kt

View workflow job for this annotation

GitHub Actions / Qodana Community for JVM

Unused symbol

Property "ssoRegistrationScopes" is never used

Check warning

Code scanning / QDJVMC

Unused symbol Warning

Property "ssoRegistrationScopes" is never used
val profileName: String

Check warning on line 9 in plugins/amazonq/shared/jetbrains-community/src/software/aws/toolkits/jetbrains/services/amazonq/lsp/model/aws/identity/GetSsoTokenSource.kt

View workflow job for this annotation

GitHub Actions / Qodana Community for JVM

Unused symbol

Property "profileName" is never used

Check warning

Code scanning / QDJVMC

Unused symbol Warning

Property "profileName" is never used
)
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
// Copyright 2025 Amazon.com, Inc. or its affiliates. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0

package software.aws.toolkits.jetbrains.services.amazonq.lsp.model.aws.identity

data class InvalidateSsoTokenParams(
val ssoTokenId: String
)
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
// Copyright 2025 Amazon.com, Inc. or its affiliates. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0

package software.aws.toolkits.jetbrains.services.amazonq.lsp.model.aws.identity

//Intentionally left blank
class InvalidateSsoTokenResult ()

Check notice on line 7 in plugins/amazonq/shared/jetbrains-community/src/software/aws/toolkits/jetbrains/services/amazonq/lsp/model/aws/identity/InvalidateSsoTokenResult.kt

View workflow job for this annotation

GitHub Actions / Qodana Community for JVM

Redundant empty primary constructor

Remove empty primary constructor

Check notice

Code scanning / QDJVMC

Redundant empty primary constructor Note

Remove empty primary constructor
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
// Copyright 2025 Amazon.com, Inc. or its affiliates. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0

package software.aws.toolkits.jetbrains.services.amazonq.lsp.model.aws.identity

// intentionally left blank
class ListProfilesParams()

Check notice on line 7 in plugins/amazonq/shared/jetbrains-community/src/software/aws/toolkits/jetbrains/services/amazonq/lsp/model/aws/identity/ListProfilesParams.kt

View workflow job for this annotation

GitHub Actions / Qodana Community for JVM

Redundant empty primary constructor

Remove empty primary constructor

Check warning on line 7 in plugins/amazonq/shared/jetbrains-community/src/software/aws/toolkits/jetbrains/services/amazonq/lsp/model/aws/identity/ListProfilesParams.kt

View workflow job for this annotation

GitHub Actions / Qodana Community for JVM

Unused symbol

Class "ListProfilesParams" is never used

Check warning

Code scanning / QDJVMC

Unused symbol Warning

Class "ListProfilesParams" is never used

Check notice

Code scanning / QDJVMC

Redundant empty primary constructor Note

Remove empty primary constructor
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
// Copyright 2025 Amazon.com, Inc. or its affiliates. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0

package software.aws.toolkits.jetbrains.services.amazonq.lsp.model.aws.identity

class ListProfilesResult(
val profiles: List<Profile>,

Check warning on line 7 in plugins/amazonq/shared/jetbrains-community/src/software/aws/toolkits/jetbrains/services/amazonq/lsp/model/aws/identity/ListProfilesResult.kt

View workflow job for this annotation

GitHub Actions / Qodana Community for JVM

Unused symbol

Property "profiles" is never used

Check warning

Code scanning / QDJVMC

Unused symbol Warning

Property "profiles" is never used
val ssoSessions: List<SsoSession>

Check warning on line 8 in plugins/amazonq/shared/jetbrains-community/src/software/aws/toolkits/jetbrains/services/amazonq/lsp/model/aws/identity/ListProfilesResult.kt

View workflow job for this annotation

GitHub Actions / Qodana Community for JVM

Unused symbol

Property "ssoSessions" is never used

Check warning

Code scanning / QDJVMC

Unused symbol Warning

Property "ssoSessions" is never used

)
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
// Copyright 2025 Amazon.com, Inc. or its affiliates. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0

package software.aws.toolkits.jetbrains.services.amazonq.lsp.model.aws.identity

class Profile(
val kinds: List<String>,

Check warning on line 7 in plugins/amazonq/shared/jetbrains-community/src/software/aws/toolkits/jetbrains/services/amazonq/lsp/model/aws/identity/Profile.kt

View workflow job for this annotation

GitHub Actions / Qodana Community for JVM

Unused symbol

Property "kinds" is never used

Check warning

Code scanning / QDJVMC

Unused symbol Warning

Property "kinds" is never used
val settings: ProfileSettings
)
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
// Copyright 2025 Amazon.com, Inc. or its affiliates. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0

package software.aws.toolkits.jetbrains.services.amazonq.lsp.model.aws.identity

class ProfileSettings(
val region: String,
val ssoSession: String

Check warning on line 8 in plugins/amazonq/shared/jetbrains-community/src/software/aws/toolkits/jetbrains/services/amazonq/lsp/model/aws/identity/ProfileSettings.kt

View workflow job for this annotation

GitHub Actions / Qodana Community for JVM

Unused symbol

Property "ssoSession" is never used

Check warning

Code scanning / QDJVMC

Unused symbol Warning

Property "ssoSession" is never used
)
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
// Copyright 2025 Amazon.com, Inc. or its affiliates. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0

package software.aws.toolkits.jetbrains.services.amazonq.lsp.model.aws.identity

class SsoSession(
val name: String,
val settings: SsoSettings
)
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
// Copyright 2025 Amazon.com, Inc. or its affiliates. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0

package software.aws.toolkits.jetbrains.services.amazonq.lsp.model.aws.identity

class SsoSettings(
val sso_start_url: String,

Check notice on line 7 in plugins/amazonq/shared/jetbrains-community/src/software/aws/toolkits/jetbrains/services/amazonq/lsp/model/aws/identity/SsoSettings.kt

View workflow job for this annotation

GitHub Actions / Qodana Community for JVM

Property naming convention

Property name `sso_start_url` should not contain underscores

Check warning on line 7 in plugins/amazonq/shared/jetbrains-community/src/software/aws/toolkits/jetbrains/services/amazonq/lsp/model/aws/identity/SsoSettings.kt

View workflow job for this annotation

GitHub Actions / Qodana Community for JVM

Unused symbol

Property "sso_start_url" is never used

Check notice

Code scanning / QDJVMC

Property naming convention Note

Property name sso_start_url should not contain underscores

Check warning

Code scanning / QDJVMC

Unused symbol Warning

Property "sso_start_url" is never used
val sso_region: String,

Check notice on line 8 in plugins/amazonq/shared/jetbrains-community/src/software/aws/toolkits/jetbrains/services/amazonq/lsp/model/aws/identity/SsoSettings.kt

View workflow job for this annotation

GitHub Actions / Qodana Community for JVM

Property naming convention

Property name `sso_region` should not contain underscores

Check warning on line 8 in plugins/amazonq/shared/jetbrains-community/src/software/aws/toolkits/jetbrains/services/amazonq/lsp/model/aws/identity/SsoSettings.kt

View workflow job for this annotation

GitHub Actions / Qodana Community for JVM

Unused symbol

Property "sso_region" is never used

Check notice

Code scanning / QDJVMC

Property naming convention Note

Property name sso_region should not contain underscores

Check warning

Code scanning / QDJVMC

Unused symbol Warning

Property "sso_region" is never used
val sso_registration_scopes: List<String>

Check notice on line 9 in plugins/amazonq/shared/jetbrains-community/src/software/aws/toolkits/jetbrains/services/amazonq/lsp/model/aws/identity/SsoSettings.kt

View workflow job for this annotation

GitHub Actions / Qodana Community for JVM

Property naming convention

Property name `sso_registration_scopes` should not contain underscores

Check warning on line 9 in plugins/amazonq/shared/jetbrains-community/src/software/aws/toolkits/jetbrains/services/amazonq/lsp/model/aws/identity/SsoSettings.kt

View workflow job for this annotation

GitHub Actions / Qodana Community for JVM

Unused symbol

Property "sso_registration_scopes" is never used

Check notice

Code scanning / QDJVMC

Property naming convention Note

Property name sso_registration_scopes should not contain underscores

Check warning

Code scanning / QDJVMC

Unused symbol Warning

Property "sso_registration_scopes" is never used
)
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
// Copyright 2025 Amazon.com, Inc. or its affiliates. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0

package software.aws.toolkits.jetbrains.services.amazonq.lsp.model.aws.identity

class SsoToken(
val id: String,
val accessToken: String

Check warning on line 8 in plugins/amazonq/shared/jetbrains-community/src/software/aws/toolkits/jetbrains/services/amazonq/lsp/model/aws/identity/SsoToken.kt

View workflow job for this annotation

GitHub Actions / Qodana Community for JVM

Unused symbol

Property "accessToken" is never used

Check warning

Code scanning / QDJVMC

Unused symbol Warning

Property "accessToken" is never used
)
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
// Copyright 2025 Amazon.com, Inc. or its affiliates. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0

package software.aws.toolkits.jetbrains.services.amazonq.lsp.model.aws.identity

enum class SsoTokenChangedKind {
EXPIRED,

Check warning on line 7 in plugins/amazonq/shared/jetbrains-community/src/software/aws/toolkits/jetbrains/services/amazonq/lsp/model/aws/identity/SsoTokenChangedKind.kt

View workflow job for this annotation

GitHub Actions / Qodana Community for JVM

Unused symbol

Class "EXPIRED" is never used

Check warning

Code scanning / QDJVMC

Unused symbol Warning

Class "EXPIRED" is never used
REFRESHED

Check warning on line 8 in plugins/amazonq/shared/jetbrains-community/src/software/aws/toolkits/jetbrains/services/amazonq/lsp/model/aws/identity/SsoTokenChangedKind.kt

View workflow job for this annotation

GitHub Actions / Qodana Community for JVM

Unused symbol

Class "REFRESHED" is never used

Check warning

Code scanning / QDJVMC

Unused symbol Warning

Class "REFRESHED" is never used
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
// Copyright 2025 Amazon.com, Inc. or its affiliates. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0

package software.aws.toolkits.jetbrains.services.amazonq.lsp.model.aws.identity

class SsoTokenChangedParams(
val kind: SsoTokenChangedKind,

Check warning on line 7 in plugins/amazonq/shared/jetbrains-community/src/software/aws/toolkits/jetbrains/services/amazonq/lsp/model/aws/identity/SsoTokenChangedParams.kt

View workflow job for this annotation

GitHub Actions / Qodana Community for JVM

Unused symbol

Property "kind" is never used

Check warning

Code scanning / QDJVMC

Unused symbol Warning

Property "kind" is never used
val ssoTokenId: String

Check warning on line 8 in plugins/amazonq/shared/jetbrains-community/src/software/aws/toolkits/jetbrains/services/amazonq/lsp/model/aws/identity/SsoTokenChangedParams.kt

View workflow job for this annotation

GitHub Actions / Qodana Community for JVM

Unused symbol

Property "ssoTokenId" is never used

Check warning

Code scanning / QDJVMC

Unused symbol Warning

Property "ssoTokenId" is never used
)
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
// Copyright 2025 Amazon.com, Inc. or its affiliates. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0

package software.aws.toolkits.jetbrains.services.amazonq.lsp.model.aws.identity

// intentionally left blank
class UpdateProfileOptions()

Check notice on line 7 in plugins/amazonq/shared/jetbrains-community/src/software/aws/toolkits/jetbrains/services/amazonq/lsp/model/aws/identity/UpdateProfileOptions.kt

View workflow job for this annotation

GitHub Actions / Qodana Community for JVM

Redundant empty primary constructor

Remove empty primary constructor

Check notice

Code scanning / QDJVMC

Redundant empty primary constructor Note

Remove empty primary constructor
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
// Copyright 2025 Amazon.com, Inc. or its affiliates. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0

package software.aws.toolkits.jetbrains.services.amazonq.lsp.model.aws.identity

class UpdateProfileParams(
val profile: Profile,
val ssoSession: SsoSession,

Check warning on line 8 in plugins/amazonq/shared/jetbrains-community/src/software/aws/toolkits/jetbrains/services/amazonq/lsp/model/aws/identity/UpdateProfileParams.kt

View workflow job for this annotation

GitHub Actions / Qodana Community for JVM

Unused symbol

Property "ssoSession" is never used

Check warning

Code scanning / QDJVMC

Unused symbol Warning

Property "ssoSession" is never used
val options: UpdateProfileOptions
)
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
// Copyright 2025 Amazon.com, Inc. or its affiliates. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0

package software.aws.toolkits.jetbrains.services.amazonq.lsp.model.aws.identity

// intentionally left blank
class UpdateProfileResult()

Check notice on line 7 in plugins/amazonq/shared/jetbrains-community/src/software/aws/toolkits/jetbrains/services/amazonq/lsp/model/aws/identity/UpdateProfileResult.kt

View workflow job for this annotation

GitHub Actions / Qodana Community for JVM

Redundant empty primary constructor

Remove empty primary constructor

Check notice

Code scanning / QDJVMC

Redundant empty primary constructor Note

Remove empty primary constructor
Loading