From 8330372f4adbb1e7a29fe6d9bb0d49857a7ed34b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cristian=20Pallar=C3=A9s?= Date: Tue, 10 Feb 2026 12:16:11 +0100 Subject: [PATCH] feat: support all vscode-flavored editors Uses `env.uriScheme` to identify the vscode flavor and sends it along with the authentication request. --- .github/workflows/build.yml | 2 +- .github/workflows/publish.yml | 4 ++-- build/localstack-web-mock-server.mjs | 3 ++- src/utils/authenticate.ts | 1 + 4 files changed, 6 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 2b228d4..caee427 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -49,7 +49,7 @@ jobs: - name: Compile run: npx vsce package env: - LOCALSTACK_WEB_AUTH_REDIRECT: https://app.localstack.cloud/redirect?name=VSCode + LOCALSTACK_WEB_AUTH_REDIRECT: https://app.localstack.cloud/redirect NODE_ENV: ci - name: Test diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index e3f401b..f598c47 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -41,7 +41,7 @@ jobs: env: VERSION: ${{ env.VERSION }} VSCE_PAT: ${{ secrets.VSCE_PAT }} - LOCALSTACK_WEB_AUTH_REDIRECT: https://app.localstack.cloud/redirect?name=VSCode + LOCALSTACK_WEB_AUTH_REDIRECT: https://app.localstack.cloud/redirect NODE_ENV: production ANALYTICS_API_URL: https://analytics.localstack.cloud/v1/events @@ -70,6 +70,6 @@ jobs: env: VERSION: ${{ env.VERSION }} OVSX_PAT: ${{ secrets.OVSX_PAT }} - LOCALSTACK_WEB_AUTH_REDIRECT: https://app.localstack.cloud/redirect?name=VSCode + LOCALSTACK_WEB_AUTH_REDIRECT: https://app.localstack.cloud/redirect NODE_ENV: production ANALYTICS_API_URL: https://analytics.localstack.cloud/v1/events diff --git a/build/localstack-web-mock-server.mjs b/build/localstack-web-mock-server.mjs index 426e4d4..8cd0158 100644 --- a/build/localstack-web-mock-server.mjs +++ b/build/localstack-web-mock-server.mjs @@ -13,9 +13,10 @@ const server = createServer((req, res) => { // Parse the request URL const url = new URL(req.url, `http://${req.headers.host}`); const windowId = url.searchParams.get("windowId"); + const name = url.searchParams.get("name"); // Build the redirect URL - const redirectURL = new URL("vscode://localstack.localstack"); + const redirectURL = new URL(`${name}://localstack.localstack`); redirectURL.searchParams.set("windowId", windowId ?? ""); redirectURL.searchParams.set("token", process.env.LOCALSTACK_AUTH_TOKEN); diff --git a/src/utils/authenticate.ts b/src/utils/authenticate.ts index ca2cba4..496aff5 100644 --- a/src/utils/authenticate.ts +++ b/src/utils/authenticate.ts @@ -69,6 +69,7 @@ async function redirectToLocalStack(): Promise<{ cancelled: boolean }> { // TODO: Gather environment variables in a safer way - e.g. during extension activation // biome-ignore lint/style/noNonNullAssertion: false positive const url = new URL(process.env.LOCALSTACK_WEB_AUTH_REDIRECT!); + url.searchParams.set("name", env.uriScheme); url.searchParams.set("windowId", redirectSearchParams.get("windowId") ?? ""); const selection = await window.showInformationMessage(