capsec 0.2.2

Compile-time capability-based security for Rust
Documentation
1
2
3
4
5
6
7
8
9
/// capsec::fs::read_to_string requires Has<FsRead>, not Has<NetConnect>.
/// Passing the wrong capability type must fail.
use capsec::prelude::*;

fn main() {
    let root = capsec::root();
    let net_cap = root.grant::<NetConnect>();
    let _ = capsec::fs::read_to_string("/etc/passwd", &net_cap);
}