Add Comprehensive Input Validation Middleware for Review Submissions#14
Open
HermanL0201 wants to merge 5 commits into199358a8-4bbc-457d-bb74-b89ae5096bb7from
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add Comprehensive Input Validation Middleware for Review Submissions
Description
Task
Create middleware to validate review submission data
Acceptance Criteria
Summary of Work
This pull request implements robust input validation middleware for review submissions to ensure data integrity and prevent invalid data from being processed.
Changes Made
src/middleware/validateReviewSubmission.tsproductId: Ensures a non-empty string is providedrating: Validates integer type and range (1-5)comment: Optional field with length validation (max 500 characters)title: Optional field with length validation (max 100 characters)Implementation Details
ReviewSubmissioninterface to define submission structurenext()functionValidation Rules
productId: Required, non-empty stringrating: Required integer between 1 and 5comment: Optional, max 500 characterstitle: Optional, max 100 charactersTesting Approach
Notes
Changes Made
Tests
Signatures
Staking Key
DZwmqbbKALnQYMhTLYdYeBBKVNptDMSAKQjaASJ9btgo: YbNjVw6oMQKAjJDkZmUqecovB4giK1mQeVsW2Yh1zSUWdN6e8yWo95ojjQ8M7P7KvHWnSzJ8LQQMJfhYhFQoH3epJipqakwxmVMZb6bM89w1a6ir4yaZJLDoQwvRQmyZyHXQuNQogZFXTXk9cAygAQ3wRV1m2XGReoPJGkJJXs4YtxY1tepJrdsALNaKfPdK453yfrhwHuBFGt19fQWEi21iv5WkGBSzWBNcFs1g9gJWQTark2v879MpT4tYtq2Lh6VXpxwgZvkRKbvPWq9kFFhn5F7mT4dJetHHCKfvbNe3F4vyNkKh1aZ92Xh6meDgCdqhKYUYXcYxiJ67FNneLnbUf6omSvAiCBeY9XEGTjRgQjfM1wrK81cmtVy8enjxLyXkzXe8P5AuYhFU3bNmEJTFtyMNKAwZPsJ
Public Key
4E3nQUGBiknkTFLJE6Htj3KKNnHzpxhNv2Jw5cvW4s7J: 3F9n56P9YoiVsttxRX2mj4TjDSKcrGikNFeZRWbhoyxranRBn5cjNwHf7UCBqrM41gXzZJRmJP4rzDUv1KaUsG4yLLotJiWdWTAXwdDAuGx2qVB1QC9fkzPhCMw6JBqDDjzFk42UbKPbWFdTt1ts1HdX7UrJFRXuHGCvQ4sMvnpvyqmqX9viZw567xsgHEMnN9wGgDwLLTSE7NqS4gV2GAWdd4gj49kMfD47zKwoPpW8Cksnzqj3gfRLqKqCZ1x61KiS833Tm9YYDeEZJoueqkN17MnxbHD47vUSjKzocPTf5p2svM8qnispMSY76UJfFjGt8SrR6sgZLGcZVLHEiaW7ErvW6ebBohXcXGt51pU31dRYZwSJPMW1dgzDNkzEyQCcGeBHohf9PrbgS2anvMcEjDyNpybSXGVA