-
Notifications
You must be signed in to change notification settings - Fork 6
Description
Hello!
I have been closely checking this project the last week, and I find it really good.
Total, no bullshit, easy to use, not trying to do-everything-all-at-once. Great!
So, I see you are about to add authentication with JWT, which I think is the killer feature! I believe this will make it usable in real world scenarios, even if you don't add anything else.
As after authentication comes authorization, I was wondering if and how you will manage RBAC per HTTP and Endpoint.
Specifically, applications have some kind of way to split authenticated Users into groups that can see and do different things.
Like, "Admins" can use DELETE and PUT, while "Simple" users can do only GET and HEAD.
Also, each user might need to get a different thing by the same Endpoint (such as /self or /profile).
The second case (the /self endpoint), could be implemented as a CustomEndpoint, but the first one could be handled internally and transparently.
I believe that this will differentiate your project from DB to REST projects, like sandman.
What I propose is some Global configuration (stored in the DB?), that can be explained by the following JSON:
{
"/person": {
"user": [
"GET",
"POST"
],
"admin": [
"GET",
"POST",
"PUT",
"DELETE"
]
}
"/email": {...}
}Such config, can be directly searched by the App to serve 403 Errors whenever there is a miss.
Finally, as you are now implementing JWT, you can read the Role of the user (in this example "user" and "admin", but they can be as many as you define), by the JWT claims directly.
Finally, to stay free from chasing logical RBAC Security Bugs (e.g: priv escalations, impersonations), and stay true to your purpose of prototyping a REST API, you can keep this config static.
No user can modify it nor any part of the app can mess with it (unless using reflections - but this offloads the risk from the module to the developer).
Overall, I'm impressed by this project and it's simplicity,
and I can't wait to come with an idea that needs a REST API so I can use it!
Keep up the good work!