casbin / casbin-rs

An authorization library that supports access control models like ACL, RBAC, ABAC in Rust.
https://casbin.org
Apache License 2.0
852 stars 72 forks source link

Support policy.csv comment or YAML file adapter #213

Closed hsluoyz closed 3 years ago

hsluoyz commented 3 years ago

See: https://github.com/whamcloud/integrated-manager-for-lustre/pull/2442#discussion_r544421774

We can easily support # as comment grammar in CSV, but the disadvantage is that comment is actually not a part of CSV standard.

Maybe a YAML file adapter would be better. We need to create a new repo for the code, see: https://github.com/casbin-rs/yaml-adapter

Can anyone work on this to fulfill the customer's need?

hsluoyz commented 3 years ago

@hackerchai @PsiACE

/cc @GopherJ

hsluoyz commented 3 years ago

Hi @nlinker @mkpankov

Which way do you prefer?

  1. "#" as comment grammar in CSV (like in Python)
  2. YAML file adapter
nlinker commented 3 years ago

Hi @nlinker @mkpankov

Which way do you prefer?

  1. "#" as comment grammar in CSV (like in Python)
  2. YAML file adapter

Thank you for asking this, I'd have YAML adapter. The additional advantages for YAML are:

hsluoyz commented 3 years ago

@closetool plz take a look at this issue

hsluoyz commented 3 years ago

Hi @nlinker @mkpankov

I think the YAML adapter is basically finished and released to crates.io, can you try it and verify whether it works for you? https://github.com/casbin-rs/yaml-adapter

nlinker commented 3 years ago

Hi @nlinker @mkpankov

I think the YAML adapter is basically finished and released to crates.io, can you try it and verify whether it works for you? https://github.com/casbin-rs/yaml-adapter

Thank you, Yang Luo! Just FYI: the authorization PR for IML was closed because it has been moved to the Whamcloud's internal repository. It is awesome to see, how prompt the developers of casbin-rs are!