mirror of
https://github.com/pchuan98/codex.git
synced 2026-07-01 00:31:56 +08:00
The Windows sandbox did not previously support multiple workspace roots via config. Now it does
18 lines
671 B
Rust
18 lines
671 B
Rust
use anyhow::Result;
|
|
pub use codex_protocol::protocol::SandboxPolicy;
|
|
|
|
pub fn parse_policy(value: &str) -> Result<SandboxPolicy> {
|
|
match value {
|
|
"read-only" => Ok(SandboxPolicy::ReadOnly),
|
|
"workspace-write" => Ok(SandboxPolicy::new_workspace_write_policy()),
|
|
"danger-full-access" => anyhow::bail!("DangerFullAccess is not supported for sandboxing"),
|
|
other => {
|
|
let parsed: SandboxPolicy = serde_json::from_str(other)?;
|
|
if matches!(parsed, SandboxPolicy::DangerFullAccess) {
|
|
anyhow::bail!("DangerFullAccess is not supported for sandboxing");
|
|
}
|
|
Ok(parsed)
|
|
}
|
|
}
|
|
}
|