linux-sandbox: plumb split sandbox policies through helper

This commit is contained in:
Michael Bolin
2026-03-06 16:23:58 -08:00
parent e24e36ec77
commit 30aae07ce3
6 changed files with 313 additions and 47 deletions

View File

@@ -727,6 +727,22 @@ impl FromStr for SandboxPolicy {
}
}
impl FromStr for FileSystemSandboxPolicy {
type Err = serde_json::Error;
fn from_str(s: &str) -> Result<Self, Self::Err> {
serde_json::from_str(s)
}
}
impl FromStr for NetworkSandboxPolicy {
type Err = serde_json::Error;
fn from_str(s: &str) -> Result<Self, Self::Err> {
serde_json::from_str(s)
}
}
impl SandboxPolicy {
/// Returns a policy with read-only disk access and no network.
pub fn new_read_only_policy() -> Self {