Skip to content

Commit fa6d9c9

Browse files
committed
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)
1 parent bfdb0eb commit fa6d9c9

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

packages/core/scripts/build/copyFiles.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,11 @@ const tasks: CopyTask[] = [
3131
{ target: path.join('src', 'testFixtures') },
3232
{ target: 'src/auth/sso/vue' },
3333

34+
// Vue.js for webviews
35+
{
36+
target: path.join('../../node_modules', 'vue', 'dist', 'vue.global.prod.js'),
37+
destination: path.join('libs', 'vue.min.js'),
38+
},
3439
// SSM
3540
{
3641
target: path.join('../../node_modules', 'aws-ssm-document-language-service', 'dist', 'server.js'),

packages/core/src/login/webview/commonAuthViewProvider.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,10 @@ export class CommonAuthViewProvider implements WebviewViewProvider {
148148
const entrypoint =
149149
serverHostname !== undefined ? Uri.parse(serverHostname).with({ path: `/${this.source}` }) : scriptUri
150150

151+
// Get Vue.js from dist/libs directory
152+
const vueUri = Uri.joinPath(assetsPath, 'dist', 'libs', 'vue.min.js')
153+
const vueScript = webview.asWebviewUri(vueUri)
154+
151155
return `
152156
<!DOCTYPE html>
153157
<html lang="en">
@@ -158,7 +162,7 @@ export class CommonAuthViewProvider implements WebviewViewProvider {
158162
<title>Base View Extension</title>
159163
</head>
160164
<body>
161-
<script src="https://cdnjs.cloudflare.com/ajax/libs/vue/3.4.4/vue.global.prod.min.js"></script>
165+
<script src="${vueScript.toString()}"></script>
162166
<script>
163167
const vscode = acquireVsCodeApi();
164168
</script>

0 commit comments

Comments
 (0)