-
-
Notifications
You must be signed in to change notification settings - Fork 74
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Model proc-macro WIP example #74
Comments
Hi, I saw your work and it was great. Just wondering, what do you think is the necessity of this approach at this stage? Since you mentioned diesel, I have some other ideas. For example
|
It would move a lot of code from runtime to being compile time checked. Removing the |
@DevinR528 I think some day we really need a modeling language for casbin so that things can be verified and validated and converted to the correct format. |
One of the more interesting features of rust are proc-macro's, I have wondered if it was possible to use a diesel style "schema" generator to create the
Model
and by doing so create a type that can hold policy lines and have this also used inenforce
possibly? This example is more a proof of concept to start a conversation about this feature.I created a repo with a minimal-ish example
Casbin-proc-macro
Questions
Is it even wanted?
How would this be integrated without breaking existing code or have a simple upgrade path ?
Any other thoughts
Advantages
Policy
struct and the function to compare a request to a policyrhai
this is maybe a positive not sure about the trade offsThe text was updated successfully, but these errors were encountered: