p47h-engine 0.11.1

Core engine for p47h governance - pure library, no WASM artifact
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
use core_policy::Resource;
use p47h_engine::parse_resource;

#[test]
fn test_parse_resource() {
    assert!(matches!(parse_resource("*"), Resource::All));
    assert!(matches!(parse_resource("file:/docs/*"), Resource::File(_)));
    assert!(matches!(parse_resource("usb:device1"), Resource::Usb(_)));
    assert!(matches!(parse_resource("tunnel:vpn"), Resource::Tunnel(_)));
    assert!(matches!(
        parse_resource("api:/users"),
        Resource::Custom { .. }
    ));
    assert!(matches!(
        parse_resource("/unqualified/path"),
        Resource::File(_)
    ));
}