From fa6d9c9b18309de6a511874aab88ddb507a67cfa Mon Sep 17 00:00:00 2001 From: Rile Ge Date: Mon, 30 Jun 2025 13:58:12 -0700 Subject: [PATCH] fix: remove the depedency of the CDN js script. 1. update the commonAuthViewProvider to use the locally bundled vue.js, instead of to load the vue.js from CDN. 2. this going to resolve the customer request that When customer is trying to login to IDC via Q they are hitting a URL which is not part of the whitelist urls as per [documentation](https://docs.aws.amazon.com/amazonq/latest/qdeveloper-ug/firewall.html) --- packages/core/scripts/build/copyFiles.ts | 5 +++++ packages/core/src/login/webview/commonAuthViewProvider.ts | 6 +++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/packages/core/scripts/build/copyFiles.ts b/packages/core/scripts/build/copyFiles.ts index e926a6d9963..6a4131172ba 100644 --- a/packages/core/scripts/build/copyFiles.ts +++ b/packages/core/scripts/build/copyFiles.ts @@ -31,6 +31,11 @@ const tasks: CopyTask[] = [ { target: path.join('src', 'testFixtures') }, { target: 'src/auth/sso/vue' }, + // Vue.js for webviews + { + target: path.join('../../node_modules', 'vue', 'dist', 'vue.global.prod.js'), + destination: path.join('libs', 'vue.min.js'), + }, // SSM { target: path.join('../../node_modules', 'aws-ssm-document-language-service', 'dist', 'server.js'), diff --git a/packages/core/src/login/webview/commonAuthViewProvider.ts b/packages/core/src/login/webview/commonAuthViewProvider.ts index f805d7cf759..8ad5c71bcd1 100644 --- a/packages/core/src/login/webview/commonAuthViewProvider.ts +++ b/packages/core/src/login/webview/commonAuthViewProvider.ts @@ -148,6 +148,10 @@ export class CommonAuthViewProvider implements WebviewViewProvider { const entrypoint = serverHostname !== undefined ? Uri.parse(serverHostname).with({ path: `/${this.source}` }) : scriptUri + // Get Vue.js from dist/libs directory + const vueUri = Uri.joinPath(assetsPath, 'dist', 'libs', 'vue.min.js') + const vueScript = webview.asWebviewUri(vueUri) + return ` @@ -158,7 +162,7 @@ export class CommonAuthViewProvider implements WebviewViewProvider { Base View Extension - +