Skip to content

Commit f044eb6

Browse files
committed
Revert CredentialChangedKind for backwards compatibility
1 parent 9dbe490 commit f044eb6

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

packages/core/src/auth/auth2.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ import {
4141
iamCredentialsDeleteNotificationType,
4242
bearerCredentialsDeleteNotificationType,
4343
bearerCredentialsUpdateRequestType,
44-
CredentialChangedKind,
44+
SsoTokenChangedKind,
4545
RequestType,
4646
ResponseMessage,
4747
NotificationType,
@@ -473,10 +473,10 @@ export class SsoLogin extends BaseLogin {
473473

474474
private ssoTokenChangedHandler(params: SsoTokenChangedParams) {
475475
if (params.ssoTokenId === this.ssoTokenId) {
476-
if (params.kind === CredentialChangedKind.Expired) {
476+
if (params.kind === SsoTokenChangedKind.Expired) {
477477
this.updateConnectionState('expired')
478478
return
479-
} else if (params.kind === CredentialChangedKind.Refreshed) {
479+
} else if (params.kind === SsoTokenChangedKind.Refreshed) {
480480
this.eventEmitter.fire({ id: this.profileName, state: 'refreshed' })
481481
}
482482
}
@@ -603,10 +603,10 @@ export class IamLogin extends BaseLogin {
603603

604604
// private stsCredentialChangedHandler(params: StsCredentialChangedParams) {
605605
// if (params.stsCredentialId === this.iamCredentialId) {
606-
// if (params.kind === CredentialChangedKind.Expired) {
606+
// if (params.kind === StsCredentialChangedKind.Expired) {
607607
// this.updateConnectionState('expired')
608608
// return
609-
// } else if (params.kind === CredentialChangedKind.Refreshed) {
609+
// } else if (params.kind === StsCredentialChangedKind.Refreshed) {
610610
// this.eventEmitter.fire({ id: this.profileName, state: 'refreshed' })
611611
// }
612612
// }

packages/core/src/test/credentials/auth2.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ import {
1717
bearerCredentialsUpdateRequestType,
1818
bearerCredentialsDeleteNotificationType,
1919
ssoTokenChangedRequestType,
20-
CredentialChangedKind,
20+
SsoTokenChangedKind,
2121
invalidateSsoTokenRequestType,
2222
AwsErrorCodes,
2323
} from '@aws/language-server-runtimes/protocol'
@@ -180,7 +180,7 @@ describe('LanguageClientAuth', () => {
180180

181181
// Simulate a token changed notification
182182
const tokenChangedParams: SsoTokenChangedParams = {
183-
kind: CredentialChangedKind.Refreshed,
183+
kind: SsoTokenChangedKind.Refreshed,
184184
ssoTokenId: tokenId,
185185
}
186186
const registeredHandler = client.onNotification.firstCall.args[1]

0 commit comments

Comments
 (0)