Repository navigation
web: drop the status read after Freestyle create and warm the database during auth #12260
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
Changes from all commits
451e169
6f82585
c0654fe
57d5cb5
51a5f30
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 |
|---|---|---|
|
|
@@ -2,6 +2,7 @@ | |
| // provider credentials stay behind server-side ownership checks. | ||
|
|
||
| import type { Span } from "@opentelemetry/api"; | ||
| import { preconnectCloudDb } from "../../../db/client"; | ||
| import { preconnectFreestyle } from "../../../services/vms/drivers/freestyle"; | ||
| import { | ||
| unauthorized, | ||
|
|
@@ -180,8 +181,9 @@ export async function GET(request: Request): Promise<Response> { | |
| } | ||
|
|
||
| export async function POST(request: Request): Promise<Response> { | ||
| // Warm the Freestyle connection while the caller is being verified. | ||
| // Warm the Freestyle and database connections while the caller is being verified. | ||
| preconnectFreestyle(); | ||
| preconnectCloudDb(); | ||
|
Comment on lines
+184
to
+186
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. 🩺 Stability & Availability | 🟠 Major | ⚡ Quick win Move
🤖 Prompt for AI Agents |
||
| return withAuthedVmApiRoute( | ||
| request, | ||
| "/api/vm", | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🔒 Security & Privacy | 🛡️ Analyzed with Security Review | 🟠 Major | ⚡ Quick win
🧩 Analysis chain
🏁 Script executed:
Repository: manaflow-ai/cmux
Length of output: 50372
🏁 Script executed:
Repository: manaflow-ai/cmux
Length of output: 18252
Denial of Service
Reachability: External
CWE: CWE-400 — Uncontrolled Resource Consumption
Authenticate before starting Cloud database warm-up.
Both handlers call
preconnectCloudDb()beforewithAuthedVmApiRoute. The helper callspool.connect()orselect 1, so unauthenticated request bursts can consume pooled database connection capacity.Move each call into the authenticated callback.
📍 Affects 2 files
web/app/api/vm/route.ts#L186-L186(this comment)web/app/api/vm/[id]/attach-endpoint/route.ts#L24-L24🤖 Prompt for AI Agents