Implement profile inheritance

This commit is contained in:
2026-04-26 23:58:21 +02:00
parent 7f9b21ef4f
commit c77dbc10c3
5 changed files with 357 additions and 68 deletions
+8
View File
@@ -21,6 +21,7 @@ pub enum SandboxError {
source: toml::de::Error,
},
ProfileNotFound(String),
ProfileCycle(Vec<String>),
ConflictingMode,
ConflictingEnvKey(String),
InvalidEnvEntry(String),
@@ -65,6 +66,13 @@ impl std::fmt::Display for SandboxError {
write!(f, "cannot parse config file '{}': {source}", path.display())
}
Self::ProfileNotFound(name) => write!(f, "profile not found in config: {name}"),
Self::ProfileCycle(chain) => {
write!(
f,
"profile inheritance cycle detected: {}",
chain.join(" -> ")
)
}
Self::ConflictingMode => write!(
f,
"config section sets both blacklist and whitelist to true"