In the current state of the server, we have to check in every controller that the resources in the path match (ex: /apps/:app_id/envs/:env_id have to check that the env id is corresponding to the app id).
In order to handle those checks easily, create a macro automate them in the controllers or as a router function.
Also automate corresponding checks in the unit tests.
Technical recommandation
I think that a plug in the router could be the best way to automate that.
Is this task linked with any other ?
Unit test checking that kind of things have been added to the next issue resolution:
What should be done
In the current state of the server, we have to check in every controller that the resources in the path match (ex:
/apps/:app_id/envs/:env_id
have to check that the env id is corresponding to the app id).In order to handle those checks easily, create a macro automate them in the controllers or as a router function.
Also automate corresponding checks in the unit tests.
Technical recommandation
I think that a plug in the router could be the best way to automate that.
Is this task linked with any other ?
Unit test checking that kind of things have been added to the next issue resolution:
https://github.com/lenra-io/server/issues/532#issuecomment-1902619605