chore: Add docker to allowed deeplink commands (#2509)

This commit is contained in:
Ben Walding
2025-05-12 19:25:05 +10:00
committed by GitHub
parent 0966d34587
commit b413849c30
4 changed files with 4 additions and 4 deletions

View File

@@ -29,7 +29,7 @@ export function getGooseInstallLink(server: MCPServer): string {
} }
const parts = server.command.split(" "); const parts = server.command.split(" ");
const baseCmd = parts[0]; // jbang, npx or uvx const baseCmd = parts[0]; // docker, jbang, npx or uvx
const args = parts.slice(1); // remaining arguments const args = parts.slice(1); // remaining arguments
const queryParams = [ const queryParams = [

View File

@@ -15,7 +15,7 @@ function getStdioConfig(
timeout: number timeout: number
) { ) {
// Validate that the command is one of the allowed commands // Validate that the command is one of the allowed commands
const allowedCommands = ['jbang', 'npx', 'uvx', 'goosed']; const allowedCommands = ['docker', 'jbang', 'npx', 'uvx', 'goosed'];
if (!allowedCommands.includes(cmd)) { if (!allowedCommands.includes(cmd)) {
toastService.handleError( toastService.handleError(
'Invalid Command', 'Invalid Command',

View File

@@ -168,7 +168,7 @@ export async function replaceWithShims(cmd: string) {
export function removeShims(cmd: string) { export function removeShims(cmd: string) {
// Only remove shims if the path matches our known shim patterns // Only remove shims if the path matches our known shim patterns
const shimPatterns = [/goosed$/, /jbang$/, /npx$/, /uvx$/]; const shimPatterns = [/goosed$/, /docker$/, /jbang$/, /npx$/, /uvx$/];
// Check if the command matches any shim pattern // Check if the command matches any shim pattern
const isShim = shimPatterns.some((pattern) => pattern.test(cmd)); const isShim = shimPatterns.some((pattern) => pattern.test(cmd));

View File

@@ -362,7 +362,7 @@ function getStdioConfig(
description: string, description: string,
parsedTimeout: number parsedTimeout: number
) { ) {
const allowedCommands = ['jbang', 'npx', 'uvx', 'goosed']; const allowedCommands = ['docker', 'jbang', 'npx', 'uvx', 'goosed'];
if (!allowedCommands.includes(cmd)) { if (!allowedCommands.includes(cmd)) {
handleError( handleError(
`Failed to install extension: Invalid command: ${cmd}. Only ${allowedCommands.join(', ')} are allowed.`, `Failed to install extension: Invalid command: ${cmd}. Only ${allowedCommands.join(', ')} are allowed.`,