-
Notifications
You must be signed in to change notification settings - Fork 2
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
Limit token access to certain API endpoints / parameters and HTTP methods #45
Comments
See #48 for an example use case. Another use cases might be:
|
mentioned in issue web#145 |
I started working on it in the branch After reviewing the code, I realized that it makes more sense to limit the token to a specific role rather than an API endpoint/route + method. |
In GitLab by @skolen on Nov 24, 2020, 12:10 Could you push your branch so that I can have a look? The role of a user defines its access rights to a great extent. We could introduce a default "SharingUser" with the role "Guest" and add an endpoint that returns an access token for the SharingUser instead of the requesting user. The rights of Guest users are tailored so that they cannot change anything in the DB. What do you think about this idea? |
I briefly checked the code. It seems to me that there are only a handful of locations where the I like the idea of a "SharingUser". But I would rather call it "Service". One thing I realized when looking at the code: I would try to eliminate the CtxUserRole from the global context and replace it by permissions. What do you think? |
Or we simply inherit the UserID claim from the user who generated the token. So we have service tokens with a limited reduced set of permissions which are derived from the user permissions. |
So all users can create tokens as long as the new tokens don't gain additional permissions. |
In GitLab by @skolen on Dec 3, 2020, 14:03 Maybe I don't fully get what you mean... The role of a user is associated with a set of CRUD permissions (at least one set of permissions for each route package). Admin role has full access for example and guest role mostly only read access. Currently, the user role ( We can add a "Service" role that has very limited CRUD permissions only for specific endpoints. If I get your point, this is close to how you are suggesting to do it. Right? |
mentioned in issue web#309 |
In GitLab by @skolen on Nov 25, 2021, 15:35 Is this still a feature that we should implement? |
Allow the creation of tokens whose scope is limited to e.g.:
GET
ing/files/1234
(useful for sharing results)PUT
ing/results/123124/file
(useful for VILLAScontroller to upload results)The text was updated successfully, but these errors were encountered: