procage 0.7.1

Process sandboxing for Rust on macOS (Seatbelt, without sandbox-exec) and Linux (Landlock, seccomp, namespaces)
Documentation
[package]
name = "procage"
version.workspace = true
edition.workspace = true
rust-version.workspace = true
license.workspace = true
description = "Process sandboxing for Rust on macOS (Seatbelt, without sandbox-exec) and Linux (Landlock, seccomp, namespaces)"
repository.workspace = true
readme = "../../README.md"
authors.workspace = true
keywords = ["sandbox", "seatbelt", "landlock", "seccomp", "security"]
categories = ["os::macos-apis", "os::linux-apis", "api-bindings"]
include = ["/src", "/THREAT_MODEL.md", "/LICENSE-APACHE", "/LICENSE-MIT"]

[package.metadata.docs.rs]
# Each backend is built for its own OS: render both.
default-target = "aarch64-apple-darwin"
targets = ["aarch64-apple-darwin", "x86_64-unknown-linux-gnu"]
features = ["tokio", "proxy"]

# Helpers run single-threaded, so the exec tests have their own `main`.
[[test]]
name = "exec"
path = "tests/exec.rs"
harness = false

# The proxy a cage runs per run; needs the feature.
[[test]]
name = "proxy"
path = "tests/proxy.rs"
required-features = ["proxy"]

# The async handle; needs the feature.
[[test]]
name = "tokio"
path = "tests/tokio.rs"
required-features = ["tokio"]

# Spawn timings next to a plain spawn and the tools others shell out to.
[[bench]]
name = "spawn"
harness = false

[dependencies]
# The serialised policy is what a receipt's digest is taken over.
procage-policy = { workspace = true, features = ["serde"] }
serde.workspace = true
serde_json.workspace = true
sha2.workspace = true

[target.'cfg(any(target_os = "macos", target_os = "linux"))'.dependencies]
libc.workspace = true
futures-core = { version = "0.3", default-features = false, optional = true }
tokio = { version = "1.47", default-features = false, features = ["process", "rt", "sync"], optional = true }
procage-proxy = { workspace = true, optional = true }

[features]
# Async spawn, wait and violation streams on a tokio runtime.
tokio = ["dep:tokio", "dep:futures-core"]
# An egress proxy with a domain allowlist per run (`CageOptions::with_proxy`).
proxy = ["dep:procage-proxy"]

[dev-dependencies]
tokio = { version = "1.47", default-features = false, features = ["rt-multi-thread", "io-util", "time", "process", "sync"] }

# The workspace set, except that unsafe code is denied rather than forbidden so
# that `macos::sys` and `linux::sys` alone can allow it.
[lints.rust]
unsafe_code = "deny"
missing_docs = "warn"

[lints.clippy]
all = { level = "deny", priority = -1 }
undocumented_unsafe_blocks = "deny"