Conversation
Integrate the jellydator/validation library for comprehensive input validation across DTOs and use case layers, with custom validation rules for password strength, email format, and whitespace handling. Changes: - Add jellydator/validation v1.2.0 dependency - Create internal/validation package with custom validation rules: - PasswordStrength: configurable password complexity validation - Email: regex-based email format validation - NoWhitespace: prevent leading/trailing whitespace - NotBlank: ensure non-empty strings after trimming - WrapValidationError: helper to convert validation errors to domain errors - Update RegisterUserRequest DTO validation with: - Name: required, not blank, 1-255 characters - Email: required, valid format, 5-255 characters - Password: 8-128 chars, uppercase, lowercase, number, special character - Update use case input validation with same comprehensive rules - Validation errors wrapped as domain ErrInvalidInput (422 status) - Add comprehensive test suite for all validation rules (100% coverage) - Update test fixtures to use valid passwords meeting new requirements - Update README.md with: - Input validation feature in features list - Validation package in project structure - Password requirements and validation error examples in usage section - New "Input Validation" section with detailed documentation - jellydator/validation in dependencies and acknowledgments Benefits: - Declarative and type-safe validation rules - Reusable custom validators across the application - Consistent validation at DTO and use case layers - User-friendly error messages for API clients - Enhanced security with password strength requirements - Better data quality with format and constraint validation
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.
Integrate the jellydator/validation library for comprehensive input validation across DTOs and use case layers, with custom validation rules for password strength, email format, and whitespace handling.
Changes:
Benefits: