mirror of
https://github.com/narrrl/narl-workspace.git
synced 2026-11-19 02:45:03 +01:00
sftp: a sealed file opens while the vault is open
Decrypted a record at a time as it is read, from any offset, and sealed again when it is written into or over, in a sealed folder or not. Shut, the vault refuses the open and cuts off reads already under way. Reads over the mount do not count as use, so a mount alone does not keep the vault open.
This commit is contained in:
1 parent
fc593e6452
commit
e4e3e2b5aa
3 files changed
+345
-34
No files matched your search
@@ -446,6 +446,14 @@ impl Vault {
|
||||
}
|
||||
}
|
||||
|
||||
/// Whether the vault is open, without counting as a use that keeps it so:
|
||||
/// for a check that should not hold it open by being asked often.
|
||||
pub fn is_open(&self) -> bool {
|
||||
self.slot()
|
||||
.as_ref()
|
||||
.is_some_and(|open| open.touched.elapsed() < self.idle)
|
||||
}
|
||||
|
||||
pub fn lock(&self) {
|
||||
*self.slot() = None;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user