-
Couldn't load subscription status.
- Fork 0
Description
In most endpoints a user is required to provide a project and virtual lab id in the header of the request. This project context is then validated against their user groups and used to constrain queries. The rest of their user groups is ignored in the queries.
However, that context imposes a constraint (on a specific proj id) that may not be always desirable. Therefore, I propose to make the project context optional for all endpoints, except for the create ones that require it to register the entity.
To maintain backwards compatibility and stricter access to resources, when a project context is provided the behavior should remain as before, constraining all queries to the specific project context.
If not provided then the user's groups, as obtained from keycloak, should be used to determine if a user has access to a resource. Naturally, this makes the behavior of the endpoints more permissive allowing the user to perform queries with respect of all their project ids.
TLDR:
- If a user passes vlab/proj id pair in the header things will work as they used to constraining the queries into that project.
- If a user passes just their token, then the user_project_ids in the token will be used in the queries.
Draft here: #370