Remove phase vocabulary from Lazaret interfaces

This commit is contained in:
ms2k 2026-07-18 22:35:48 +09:00
commit e7dd95aea6
3 changed files with 547 additions and 579 deletions

View file

@ -128,12 +128,12 @@ impl fmt::Debug for SandboxLayoutV1 {
}
impl SandboxLayoutV1 {
/// Builds the closed destination set supplied by production sandbox-layout construction.
/// Builds the closed destination set supplied by default sandbox-layout construction.
///
/// # Errors
/// Every destination must be a normalized absolute non-root sandbox path and the set must
/// include `/workspace`.
pub fn from_production_layout(
pub fn from_protected_destinations(
destinations: impl IntoIterator<Item = String>,
) -> Result<Self, ConfigurationError> {
let mut protected_destinations = BTreeSet::new();

View file

@ -1,4 +1,4 @@
#![doc = "Shared production interfaces for Lazaret processes."]
#![doc = "Shared interfaces for Lazaret processes."]
pub mod codec;
pub mod configuration;

View file

@ -58,7 +58,7 @@ fn write_configuration(tree: &TestTree, body: &str) -> PathBuf {
}
fn layout() -> SandboxLayoutV1 {
SandboxLayoutV1::from_production_layout([
SandboxLayoutV1::from_protected_destinations([
"/workspace".to_owned(),
"/proc".to_owned(),
"/sys".to_owned(),
@ -187,14 +187,14 @@ volumes = [{ host = "/source", container = "/root/source", kind = "socket" }]
#[test]
fn sandbox_layout_is_closed_normalized_and_requires_workspace() {
assert!(SandboxLayoutV1::from_production_layout(["/proc".into()]).is_err());
assert!(SandboxLayoutV1::from_protected_destinations(["/proc".into()]).is_err());
assert!(
SandboxLayoutV1::from_production_layout(["/workspace".into(), "/workspace".into()])
SandboxLayoutV1::from_protected_destinations(["/workspace".into(), "/workspace".into()])
.is_err()
);
for invalid in ["workspace", "/", "/workspace/", "/workspace/../control"] {
assert!(
SandboxLayoutV1::from_production_layout(["/workspace".into(), invalid.into(),])
SandboxLayoutV1::from_protected_destinations(["/workspace".into(), invalid.into(),])
.is_err()
);
}