Skip to content
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

Currently, lacks input validation for creating new trains. #15

Open
SHUBHAMRAJPUT9665 opened this issue May 11, 2024 · 4 comments
Open
Assignees

Comments

@SHUBHAMRAJPUT9665
Copy link

image
@SHUBHAMRAJPUT9665 SHUBHAMRAJPUT9665 changed the title Currently, our application lacks input validation for creating new trains. This leaves us vulnerable to potential issues such as invalid or malicious data being entered into our database. To improve the robustness and security of our application, I propose implementing input validation middleware for train creation routes. Proposed Changes: Introduce input validation middleware using the express-validator library to validate the train_name, source, destination, and total_seats fields. Ensure that total_seats is a positive integer and that source and destination are different. Return appropriate error responses with descriptive error messages when validation fails. Integrate the validation middleware into the addTrain route handler to validate incoming requests before processing them. Currently, lacks input validation for creating new trains. May 11, 2024
@Mayank2808sharma
Copy link
Owner

@SHUBHAMRAJPUT9665
I have assigned it you go ahead

@SHUBHAMRAJPUT9665
Copy link
Author

done

@SHUBHAMRAJPUT9665
Copy link
Author

@SHUBHAMRAJPUT9665 I have assigned it you go ahead

done

@SHUBHAMRAJPUT9665
Copy link
Author

my pull request has not been merged yet

@SHUBHAMRAJPUT9665 I have assigned it you go ahead

my PR has not been merged yet

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants