Skip to content

Commit 38dadca

Browse files
committed
fix eslint and update package.json
1 parent aefd659 commit 38dadca

File tree

2 files changed

+37
-14
lines changed

2 files changed

+37
-14
lines changed

packages/core/package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -442,9 +442,9 @@
442442
"devDependencies": {
443443
"@aws-sdk/types": "^3.13.1",
444444
"@aws/chat-client": "^0.1.4",
445-
"@aws/chat-client-ui-types": "^0.1.24",
446-
"@aws/language-server-runtimes": "^0.2.81",
447-
"@aws/language-server-runtimes-types": "^0.1.28",
445+
"@aws/chat-client-ui-types": "^0.1.53",
446+
"@aws/language-server-runtimes": "^0.2.111",
447+
"@aws/language-server-runtimes-types": "^0.1.47",
448448
"@cspotcode/source-map-support": "^0.8.1",
449449
"@sinonjs/fake-timers": "^10.0.2",
450450
"@types/adm-zip": "^0.4.34",

packages/core/src/auth/auth2.ts

Lines changed: 34 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,6 @@ import {
5151
SsoSession,
5252
GetMfaCodeParams,
5353
getMfaCodeRequestType,
54-
5554
} from '@aws/language-server-runtimes/protocol'
5655
import { LanguageClient } from 'vscode-languageclient'
5756
import { getLogger } from '../shared/logger/logger'
@@ -73,9 +72,7 @@ export const notificationTypes = {
7372
getConnectionMetadata: new RequestType<undefined, ConnectionMetadata, Error>(
7473
getConnectionMetadataRequestType.method
7574
),
76-
getMfaCode: new RequestType<GetMfaCodeParams, ResponseMessage, Error>(
77-
getMfaCodeRequestType.method
78-
)
75+
getMfaCode: new RequestType<GetMfaCodeParams, ResponseMessage, Error>(getMfaCodeRequestType.method),
7976
}
8077

8178
export type AuthState = 'notConnected' | 'connected' | 'expired'
@@ -101,7 +98,10 @@ export type TokenSource = IamIdentityCenterSsoTokenSource | AwsBuilderIdSsoToken
10198
*/
10299
export class LanguageClientAuth {
103100
readonly #ssoCacheWatcher = getCacheFileWatcher(getCacheDir(), getFlareCacheFileName(VSCODE_EXTENSION_ID.amazonq))
104-
readonly #stsCacheWatcher = getCacheFileWatcher(getStsCacheDir(), getFlareCacheFileName(VSCODE_EXTENSION_ID.amazonq))
101+
readonly #stsCacheWatcher = getCacheFileWatcher(
102+
getStsCacheDir(),
103+
getFlareCacheFileName(VSCODE_EXTENSION_ID.amazonq)
104+
)
105105

106106
constructor(
107107
private readonly client: LanguageClient,
@@ -183,7 +183,14 @@ export class LanguageClientAuth {
183183
} satisfies UpdateProfileParams)
184184
}
185185

186-
updateIamProfile(profileName: string, accessKey: string, secretKey: string, sessionToken?: string, roleArn?: string, sourceProfile?: string): Promise<UpdateProfileResult> {
186+
updateIamProfile(
187+
profileName: string,
188+
accessKey: string,
189+
secretKey: string,
190+
sessionToken?: string,
191+
roleArn?: string,
192+
sourceProfile?: string
193+
): Promise<UpdateProfileResult> {
187194
// Add credentials and delete SSO settings from profile
188195
let profile: Profile
189196
if (roleArn) {
@@ -306,7 +313,9 @@ export abstract class BaseLogin {
306313
protected loginType: LoginType | undefined
307314
protected connectionState: AuthState = 'notConnected'
308315
protected cancellationToken: CancellationTokenSource | undefined
309-
protected _data: { startUrl?: string; region?: string; accessKey?: string; secretKey?: string; sessionToken?: string } | undefined
316+
protected _data:
317+
| { startUrl?: string; region?: string; accessKey?: string; secretKey?: string; sessionToken?: string }
318+
| undefined
310319

311320
constructor(
312321
public readonly profileName: string,
@@ -533,7 +542,7 @@ export class IamLogin extends BaseLogin {
533542
)
534543
}
535544

536-
async login(opts: { accessKey: string; secretKey: string, sessionToken?: string, roleArn?: string }) {
545+
async login(opts: { accessKey: string; secretKey: string; sessionToken?: string; roleArn?: string }) {
537546
await this.updateProfile(opts)
538547
return this._getIamCredential(true)
539548
}
@@ -556,13 +565,27 @@ export class IamLogin extends BaseLogin {
556565
// TODO: DeleteProfile api in Identity Service (this doesn't exist yet)
557566
}
558567

559-
async updateProfile(opts: { accessKey: string; secretKey: string, sessionToken?: string, roleArn?: string }) {
568+
async updateProfile(opts: { accessKey: string; secretKey: string; sessionToken?: string; roleArn?: string }) {
560569
if (opts.roleArn) {
561570
const sourceProfile = this.profileName + '-source'
562-
await this.lspAuth.updateIamProfile(sourceProfile, opts.accessKey, opts.secretKey, opts.sessionToken, '', '')
571+
await this.lspAuth.updateIamProfile(
572+
sourceProfile,
573+
opts.accessKey,
574+
opts.secretKey,
575+
opts.sessionToken,
576+
'',
577+
''
578+
)
563579
await this.lspAuth.updateIamProfile(this.profileName, '', '', '', opts.roleArn, sourceProfile)
564580
} else {
565-
await this.lspAuth.updateIamProfile(this.profileName, opts.accessKey, opts.secretKey, opts.sessionToken, '', '')
581+
await this.lspAuth.updateIamProfile(
582+
this.profileName,
583+
opts.accessKey,
584+
opts.secretKey,
585+
opts.sessionToken,
586+
'',
587+
''
588+
)
566589
}
567590
}
568591

0 commit comments

Comments
 (0)