Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit b649e7d

Browse files
authored
fix(site): allow Antigravity IDE token substitution (#28784) (#28841)
1 parent c539ca5 commit b649e7d

2 files changed

Lines changed: 19 additions & 0 deletions

File tree

site/src/modules/apps/apps.test.ts

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,24 @@ describe("getAppHref", () => {
8585
expect(href).toBe("vscode://example.com?token=user-session-token");
8686
});
8787

88+
it("replaces the session token for Antigravity IDE URLs", () => {
89+
const externalApp = {
90+
...MockWorkspaceApp,
91+
external: true,
92+
url: `antigravity-ide://coder.coder-remote/open?token=${SESSION_TOKEN_PLACEHOLDER}`,
93+
};
94+
const href = getAppHref(externalApp, {
95+
host: "*.apps-host.tld",
96+
path: "/path-base",
97+
agent: MockWorkspaceAgent,
98+
workspace: MockWorkspace,
99+
token: "user-session-token",
100+
});
101+
expect(href).toBe(
102+
"antigravity-ide://coder.coder-remote/open?token=user-session-token",
103+
);
104+
});
105+
88106
it("doesn't return the URL with the session token replaced when using the HTTP protocol", () => {
89107
const externalApp = {
90108
...MockWorkspaceApp,

site/src/modules/apps/apps.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ const ALLOWED_EXTERNAL_APP_PROTOCOLS = [
2626
"kiro:",
2727
"positron:",
2828
"antigravity:",
29+
"antigravity-ide:",
2930
];
3031

3132
type GetVSCodeHrefParams = {

0 commit comments

Comments
 (0)