Skip to content

Commit 27339a6

Browse files
authored
fix(amazonq): update Client Name, User Agent #4710
1 parent 280f48a commit 27339a6

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

packages/core/src/auth/sso/ssoAccessTokenProvider.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -321,7 +321,7 @@ export class DeviceFlowAuthorization extends SsoAccessTokenProvider {
321321
override async registerClient(): Promise<ClientRegistration> {
322322
const companyName = getIdeProperties().company
323323
return this.oidc.registerClient({
324-
clientName: isCloud9() ? `${companyName} Cloud9` : `${companyName} Toolkit for VSCode`,
324+
clientName: isCloud9() ? `${companyName} Cloud9` : `${companyName} IDE Extensions for VSCode`,
325325
clientType: clientRegistrationType,
326326
scopes: this.profile.scopes,
327327
})
@@ -387,7 +387,8 @@ class AuthFlowAuthorization extends SsoAccessTokenProvider {
387387
override async registerClient(): Promise<ClientRegistration> {
388388
const companyName = getIdeProperties().company
389389
return this.oidc.registerClient({
390-
clientName: isCloud9() ? `${companyName} Cloud9` : `${companyName} Toolkit for VSCode`,
390+
// All AWS extensions (Q, Toolkit) for a given IDE use the same client name.
391+
clientName: isCloud9() ? `${companyName} Cloud9` : `${companyName} IDE Extensions for VSCode`,
391392
clientType: clientRegistrationType,
392393
scopes: this.profile.scopes,
393394
grantTypes: [authorizationGrantType, refreshGrantType],

packages/core/src/shared/telemetry/util.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ import { Result } from './telemetry.gen'
1616
import { MetricDatum } from './clienttelemetry'
1717
import { isValidationExemptMetric } from './exemptMetrics'
1818
import { isCloud9, isSageMaker } from '../../shared/extensionUtilities'
19+
import { VSCODE_EXTENSION_ID } from '../utilities'
1920

2021
const legacySettingsTelemetryValueDisable = 'Disable'
2122
const legacySettingsTelemetryValueEnable = 'Enable'
@@ -77,7 +78,10 @@ export async function getUserAgent(
7778
opt?: { includePlatform?: boolean; includeClientId?: boolean },
7879
globalState = globals.context.globalState
7980
): Promise<string> {
80-
const pairs = [`AWS-Toolkit-For-VSCode/${extensionVersion}`]
81+
const pairs =
82+
globals.context.extension.id === VSCODE_EXTENSION_ID.amazonq
83+
? [`AmazonQ-For-VSCode/${extensionVersion}`]
84+
: [`AWS-Toolkit-For-VSCode/${extensionVersion}`]
8185

8286
if (opt?.includePlatform) {
8387
pairs.push(platformPair())

0 commit comments

Comments
 (0)