fix: validate spawn delegation authority

This commit is contained in:
2026-06-12 17:10:59 +09:00
parent ee508f707f
commit c04b1ca289
6 changed files with 69 additions and 10 deletions
+9 -1
View File
@@ -5,7 +5,7 @@
use std::path::{Path, PathBuf};
use std::sync::{LazyLock, Mutex, MutexGuard};
use manifest::{Permission, ScopeRule};
use manifest::{DelegationScope, Permission, ScopeConfig, ScopeRule};
use session_store::SegmentId;
use crate::table::LockFileGuard;
@@ -88,6 +88,14 @@ pub(crate) fn read_rule(path: &str, recursive: bool) -> ScopeRule {
}
}
pub(crate) fn delegation_scope(rules: Vec<ScopeRule>) -> DelegationScope {
DelegationScope::from_config(&ScopeConfig {
allow: rules,
deny: Vec::new(),
})
.expect("test delegation scope")
}
pub(crate) fn sock(name: &str) -> PathBuf {
PathBuf::from(format!("/tmp/{name}.sock"))
}