Skip to content

Commit 6842c80

Browse files
committed
switch to oidc client name
1 parent e6fbe80 commit 6842c80

File tree

3 files changed

+8
-8
lines changed

3 files changed

+8
-8
lines changed

packages/amazonq/src/lsp/client.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import { registerInlineCompletion } from '../app/inline/completion'
1111
import { AmazonQLspAuth, encryptionKey, notificationTypes } from './auth'
1212
import { AuthUtil } from 'aws-core-vscode/codewhisperer'
1313
import { ConnectionMetadata } from '@aws/language-server-runtimes/protocol'
14-
import { ResourcePaths, Settings, clientName, createServerOptions, globals } from 'aws-core-vscode/shared'
14+
import { ResourcePaths, Settings, oidcClientName, createServerOptions, globals } from 'aws-core-vscode/shared'
1515

1616
const localize = nls.loadMessageBundle()
1717

@@ -48,7 +48,7 @@ export async function startLanguageServer(extensionContext: vscode.ExtensionCont
4848
name: env.appName,
4949
version: version,
5050
extension: {
51-
name: clientName(),
51+
name: oidcClientName(),
5252
version: '0.0.1',
5353
},
5454
clientId: crypto.randomUUID(),

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ import { AwsLoginWithBrowser, AwsRefreshCredentials, telemetry } from '../../sha
2626
import { indent, toBase64URL } from '../../shared/utilities/textUtilities'
2727
import { AuthSSOServer } from './server'
2828
import { CancellationError, sleep } from '../../shared/utilities/timeoutUtils'
29-
import { clientName, isAmazonQ } from '../../shared/extensionUtilities'
29+
import { oidcClientName, isAmazonQ } from '../../shared/extensionUtilities'
3030
import { randomBytes, createHash } from 'crypto'
3131
import { localize } from '../../shared/utilities/vsCodeUtils'
3232
import { randomUUID } from '../../shared/crypto'
@@ -440,7 +440,7 @@ export class DeviceFlowAuthorization extends SsoAccessTokenProvider {
440440
override async registerClient(): Promise<ClientRegistration> {
441441
return this.oidc.registerClient(
442442
{
443-
clientName: clientName(),
443+
clientName: oidcClientName(),
444444
clientType: clientRegistrationType,
445445
scopes: this.profile.scopes,
446446
},
@@ -545,7 +545,7 @@ class AuthFlowAuthorization extends SsoAccessTokenProvider {
545545
return this.oidc.registerClient(
546546
{
547547
// All AWS extensions (Q, Toolkit) for a given IDE use the same client name.
548-
clientName: clientName(),
548+
clientName: oidcClientName(),
549549
clientType: clientRegistrationType,
550550
scopes: this.profile.scopes,
551551
grantTypes: [authorizationGrantType, refreshGrantType],
@@ -654,7 +654,7 @@ class WebAuthorization extends SsoAccessTokenProvider {
654654
return this.oidc.registerClient(
655655
{
656656
// All AWS extensions (Q, Toolkit) for a given IDE use the same client name.
657-
clientName: clientName(),
657+
clientName: oidcClientName(),
658658
clientType: clientRegistrationType,
659659
scopes: this.profile.scopes,
660660
grantTypes: [authorizationGrantType, refreshGrantType],

packages/core/src/shared/extensionUtilities.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,8 @@ export function productName() {
4949
}
5050

5151
/** Gets the client name stored in oidc */
52-
export const clientName = once(_clientName)
53-
function _clientName() {
52+
export const oidcClientName = once(_oidcClientName)
53+
function _oidcClientName() {
5454
const companyName = getIdeProperties().company
5555
return isCloud9() ? `${companyName} Cloud9` : `${companyName} IDE Extensions for VSCode`
5656
}

0 commit comments

Comments
 (0)