-
-
Notifications
You must be signed in to change notification settings - Fork 207
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
Route Guard mechanism #123
Comments
I don't quite understand the feature you said, can you give example actix code about it? |
https://docs.rs/actix-web/3.3.3/actix_web/guard/index.html |
It looks like Router's filter. In salvo, Router::get, Router::post... are just filter. |
Seems like the correct solution. |
|
is it possible to have routes guard/grant by roles some thing like https://crates.io/crates/actix-web-grants |
Filter is not supports async in current version. Router::with_path("aaa").push(Router::with_hoop(check).path("bb")) |
For anyone interested: https://github.com/DDtKey/protect-endpoints now supports |
Middleware can be deployed for authentication. However having route guard type of mechanism can help greatly in organizing authorization code.
Implement additional guard on routes
Similar functionality is already available in Actix which helps a lot in properly organizing the authorization logic. At the point of route guard processing, the user might already have authenticated and the the guard only decides if the user can access the route based on the data in the request.
The text was updated successfully, but these errors were encountered: