Skip to content

Releases: ExorTek/fastify-mongo-sanitize

v1.1.x

11 Nov 21:12
Compare
Choose a tag to compare

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 and deniedKeys from null 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

11 Nov 20:13
d7ce689
Compare
Choose a tag to compare

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