codeuino / social-platform-donut-backend

Donut API:
http://donut-api-prod.codeuino.org/
GNU General Public License v3.0
24 stars 57 forks source link

Add server side validation. #56

Open AuraOfDivinity opened 4 years ago

AuraOfDivinity commented 4 years ago

Describe the enhancement you'd like Currently, there is no server-side validation implemented. Adding server-side validation would mean,

1) The validation cannot be bypassed unlike in the client-side validation. 2) Unwanted data can be completely eliminated.

Describe approaches if you have thought of any The express validator middleware will be used to implement server-side validation. 1) Validating middleware will be integrated into the routes section. 2) The returning validation result object off of the above middleware will then be checked for any errors.

Additional context I will be working on this issue.

AuraOfDivinity commented 4 years ago

@devesh-verma Just saw that the data is validated at the respective schemas. In that case, the addition of this might not be required. Would like to hear out your opinion!