yaml-adapter

Crates.ioyaml-adapter
lib.rsyaml-adapter
version1.0.0
sourcesrc
created_at2021-01-22 12:41:54.796413
updated_at2024-02-04 16:57:40.548145
descriptiona adapter which reads yaml format policy file for casbin repo
homepagehttps://github.com/casbin-rs/yaml-adapter
repositoryhttps://github.com/casbin-rs/yaml-adapter
max_upload_size
id345304
size33,232
Yang Luo (hsluoyz)

documentation

README

yaml-adapter

crates docs download ci

Yaml Adapter is a yaml adapter for Casbin-rs. With this library, Casbin can load policy from yaml fromat file or save policy into it with fully asynchronous support.

Dependency

Add following to Cargo.toml

yaml-adapter = { version = "1.0.0", features = "runtime-async-std" }
async-std = "1.5.0"

for using tokio

yaml-adapter = { version = "1.0.0", features = "runtime-tokio" }
tokio = "0.3.1"

Examples

let adapter = YamlAdapter::new("examples/rbac_policy.yaml");
let e = Enforcer::new(m, adapter).await.unwrap();

for policy file configuration, please refer to example

Commit count: 7

cargo fmt