Krizaka Rust

The shared base of Krizaka's Mac apps (in development): Tauri 2, Apache-2.0. Current version: 0.4.0.

§1API documentation

krizaka-rustThe rules: pure Rust, no Tauri dependency, tested on any machine. tauri-plugin-krizakaThe glue that applies the rules: commands, events, the Keychain, the native menu.

§2Use it

Not on crates.io yet: depend on the repository, at a tag.

[dependencies]
krizaka-rust = { git = "https://github.com/krizaka/krizaka-rust", tag = "v0.4.0" }
tauri-plugin-krizaka = { git = "https://github.com/krizaka/krizaka-rust", tag = "v0.4.0" }

What it guarantees, by example: a path outside the granted folder is refused (.. included).

let mut scope = ScopeStore::default();
let root = scope.grant(&documents)?;          // a folder the user granted
assert!(scope.resolve(&root.join("clients/a.pdf")).is_ok());
// outside the folder: refused, never read
let escape = root.join("clients/../../.ssh/id_ed25519");
assert!(matches!(scope.resolve(&escape), Err(ScopeError::OutsideScope(_))));
assert!(matches!(scope.resolve(Path::new("/etc/hosts")), Err(ScopeError::OutsideScope(_))));

The test it comes from (src/scope.rs)

§3Source

§4Krizaka's other open-source libraries