Releases: ExorTek/fastify-mongo-sanitize
Releases · ExorTek/fastify-mongo-sanitize
v1.1.x
New Features
- Added email address protection - valid email addresses are now preserved during sanitization
- Introduced
removeMatches
option to completely remove matched patterns instead of replacing them - Changed default values for
allowedKeys
anddeniedKeys
fromnull
to[]
Improvements
- Optimized
sanitizeValue
function with early returns for better performance - Enhanced object sanitization with more thorough pattern matching
- Added request object cloning in
handleRequest
for safer sanitization - Fixed string length truncation to only apply to values, not keys
Bug Fixes
- Fixed string length truncation only applying to values
- Improved handling of email addresses in nested objects
- Enhanced pattern matching safety
Usage Example
const fastify = require('fastify')();
const mongoSanitize = require('@exortek/fastify-mongo-sanitize');
fastify.register(mongoSanitize, {
removeMatches: true, // New option to remove matched patterns
stringOptions: {
maxLength: 100,
trim: true
}
});
v1.0.0
What's Changed
- initial release with mongo sanitization support
- add sanitization patterns for MongoDB injection prevention
- implement auto and manual sanitization modes
- add string and array sanitization options
- support for custom sanitization patterns
Full Changelog: initial-release...v1.0.0