-
Notifications
You must be signed in to change notification settings - Fork 3.5k
v0.5.93: NextJS config changes, MCP and Blocks whitelisting, copilot keyboard shortcuts, audit logs #3241
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
v0.5.93: NextJS config changes, MCP and Blocks whitelisting, copilot keyboard shortcuts, audit logs #3241
Changes from 5 commits
61a5c98
6421b1a
0ee52df
bbcef7c
eab01e0
11f3a14
e37b4a9
7c7c0fd
e396462
86ca984
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -3,6 +3,7 @@ import { mcpServers } from '@sim/db/schema' | |
| import { createLogger } from '@sim/logger' | ||
| import { and, eq, isNull } from 'drizzle-orm' | ||
| import type { NextRequest } from 'next/server' | ||
| import { McpDomainNotAllowedError, validateMcpDomain } from '@/lib/mcp/domain-check' | ||
| import { getParsedBody, withMcpAuth } from '@/lib/mcp/middleware' | ||
| import { mcpService } from '@/lib/mcp/service' | ||
| import { | ||
|
|
@@ -72,6 +73,15 @@ export const POST = withMcpAuth('write')( | |
| ) | ||
| } | ||
|
|
||
| try { | ||
| validateMcpDomain(body.url) | ||
| } catch (e) { | ||
| if (e instanceof McpDomainNotAllowedError) { | ||
| return createMcpErrorResponse(e, e.message, 403) | ||
| } | ||
| throw e | ||
| } | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Domain validation runs on optional URLsMedium Severity Domain validation executes unconditionally on |
||
|
|
||
| const serverId = body.url ? generateMcpServerId(workspaceId, body.url) : crypto.randomUUID() | ||
|
|
||
| const [existingServer] = await db | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,14 @@ | ||
| import { NextResponse } from 'next/server' | ||
| import { getSession } from '@/lib/auth' | ||
| import { getAllowedIntegrationsFromEnv } from '@/lib/core/config/feature-flags' | ||
|
|
||
| export async function GET() { | ||
| const session = await getSession() | ||
| if (!session?.user?.id) { | ||
| return NextResponse.json({ error: 'Unauthorized' }, { status: 401 }) | ||
| } | ||
|
|
||
| return NextResponse.json({ | ||
| allowedIntegrations: getAllowedIntegrationsFromEnv(), | ||
| }) | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,27 @@ | ||
| import { NextResponse } from 'next/server' | ||
| import { getSession } from '@/lib/auth' | ||
| import { getAllowedMcpDomainsFromEnv } from '@/lib/core/config/feature-flags' | ||
| import { getBaseUrl } from '@/lib/core/utils/urls' | ||
|
|
||
| export async function GET() { | ||
| const session = await getSession() | ||
| if (!session?.user?.id) { | ||
| return NextResponse.json({ error: 'Unauthorized' }, { status: 401 }) | ||
| } | ||
|
|
||
| const configuredDomains = getAllowedMcpDomainsFromEnv() | ||
| if (configuredDomains === null) { | ||
| return NextResponse.json({ allowedMcpDomains: null }) | ||
| } | ||
|
|
||
| try { | ||
| const platformHostname = new URL(getBaseUrl()).hostname.toLowerCase() | ||
| if (!configuredDomains.includes(platformHostname)) { | ||
| return NextResponse.json({ | ||
| allowedMcpDomains: [...configuredDomains, platformHostname], | ||
| }) | ||
| } | ||
| } catch {} | ||
|
|
||
| return NextResponse.json({ allowedMcpDomains: configuredDomains }) | ||
| } |


Uh oh!
There was an error while loading. Please reload this page.