Skip to content

Commit fb05731

Browse files
Merge staging into feature/lambda-get-started
2 parents 856c695 + d67a2a5 commit fb05731

File tree

27 files changed

+434
-599
lines changed

27 files changed

+434
-599
lines changed
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"type": "Removal",
3+
"description": "Auth: No longer share SSO sessions with AWS Toolkit."
4+
}

packages/amazonq/src/auth/util.ts

Lines changed: 0 additions & 68 deletions
This file was deleted.

packages/amazonq/src/extension.ts

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@ import { updateDevMode } from 'aws-core-vscode/dev'
1212
import { CommonAuthViewProvider } from 'aws-core-vscode/login'
1313
import { isExtensionActive, VSCODE_EXTENSION_ID } from 'aws-core-vscode/utils'
1414
import { registerSubmitFeedback } from 'aws-core-vscode/feedback'
15-
import { DevFunction } from 'aws-core-vscode/dev'
15+
import { DevOptions } from 'aws-core-vscode/dev'
16+
import { Auth } from 'aws-core-vscode/auth'
1617

1718
export async function activate(context: vscode.ExtensionContext) {
1819
// IMPORTANT: No other code should be added to this function. Place it in one of the following 2 functions where appropriate.
@@ -59,19 +60,25 @@ async function setupDevMode(context: vscode.ExtensionContext) {
5960
// TODO: Make this work in web mode and move it to extensionCommon.ts
6061
await updateDevMode()
6162

63+
const devOptions: DevOptions = {
64+
context,
65+
auth: Auth.instance,
66+
menuOptions: [
67+
'editStorage',
68+
'showEnvVars',
69+
'deleteSsoConnections',
70+
'expireSsoConnections',
71+
'editAuthConnections',
72+
],
73+
}
74+
6275
context.subscriptions.push(
6376
vscode.commands.registerCommand('amazonq.dev.openMenu', async () => {
6477
if (!isExtensionActive(VSCODE_EXTENSION_ID.awstoolkit)) {
6578
void vscode.window.showErrorMessage('AWS Toolkit must be installed to access the Developer Menu.')
6679
return
6780
}
68-
await vscode.commands.executeCommand('_aws.dev.invokeMenu', context, [
69-
'editStorage',
70-
'showEnvVars',
71-
'deleteSsoConnections',
72-
'expireSsoConnections',
73-
'editAuthConnections',
74-
] as DevFunction[])
81+
await vscode.commands.executeCommand('_aws.dev.invokeMenu', devOptions)
7582
})
7683
)
7784
}

packages/amazonq/src/extensionCommon.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import {
1010
activate as activateCodeWhisperer,
1111
shutdown as shutdownCodeWhisperer,
1212
amazonQDismissedKey,
13+
AuthUtil,
1314
} from 'aws-core-vscode/codewhisperer'
1415
import {
1516
ExtContext,
@@ -25,11 +26,10 @@ import {
2526
getLogger,
2627
getMachineId,
2728
} from 'aws-core-vscode/shared'
28-
import { initializeAuth, CredentialsStore, LoginManager, AuthUtils } from 'aws-core-vscode/auth'
29+
import { initializeAuth, CredentialsStore, LoginManager, AuthUtils, SsoConnection } from 'aws-core-vscode/auth'
2930
import { CommonAuthWebview } from 'aws-core-vscode/login'
3031
import { VSCODE_EXTENSION_ID } from 'aws-core-vscode/utils'
3132
import { telemetry, ExtStartUpSources } from 'aws-core-vscode/telemetry'
32-
import { getAuthStatus } from './auth/util'
3333
import { makeEndpointsProvider, registerGenericCommands } from 'aws-core-vscode/extensionCommon'
3434
import { registerCommands } from './commands'
3535

@@ -131,11 +131,11 @@ export async function activateAmazonQCommon(context: vscode.ExtensionContext, is
131131
telemetry.record({ source: ExtStartUpSources.reload })
132132
}
133133

134-
const { authStatus, authEnabledConnections, authScopes } = await getAuthStatus()
134+
const authState = (await AuthUtil.instance.getChatAuthState()).codewhispererChat
135135
telemetry.record({
136-
authStatus,
137-
authEnabledConnections,
138-
authScopes,
136+
authStatus: authState === 'connected' || authState === 'expired' ? authState : 'notConnected',
137+
authEnabledConnections: AuthUtils.getAuthFormIdsFromConnection(AuthUtil.instance.conn).join(','),
138+
authScopes: ((AuthUtil.instance.conn as SsoConnection)?.scopes ?? []).join(','),
139139
})
140140
})
141141
}

0 commit comments

Comments
 (0)