exarch-core 0.12.0

Memory-safe archive extraction library with security validation
//! Security validation modules.

pub(crate) mod admitted;
pub(crate) mod boundary;
pub(crate) mod context;
pub(crate) mod fs_view;
pub(crate) mod hardlink;
#[cfg(any(test, feature = "testing"))]
pub(crate) mod path;
pub(crate) mod permissions;
pub(crate) mod quota;
#[cfg(any(test, feature = "testing"))]
pub(crate) mod symlink;
pub(crate) mod validator;
pub(crate) mod zipbomb;

// The proofs and values the public `EntrySink` trait and the config API carry
// must be exported ungated: a `#[cfg(feature = "testing")]` re-export (as
// `QuotaTracker` gets below) would be a private-type-in-public-interface
// compile error.
pub use quota::AdmittedSize;
pub use quota::EntryCount;
pub use quota::QuotaPermit;

pub use admitted::EntrySize;
pub use hardlink::HardlinkTarget;
pub use permissions::RawMode;
pub use permissions::SanitizedMode;
pub use zipbomb::Compressed;
pub use zipbomb::Uncompressed;

// Security primitives exposed under the `testing` feature for external
// benchmarks and integration tests that cannot access pub(crate) items.
#[cfg(feature = "testing")]
pub use hardlink::HardlinkTracker;
#[cfg(feature = "testing")]
pub use path::validate_path;
#[cfg(feature = "testing")]
pub use permissions::sanitize_permissions;
#[cfg(feature = "testing")]
pub use quota::QuotaTracker;
#[cfg(feature = "testing")]
pub use symlink::validate_symlink;
#[cfg(feature = "testing")]
pub use zipbomb::validate_compression_ratio;