baobabsoluciones / baobabsoluciones/cornflow
bug in api_view and permission_view updates in deployment
- Dominant language
- Python
- Stars
- 21
- Forks
- 5
- PR merge metrics
- No merged PRs in 30d
Description
**Describe the bug**
During deployment, the endpoints permissions are updated automatically depending on how they are defined in the code:
- the api_view table is updated with new endpoints.
- the permissions in permission_view are updated.
I have notices several problems with this update:
- There is no check about if an endpoint has been deleted or its permissions changed. Only new endpoints are created in api_view.
- If the project include a custom role which is not in cornflow, this role seems to be ignored when updating permissions in permission_view.
**To Reproduce**
Steps to reproduce the behavior:
1 modify the ROLES_WITH_ACCESS attribute of an endpoint
2 redeploy
3 check permission_view table. The new permission won't appear.
Second problem:
1 create a new endpoint (or change the name of an endpoint)
2 add a custom role in ROLES_WITH_ACCESS attribute
3 redeploy
4 check permission_view table. The new permission won't appear.
**Expected behavior**
Deployment should update all permissions including custom roles.
Outdated endpoints should also be deleted (this part is less important since those endpoints won't be accessed anyway)
**Metadata (please complete the following information):**
- cornflow version 1.2.1
- other libraries:
**Additional context**
Add any other context about the problem here.
Contributor guide
Research direction
Trace the deployment logic that updates the api_view and permission_view tables, focusing on endpoint ROLES_WITH_ACCESS handling. Reproduce the redeployment cases by changing permissions and adding a custom role, then verify that changed permissions and custom roles are reflected and that outdated endpoints are removed or otherwise handled as expected.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- api, authorization, database, devops
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100