Filters: Make them in a universal format, easily shared among other clients and servers #880
gustavonmartins
started this conversation in
Ideas
Replies: 1 comment
-
It is a neat idea. But I don't think CASBIN is expressive enough (e.g. how would I pass in event tags as arrays of arrays of strings, and how could a policy file loop over those) compared to a scripting language. Also clients are quite different. I have things like 'caller' and 'spamsafe' which wouldn't necessarily make sense in other clients. I have been asked to use Lua instead of Rhai, but Rhai was surprisingly easy for me to implement. It all happened super fast so I stuck with it. But I am open to more thinking in this space. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi, I have recently learned that you use a policy file, which you name "filter", with the extension .rhai.
I was thinking that this policy file could be made universal among other projects by the usage of a human-like language.
There is one lib which is implemented in many, many languages, and allows exactly that: creating policies.
The lib is called CASBIN.
You can see some pre-made examples with ACL policy, RBAC, etc on this playground:
https://casbin.org/editor/
This lib works for Rust, Golang, Java, C/C++, Node.JS, Frontend JS, PHP, Python, Ruby, Elixir, you name it!
Beta Was this translation helpful? Give feedback.
All reactions