From 3eb86ff8b745c036a792dd5faab3313a9f4973bc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Filip=20Tron=C3=AD=C4=8Dek?= Date: Tue, 10 Oct 2023 19:22:18 +0200 Subject: [PATCH] Add cursor as an OAuth client (#18864) * Add cursor as an OAuth client * Template it --- components/server/src/oauth-server/db.ts | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/components/server/src/oauth-server/db.ts b/components/server/src/oauth-server/db.ts index e93f1c9d59c6f6..026b4d00af032d 100644 --- a/components/server/src/oauth-server/db.ts +++ b/components/server/src/oauth-server/db.ts @@ -57,12 +57,10 @@ const jetBrainsGateway: OAuthClient = { ], }; -function createVSCodeClient(protocol: "vscode" | "vscode-insiders" | "vscodium"): OAuthClient { +function createVSCodeClient(protocol: string, displayName: string): OAuthClient { return { - id: protocol + "-" + "gitpod", - name: `VS${protocol === "vscodium" ? "Codium" : " Code"}${ - protocol === "vscode-insiders" ? " Insiders" : "" - }: Gitpod extension`, + id: `${protocol}-gitpod`, + name: `${displayName}: Gitpod extension`, redirectUris: [protocol + "://gitpod.gitpod-desktop/complete-gitpod-auth"], allowedGrants: ["authorization_code"], scopes: [ @@ -110,9 +108,11 @@ const desktopClient: OAuthClient = { ], }; -const vscode = createVSCodeClient("vscode"); -const vscodeInsiders = createVSCodeClient("vscode-insiders"); -const vscodium = createVSCodeClient("vscodium"); +const vscode = createVSCodeClient("vscode", "VS Code"); +const vscodeInsiders = createVSCodeClient("vscode-insiders", "VS Code Insiders"); + +const vscodium = createVSCodeClient("vscodium", "VSCodium"); +const cursor = createVSCodeClient("cursor", "Cursor"); export const inMemoryDatabase: InMemory = { clients: { @@ -121,6 +121,7 @@ export const inMemoryDatabase: InMemory = { [vscode.id]: vscode, [vscodeInsiders.id]: vscodeInsiders, [vscodium.id]: vscodium, + [cursor.id]: cursor, [desktopClient.id]: desktopClient, }, tokens: {},