Skip to content
Open
Show file tree
Hide file tree
Changes from 3 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
10 changes: 10 additions & 0 deletions runtimes/protocol/identity-management.ts
Original file line number Diff line number Diff line change
Expand Up @@ -400,3 +400,13 @@ export interface StsCredentialChangedParams {
export const stsCredentialChangedRequestType = new ProtocolNotificationType<StsCredentialChangedParams, void>(
'aws/identity/stsCredentialChanged'
)

// profileChanged
export interface ProfileChangedParams {
profiles: Profile[]
ssoSessions: SsoSession[]
}

export const profileChangedRequestType = new ProtocolNotificationType<ProfileChangedParams, void>(
'aws/identity/stsCredentialChanged'
)
2 changes: 2 additions & 0 deletions runtimes/runtimes/base-runtime.ts
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@ import {
updateProfileRequestType,
stsCredentialChangedRequestType,
getMfaCodeRequestType,
profileChangedRequestType,
} from '../protocol/identity-management'
import { IdentityManagement } from '../server-interface/identity-management'
import { WebBase64Encoding } from './encoding'
Expand Down Expand Up @@ -217,6 +218,7 @@ export const baseRuntime = (connections: { reader: MessageReader; writer: Messag
onInvalidateStsCredential: handler => lspConnection.onRequest(invalidateStsCredentialRequestType, handler),
sendSsoTokenChanged: params => lspConnection.sendNotification(ssoTokenChangedRequestType, params),
sendStsCredentialChanged: params => lspConnection.sendNotification(stsCredentialChangedRequestType, params),
sendProfileChanged: params => lspConnection.sendNotification(profileChangedRequestType, params),
sendGetMfaCode: params => lspConnection.sendRequest(getMfaCodeRequestType, params),
}

Expand Down
2 changes: 2 additions & 0 deletions runtimes/runtimes/standalone.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ import {
ShowOpenDialogRequestType,
stsCredentialChangedRequestType,
getMfaCodeRequestType,
profileChangedRequestType,
} from '../protocol'
import { ProposedFeatures, createConnection } from 'vscode-languageserver/node'
import {
Expand Down Expand Up @@ -331,6 +332,7 @@ export const standalone = (props: RuntimeProps) => {
onInvalidateStsCredential: handler => lspConnection.onRequest(invalidateStsCredentialRequestType, handler),
sendSsoTokenChanged: params => lspConnection.sendNotification(ssoTokenChangedRequestType, params),
sendStsCredentialChanged: params => lspConnection.sendNotification(stsCredentialChangedRequestType, params),
sendProfileChanged: params => lspConnection.sendNotification(profileChangedRequestType, params),
sendGetMfaCode: params => lspConnection.sendRequest(getMfaCodeRequestType, params),
}

Expand Down
3 changes: 3 additions & 0 deletions runtimes/server-interface/identity-management.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import {
UpdateProfileParams,
UpdateProfileResult,
GetMfaCodeResult,
ProfileChangedParams,
} from '../protocol/identity-management'
import { RequestHandler } from '../protocol'

Expand Down Expand Up @@ -54,5 +55,7 @@ export type IdentityManagement = {

sendStsCredentialChanged: (params: StsCredentialChangedParams) => void

sendProfileChanged: (params: ProfileChangedParams) => void

sendGetMfaCode: (params: GetMfaCodeParams) => Promise<GetMfaCodeResult>
}