Skip to content

Commit 155e7f2

Browse files
authored
feat(codewhisperer): remove unnecessary "Proceed to login" prompt #3874
Problem: Since #3264 if a builder id is already in use by e.g. the CodeCatalyst feature of the Toolkit, clicking `Start` in the CodeWhisperer panel shows an unnecessary (modal!) prompt: "CodeWhisperer requires access to your AWS Builder ID connection. Proceed to login to grant CodeWhisperer access?" This prompt is unnecessary because: 1. Customer has already explicitly said they want to login. 2. We don't show such a prompt when starting from zero (which is logically equivalent to "augmenting" an existing builder id connection). 3. The prompt is redundant with the browser flow, which shows the scopes and asks for confirmation. Solution: Remove the prompt.
1 parent 04037e1 commit 155e7f2

File tree

2 files changed

+4
-22
lines changed

2 files changed

+4
-22
lines changed
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"type": "Feature",
3+
"description": "CodeWhisperer: remove unnecessary \"Proceed to login\" prompt"
4+
}

src/auth/secondaryAuth.ts

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,7 @@
55

66
import globals from '../shared/extensionGlobals'
77

8-
import * as nls from 'vscode-nls'
9-
const localize = nls.loadMessageBundle()
10-
118
import * as vscode from 'vscode'
12-
import * as localizedText from '../shared/localizedText'
139
import { getLogger } from '../shared/logger'
1410
import { showQuickPick } from '../shared/ui/pickerPrompter'
1511
import { cast, Optional } from '../shared/utilities/typeConstructors'
@@ -18,7 +14,6 @@ import { once } from '../shared/utilities/functionUtils'
1814
import { telemetry } from '../shared/telemetry/telemetry'
1915
import { createExitButton, createHelpButton } from '../shared/ui/buttons'
2016
import { isNonNullable } from '../shared/utilities/tsUtils'
21-
import { builderIdStartUrl } from './sso/model'
2217
import { CancellationError } from '../shared/utilities/timeoutUtils'
2318
import { Connection, SsoConnection, StatefulConnection } from './connection'
2419

@@ -65,22 +60,6 @@ async function promptUseNewConnection(newConn: Connection, oldConn: Connection,
6560
return resp
6661
}
6762

68-
async function promptForRescope(conn: SsoConnection, toolLabel: string) {
69-
const message = localize(
70-
'aws.auth.rescopeConnection.message',
71-
'{0} requires access to your {1} connection. Proceed to login to grant {0} access?',
72-
toolLabel,
73-
conn.startUrl === builderIdStartUrl ? localizedText.builderId() : localizedText.iamIdentityCenter
74-
)
75-
const resp = await vscode.window.showInformationMessage(message, { modal: true }, localizedText.proceed)
76-
if (resp !== localizedText.proceed) {
77-
telemetry.ui_click.emit({ elementId: 'connection_rescope_cancel' })
78-
throw new CancellationError('user')
79-
}
80-
81-
telemetry.ui_click.emit({ elementId: 'connection_rescope_proceed' })
82-
}
83-
8463
let oldConn: Auth['activeConnection']
8564
const auths = new Map<string, SecondaryAuth>()
8665
const multiConnectionListeners = new WeakMap<Auth, vscode.Disposable>()
@@ -234,7 +213,6 @@ export class SecondaryAuth<T extends Connection = Connection> {
234213
}
235214

236215
public async addScopes(conn: T & SsoConnection, extraScopes: string[]) {
237-
await promptForRescope(conn, this.toolLabel)
238216
const oldScopes = conn.scopes ?? []
239217
const newScopes = Array.from(new Set([...oldScopes, ...extraScopes]))
240218

0 commit comments

Comments
 (0)