mirror of
https://github.com/chriswritescode-dev/opencode-manager.git
synced 2026-12-06 21:04:23 +01:00
fix(sandbox): harden enforcement validation and backup handling
This commit is contained in:
1 parent
f315dda3f3
commit
0481160f5e
13 files changed
+180
-101
No files matched your search
@@ -1,4 +1,4 @@
|
||||
import { isRecord, sanitizeConfigForEnforcement } from './enforcement-config'
|
||||
import { isProvablyRemoteMcpEntry, isRecord, sanitizeConfigForEnforcement } from './enforcement-config'
|
||||
|
||||
export type SandboxProxyDecision = { blocked: true; reason: string } | { blocked: false }
|
||||
|
||||
@@ -158,14 +158,7 @@ export function decideSandboxMcpAddBody(
|
||||
reason: `${SANDBOX_CONFIG_MUTATION_REASON_PREFIX}the MCP server body must be a JSON object`,
|
||||
}
|
||||
}
|
||||
const config = parsed.config
|
||||
if (
|
||||
!isRecord(config) ||
|
||||
config.type !== 'remote' ||
|
||||
typeof config.url !== 'string' ||
|
||||
config.command !== undefined ||
|
||||
config.environment !== undefined
|
||||
) {
|
||||
if (!isProvablyRemoteMcpEntry(parsed.config)) {
|
||||
return {
|
||||
kind: 'reject',
|
||||
reason: `${SANDBOX_CONFIG_MUTATION_REASON_PREFIX}only remote MCP servers can be added while enforcement is active`,
|
||||
|
||||
Reference in new issue
Block a user