mirror of
https://github.com/narrrl/narl-workspace.git
synced 2026-11-19 10:45:03 +01:00
vault: a sealed folder stays sealed
`:encrypt` on a folder sealed the files in it once; whatever arrived afterwards was plaintext. A folder or space that is encrypted now carries `sealed` (0015), and so does every folder under it, so "is this place sealed?" is one column of the parent. What lands there is sealed on the way in, or refused with 423 while the vault is shut: - uploads, with or without `?encrypt`, encrypted as they stream - imports, sealed where they lie before any row names them - SFTP writes, sealed out of their `.part`, and refused at the open when the vault is shut - files and folders moved in, through the web or SFTP: seal::enter seals them first and the move happens only if that worked Triggers make it hold for any path: a folder made inside a sealed one is sealed, and a file node whose media is not encrypted cannot be inserted into or moved into a sealed folder (a 400, not a 500). Decrypting the sealed folder lifts the flag on its subtree and opens its files; a file or folder inside it cannot be decrypted on its own. An empty folder can be sealed. Documents are not files and stay as they are. The list shows a lock on sealed folders, the touch menu offers to unseal one, and an upload or import into one asks for the vault password first. Tests cover sealing, inheritance, the trigger, moves with the vault open and shut, unsealing, an SFTP write and an import.
This commit is contained in:
1 parent
1ae0665206
commit
889f99f8d6
15 files changed
+659
-39
No files matched your search
@@ -450,6 +450,16 @@ impl Vault {
|
||||
*self.slot() = None;
|
||||
}
|
||||
|
||||
/// Open with a key as it is, skipping Argon2, for tests of what an open
|
||||
/// vault allows.
|
||||
#[cfg(test)]
|
||||
pub fn open_with(&self, key: Key) {
|
||||
*self.slot() = Some(Unlocked {
|
||||
key: Arc::new(key),
|
||||
touched: Instant::now(),
|
||||
});
|
||||
}
|
||||
|
||||
/// Drop the key once it has gone unused past the idle time. Without this
|
||||
/// a vault nobody looks at would only notice it should be shut on the
|
||||
/// next look, with the key sitting in memory all the while.
|
||||
|
||||
Reference in new issue
Block a user