Skip to content

Commit 7212959

Browse files
committed
Merge branch 'feature/sts-login' of github.com:liramon1/aws-toolkit-vscode into feature/sts-login
2 parents 74e5864 + 4ed5e9c commit 7212959

File tree

3 files changed

+69
-53
lines changed

3 files changed

+69
-53
lines changed

packages/amazonq/package.json

Lines changed: 42 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1196,106 +1196,134 @@
11961196
"description": "AWS Contributed Icon",
11971197
"default": {
11981198
"fontPath": "./resources/fonts/aws-toolkit-icons.woff",
1199-
"fontCharacter": "\\f1d1"
1199+
"fontCharacter": "\\f1d3"
12001200
}
12011201
},
12021202
"aws-mynah-MynahIconBlack": {
12031203
"description": "AWS Contributed Icon",
12041204
"default": {
12051205
"fontPath": "./resources/fonts/aws-toolkit-icons.woff",
1206-
"fontCharacter": "\\f1d2"
1206+
"fontCharacter": "\\f1d4"
12071207
}
12081208
},
12091209
"aws-mynah-MynahIconWhite": {
12101210
"description": "AWS Contributed Icon",
12111211
"default": {
12121212
"fontPath": "./resources/fonts/aws-toolkit-icons.woff",
1213-
"fontCharacter": "\\f1d3"
1213+
"fontCharacter": "\\f1d5"
12141214
}
12151215
},
12161216
"aws-mynah-logo": {
12171217
"description": "AWS Contributed Icon",
12181218
"default": {
12191219
"fontPath": "./resources/fonts/aws-toolkit-icons.woff",
1220-
"fontCharacter": "\\f1d4"
1220+
"fontCharacter": "\\f1d6"
12211221
}
12221222
},
12231223
"aws-redshift-cluster": {
12241224
"description": "AWS Contributed Icon",
12251225
"default": {
12261226
"fontPath": "./resources/fonts/aws-toolkit-icons.woff",
1227-
"fontCharacter": "\\f1d5"
1227+
"fontCharacter": "\\f1d7"
12281228
}
12291229
},
12301230
"aws-redshift-cluster-connected": {
12311231
"description": "AWS Contributed Icon",
12321232
"default": {
12331233
"fontPath": "./resources/fonts/aws-toolkit-icons.woff",
1234-
"fontCharacter": "\\f1d6"
1234+
"fontCharacter": "\\f1d8"
12351235
}
12361236
},
12371237
"aws-redshift-database": {
12381238
"description": "AWS Contributed Icon",
12391239
"default": {
12401240
"fontPath": "./resources/fonts/aws-toolkit-icons.woff",
1241-
"fontCharacter": "\\f1d7"
1241+
"fontCharacter": "\\f1d9"
12421242
}
12431243
},
12441244
"aws-redshift-redshift-cluster-connected": {
12451245
"description": "AWS Contributed Icon",
12461246
"default": {
12471247
"fontPath": "./resources/fonts/aws-toolkit-icons.woff",
1248-
"fontCharacter": "\\f1d8"
1248+
"fontCharacter": "\\f1da"
12491249
}
12501250
},
12511251
"aws-redshift-schema": {
12521252
"description": "AWS Contributed Icon",
12531253
"default": {
12541254
"fontPath": "./resources/fonts/aws-toolkit-icons.woff",
1255-
"fontCharacter": "\\f1d9"
1255+
"fontCharacter": "\\f1db"
12561256
}
12571257
},
12581258
"aws-redshift-table": {
12591259
"description": "AWS Contributed Icon",
12601260
"default": {
12611261
"fontPath": "./resources/fonts/aws-toolkit-icons.woff",
1262-
"fontCharacter": "\\f1da"
1262+
"fontCharacter": "\\f1dc"
12631263
}
12641264
},
12651265
"aws-s3-bucket": {
12661266
"description": "AWS Contributed Icon",
12671267
"default": {
12681268
"fontPath": "./resources/fonts/aws-toolkit-icons.woff",
1269-
"fontCharacter": "\\f1db"
1269+
"fontCharacter": "\\f1dd"
12701270
}
12711271
},
12721272
"aws-s3-create-bucket": {
12731273
"description": "AWS Contributed Icon",
12741274
"default": {
12751275
"fontPath": "./resources/fonts/aws-toolkit-icons.woff",
1276-
"fontCharacter": "\\f1dc"
1276+
"fontCharacter": "\\f1de"
12771277
}
12781278
},
12791279
"aws-schemas-registry": {
12801280
"description": "AWS Contributed Icon",
12811281
"default": {
12821282
"fontPath": "./resources/fonts/aws-toolkit-icons.woff",
1283-
"fontCharacter": "\\f1dd"
1283+
"fontCharacter": "\\f1e1"
12841284
}
12851285
},
12861286
"aws-schemas-schema": {
12871287
"description": "AWS Contributed Icon",
12881288
"default": {
12891289
"fontPath": "./resources/fonts/aws-toolkit-icons.woff",
1290-
"fontCharacter": "\\f1de"
1290+
"fontCharacter": "\\f1e2"
12911291
}
12921292
},
12931293
"aws-stepfunctions-preview": {
1294+
"description": "AWS Contributed Icon",
1295+
"default": {
1296+
"fontPath": "./resources/fonts/aws-toolkit-icons.woff",
1297+
"fontCharacter": "\\f1e3"
1298+
}
1299+
},
1300+
"aws-lambda-create-stack": {
1301+
"description": "AWS Contributed Icon",
1302+
"default": {
1303+
"fontPath": "./resources/fonts/aws-toolkit-icons.woff",
1304+
"fontCharacter": "\\f1d1"
1305+
}
1306+
},
1307+
"aws-lambda-create-stack-light": {
1308+
"description": "AWS Contributed Icon",
1309+
"default": {
1310+
"fontPath": "./resources/fonts/aws-toolkit-icons.woff",
1311+
"fontCharacter": "\\f1d2"
1312+
}
1313+
},
1314+
"aws-sagemaker-code-editor": {
12941315
"description": "AWS Contributed Icon",
12951316
"default": {
12961317
"fontPath": "./resources/fonts/aws-toolkit-icons.woff",
12971318
"fontCharacter": "\\f1df"
12981319
}
1320+
},
1321+
"aws-sagemaker-jupyter-lab": {
1322+
"description": "AWS Contributed Icon",
1323+
"default": {
1324+
"fontPath": "./resources/fonts/aws-toolkit-icons.woff",
1325+
"fontCharacter": "\\f1e0"
1326+
}
12991327
}
13001328
},
13011329
"walkthroughs": [

packages/amazonq/test/unit/codewhisperer/util/authUtil.test.ts

Lines changed: 25 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,25 @@ import { GetIamCredentialResult } from '@aws/language-server-runtimes/protocol'
1515

1616
describe('AuthUtil', async function () {
1717
let auth: any
18+
let mockResponse: GetIamCredentialResult
1819

1920
beforeEach(async function () {
2021
await createTestAuthUtil()
2122
auth = AuthUtil.instance
23+
mockResponse = {
24+
credential: {
25+
id: 'test-credential-id',
26+
kinds: [],
27+
credentials: {
28+
accessKeyId: 'encrypted-access-key',
29+
secretAccessKey: 'encrypted-secret-key',
30+
sessionToken: 'encrypted-session-token',
31+
},
32+
},
33+
updateCredentialsParams: {
34+
data: 'credential-data',
35+
},
36+
} satisfies GetIamCredentialResult
2237
})
2338

2439
afterEach(async function () {
@@ -413,18 +428,6 @@ describe('AuthUtil', async function () {
413428

414429
describe('loginIam', function () {
415430
it('creates IAM session and logs in', async function () {
416-
const mockResponse = {
417-
id: 'test-credential-id',
418-
credentials: {
419-
accessKeyId: 'encrypted-access-key',
420-
secretAccessKey: 'encrypted-secret-key',
421-
sessionToken: 'encrypted-session-token',
422-
},
423-
updateCredentialsParams: {
424-
data: 'credential-data',
425-
},
426-
}
427-
428431
const mockIamLogin = {
429432
login: sinon.stub().resolves(mockResponse),
430433
loginType: 'iam',
@@ -433,38 +436,23 @@ describe('AuthUtil', async function () {
433436
sinon.stub(auth2, 'IamLogin').returns(mockIamLogin as any)
434437

435438
const response = await auth.loginIam({
436-
accessKey: 'accessKey',
437-
secretKey: 'secretKey',
438-
sessionToken: 'sessionToken',
439+
accessKey: 'testAccessKey',
440+
secretKey: 'testSecretKey',
441+
sessionToken: 'testSessionToken',
439442
})
440443

441444
assert.ok(mockIamLogin.login.calledOnce)
442445
assert.ok(
443446
mockIamLogin.login.calledWithMatch({
444-
accessKey: 'accessKey',
445-
secretKey: 'secretKey',
446-
sessionToken: 'sessionToken',
447+
accessKey: 'testAccessKey',
448+
secretKey: 'testSecretKey',
449+
sessionToken: 'testSessionToken',
447450
})
448451
)
449452
assert.strictEqual(response, mockResponse)
450453
})
451454

452455
it('creates IAM session with role ARN', async function () {
453-
const mockResponse: GetIamCredentialResult = {
454-
credential: {
455-
id: 'test-credential-id',
456-
kinds: [],
457-
credentials: {
458-
accessKeyId: 'encrypted-access-key',
459-
secretAccessKey: 'encrypted-secret-key',
460-
sessionToken: 'encrypted-session-token',
461-
},
462-
},
463-
updateCredentialsParams: {
464-
data: 'credential-data',
465-
},
466-
}
467-
468456
const mockIamLoginArn = {
469457
login: sinon.stub().resolves(mockResponse),
470458
loginType: 'iam',
@@ -473,10 +461,10 @@ describe('AuthUtil', async function () {
473461
sinon.stub(auth2, 'IamLogin').returns(mockIamLoginArn as any)
474462

475463
const opts: auth2.IamProfileOptions = {
476-
accessKey: 'myAccessKey',
477-
secretKey: 'mySecretKey',
478-
sessionToken: 'mySessionToken',
479-
roleArn: 'arn:aws:iam::123456789012:role/MyTestRole',
464+
accessKey: 'testAccessKey',
465+
secretKey: 'testSecretKey',
466+
sessionToken: 'testSessionToken',
467+
roleArn: 'arn:aws:iam::123456789012:role/TestRole',
480468
}
481469

482470
const response = await auth.loginIam(opts)

packages/core/src/auth/credentials/utils.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -105,8 +105,8 @@ const errorMessageUserCancelled = localize('AWS.error.mfa.userCancelled', 'User
105105
/**
106106
* @description Prompts user for MFA serial number
107107
*
108-
* @param defaultSerial Default value for the serial number input
109-
* @param profileName Name of Credentials profile we are asking an MFA Token for
108+
* @param defaultSerial Default MFA serial number to pre-fill
109+
* @param profileName Name of Credentials profile we are asking an MFA serial for
110110
*/
111111
export async function getMfaSerialFromUser(defaultSerial: string, profileName: string): Promise<string> {
112112
const inputBox = createInputBox({

0 commit comments

Comments
 (0)