Skip to content

Commit fcc4285

Browse files
committed
Add credentials process input
1 parent e7d9798 commit fcc4285

File tree

5 files changed

+74
-22
lines changed

5 files changed

+74
-22
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/core/src/auth/auth2.ts

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,7 @@ export type IamProfileOptions = {
9898
sessionToken?: string
9999
roleArn?: string
100100
sourceProfile?: string
101+
process?: string
101102
}
102103

103104
const IamProfileOptionsDefaults = {
@@ -106,6 +107,7 @@ const IamProfileOptionsDefaults = {
106107
sessionToken: '',
107108
roleArn: '',
108109
sourceProfile: '',
110+
process: '',
109111
} satisfies IamProfileOptions
110112

111113
/**
@@ -208,6 +210,7 @@ export class LanguageClientAuth {
208210
aws_access_key_id: '',
209211
aws_secret_access_key: '',
210212
role_arn: '',
213+
credential_process: '',
211214
},
212215
},
213216
ssoSession: {
@@ -227,7 +230,9 @@ export class LanguageClientAuth {
227230
const fields = { ...IamProfileOptionsDefaults, ...opts }
228231
// Get the profile kind matching the provided fields
229232
let kind: ProfileKind
230-
if (fields.roleArn && fields.sourceProfile) {
233+
if (fields.process) {
234+
kind = ProfileKind.IamCredentialProcessProfile
235+
} else if (fields.roleArn && fields.sourceProfile) {
231236
kind = ProfileKind.IamSourceProfileProfile
232237
} else if (fields.accessKey && fields.secretKey) {
233238
kind = ProfileKind.IamCredentialsProfile
@@ -245,6 +250,7 @@ export class LanguageClientAuth {
245250
aws_session_token: fields.sessionToken,
246251
role_arn: fields.roleArn,
247252
source_profile: fields.sourceProfile,
253+
credential_process: fields.process,
248254
},
249255
},
250256
})
@@ -568,7 +574,12 @@ export class IamLogin extends BaseLogin {
568574
}
569575

570576
async updateProfile(opts: IamProfileOptions) {
571-
if (opts.roleArn) {
577+
if (opts.process) {
578+
// Create the process profile
579+
await this.lspAuth.updateIamProfile(this.profileName, {
580+
process: opts.process,
581+
})
582+
} else if (opts.roleArn) {
572583
// Create the source and target profiles
573584
const sourceProfile = this.profileName + '-source'
574585
await this.lspAuth.updateIamProfile(sourceProfile, {
@@ -581,7 +592,7 @@ export class IamLogin extends BaseLogin {
581592
sourceProfile: sourceProfile,
582593
})
583594
} else {
584-
// Create the target profile
595+
// Create the credentials profile
585596
await this.lspAuth.updateIamProfile(this.profileName, {
586597
accessKey: opts.accessKey,
587598
secretKey: opts.secretKey,

packages/core/src/login/webview/vue/amazonq/backend_amazonq.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,8 @@ export class AmazonQLoginWebview extends CommonAuthWebview {
198198
accessKey: string,
199199
secretKey: string,
200200
sessionToken?: string,
201-
roleArn?: string
201+
roleArn?: string,
202+
process?: string
202203
): Promise<AuthError | undefined> {
203204
getLogger().debug(`called startIamCredentialSetup()`)
204205
// Defining separate auth function to emit telemetry before returning from this method
@@ -215,7 +216,7 @@ export class AmazonQLoginWebview extends CommonAuthWebview {
215216

216217
const runAuth = async (): Promise<AuthError | undefined> => {
217218
try {
218-
await AuthUtil.instance.loginIam({ accessKey, secretKey, sessionToken, roleArn })
219+
await AuthUtil.instance.loginIam({ accessKey, secretKey, sessionToken, roleArn, process })
219220
} catch (e) {
220221
getLogger().error('Failed submitting credentials %O', e)
221222
const message = e instanceof Error ? e.message : (e as string)

packages/core/src/login/webview/vue/backend.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,8 @@ export abstract class CommonAuthWebview extends VueWebview {
177177
accessKey: string,
178178
secretKey: string,
179179
sessionToken?: string,
180-
roleArn?: string
180+
roleArn?: string,
181+
process?: string
181182
): Promise<AuthError | undefined>
182183

183184
async showResourceExplorer(): Promise<void> {

packages/core/src/login/webview/vue/login.vue

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -298,6 +298,15 @@
298298
v-model="roleArn"
299299
@keydown.enter="handleContinueClick()"
300300
/>
301+
<div class="title">Credentials Process (Optional)</div>
302+
<input
303+
class="iamInput bottomMargin"
304+
type="text"
305+
id="process"
306+
name="process"
307+
v-model="process"
308+
@keydown.enter="handleContinueClick()"
309+
/>
301310
</div>
302311
<button class="continue-button" :disabled="shouldDisableIamContinue()" v-on:click="handleContinueClick()">
303312
Continue
@@ -389,6 +398,7 @@ export default defineComponent({
389398
secretKey: '',
390399
sessionToken: '',
391400
roleArn: '',
401+
process: '',
392402
}
393403
},
394404
async created() {
@@ -541,7 +551,8 @@ export default defineComponent({
541551
this.accessKey,
542552
this.secretKey,
543553
this.sessionToken,
544-
this.roleArn
554+
this.roleArn,
555+
this.process
545556
)
546557
if (error) {
547558
this.stage = 'START'
@@ -679,7 +690,7 @@ export default defineComponent({
679690
if (this.app === 'TOOLKIT') {
680691
return this.profileName.length <= 0 || this.accessKey.length <= 0 || this.secretKey.length <= 0
681692
} else {
682-
return this.accessKey.length <= 0 || this.secretKey.length <= 0
693+
return (this.accessKey.length <= 0 || this.secretKey.length <= 0) && this.process.length <= 0
683694
}
684695
},
685696
},

0 commit comments

Comments
 (0)