shell_tunnel/fs/mod.rs
1//! Filesystem access, confined to a configured root.
2//!
3//! Placed at the crate root rather than under `security/` because the jail is
4//! not a check that sits beside file access — it is the only way file access
5//! happens. Filing it with the other validators would invite the reading that
6//! it can be bypassed.
7
8pub mod platform;
9pub mod root;
10pub mod sha256;
11pub mod transfer;
12pub mod tree;
13
14pub use root::{FsError, FsRoot};
15pub use transfer::{
16 sweep_orphan_parts, sweep_orphan_parts_in, FinishedUpload, UploadError, UploadStore,
17 DEFAULT_CHUNK_SIZE, MAX_CHUNK_SIZE, RELAY_CHUNK_SIZE, SESSION_TTL,
18};
19pub use tree::{remove_tree, TreeOutcome};
20
21/// Directory under the root where in-flight uploads are staged.
22///
23/// Declared here rather than beside the upload store because two unrelated
24/// callers need it — `list` must hide it, and the transfer layer must create it
25/// — and a second copy of the name is a rename waiting to go wrong.
26pub const UPLOAD_DIR: &str = ".shell-tunnel-uploads";