feat: 通过 Host 日志同步类型化任务记录
This commit is contained in:
@@ -5,6 +5,9 @@ use std::{collections::HashSet, fs, io::Read, path::Path};
|
||||
use uuid::Uuid;
|
||||
/// File transport only. Logical records receive their own versioned whitelist separately.
|
||||
pub fn allowed(path: &str) -> bool {
|
||||
if crate::records::is_record(path) {
|
||||
return crate::records::allowed(path);
|
||||
}
|
||||
let parts: Vec<_> = path.split('/').collect();
|
||||
if parts.iter().any(|part| {
|
||||
part.starts_with('.')
|
||||
@@ -100,6 +103,9 @@ impl Workspace {
|
||||
if bytes.len() > 104857600 {
|
||||
return Err(HostError::new("FILE_TOO_LARGE"));
|
||||
}
|
||||
if crate::records::is_record(&path) {
|
||||
crate::records::validate(&path, &bytes)?;
|
||||
}
|
||||
let digest = hash(&bytes);
|
||||
let previous = self.entry(&path)?;
|
||||
let observed: Option<(String, String, bool)> = if let Some(entry) = &previous {
|
||||
|
||||
Reference in New Issue
Block a user