Implement Rust-owned adaptive Android password navigation (#96)
Android ARM verification / rust (push) Failing after 46m4s
Android ARM verification / android (push) Failing after 9s
Dependency security audit / rustsec (push) Successful in 22s

This commit is contained in:
hugo committed 2026-10-09 12:25:02 +02:00
1 parent 36e5f55283
commit 8c9341f214
26 files changed
+1553 -16

No files matched your search

+54
View File
@@ -391,6 +391,60 @@ impl Repository {
Ok(EncryptedEntry(bytes))
}
/// A non-secret object revision; navigation never opens encrypted contents.
pub(crate) fn navigation_revision(
&self,
path: &Path,
entry: bool,
) -> Result<String, RepositoryError> {
let relative = if entry {
EntryPath::parse(path)?.encrypted_relative_path()
} else {
DirectoryPath::parse(path)?.as_path().to_owned()
};
let metadata = if relative.as_os_str().is_empty() {
self.root
.dir_metadata()
.map_err(|error| io_error("inspect repository", path, error))?
} else {
let parent = self.open_directory(relative.parent().unwrap_or(Path::new("")))?;
child_metadata(
&parent,
relative.file_name().expect("relative object"),
&relative,
)?
.ok_or_else(|| RepositoryError::NotFound {
path: relative.clone(),
})?
};
if entry {
require_regular_file(metadata.clone(), &relative)?;
} else {
require_directory(metadata.clone(), &relative)?;
}
#[cfg(unix)]
{
use cap_std::fs::MetadataExt;
Ok(format!(
"{}:{}:{}:{}:{}:{}:{}",
metadata.dev(),
metadata.ino(),
metadata.len(),
metadata.mtime(),
metadata.mtime_nsec(),
if entry { metadata.ctime() } else { 0 },
if entry { metadata.ctime_nsec() } else { 0 }
))
}
#[cfg(not(unix))]
Ok(format!(
"{}:{:?}:{:?}",
metadata.len(),
metadata.modified(),
metadata.created()
))
}
pub(crate) fn read_policy_file(
&self,
directory: &DirectoryPath,