Repository navigation
v1.1.1
Username Sanitization Enhancement
New Features
- Implemented new username sanitization functionality to handle invalid characters
- Added comprehensive validation for usernames to ensure compatibility
Improvements
- Changed username handling message from "padded" to "sanitized" for better clarity
- Moved username validation logic to a separate utility package
- Added support for handling Unicode characters, dots, and special characters
Technical Details
- Created new
username_sanitizer.goutility with the following rules:- Validates characters against pattern
[a-zA-Z0-9_-] - Replaces invalid characters with underscore
- Maintains minimum length requirement of 6 characters
- Preserves dashes and existing underscores
- Validates characters against pattern
- Added extensive test coverage for username sanitization:
- Tests for various invalid character cases
- Length validation tests
- Regular expression compliance tests
Examples
john.doe→john_doeuser@123→user_123użer123→u_er123- Short usernames (e.g.
ab) will be padded with underscores to meet minimum length
Full Changelog: v1.1.0...v1.1.1