-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Add an authorization middleware that supports ACL, RBAC based on casbin. #939
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
Conversation
|
@xqbumu I appreciate your contribution to the project. The only concern is external dependencies and this was one of the reason I moved cookbook examples to |
|
Hi @vishr, Casbin's external dep is only one: github.com/Knetic/govaluate See here: https://godoc.org/github.com/casbin/casbin?imports |
|
@xqbumu Thanks for the information. What do you think about renaming the prefix Updated: I will also need some help to update middleware docs https://github.com/labstack/echox/tree/master/website/content/middleware - you can also provide a link to your docs as learn more. |
fix some coveralls check. change test file with new rule. renaming the prefix Authz to CasbinAuth use built-in SetBasicAuth method in test file. export all casbin auth configs.
1 similar comment
|
@xqbumu Will get it reviewed soon. |
|
@vishr thank you |
|
@xqbumu Thanks for your contribution. |
|
@xqbumu I have moved casbin middlware to https://github.com/labstack/echo-contrib/tree/master/casbin. Please review in case if I have missed something. |
|
Hi @vishr , I found that the link you provided (https://github.com/labstack/echo-contrib/tree/master/casbin) is 404 for me: any possible causes? Thanks. |
|
It works now, thanks! |

Add an authorization plugin that supports ACL, RBAC based on casbin.
It requires the built-in HTTP basic authentication by default, so the authz can get the user name and enforce the access control.
Test is also added in authz_test.go.
This PR is to solve: #931