Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

mongoose-encryption

Package Overview
Dependencies
Maintainers
1
Versions
28
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

mongoose-encryption - npm Package Compare versions

Comparing version 2.0.3 to 2.1.0

6

CHANGELOG.md
# Release Notes
## v2.1.0
2021-04-03
- Support for large documents under Node v15
- Add CI testing for latest stable Node version
- Remove support for Node v4 & v6
## v2.0.3

@@ -4,0 +10,0 @@ 2020-11-29

23

lib/plugins/mongoose-encryption.js

@@ -334,13 +334,20 @@ 'use strict';

cipher.end(jsonToEncrypt, 'utf-8', function() {
// add ciphertext to document
that._ct = Buffer.concat([VERSION_BUF, iv, cipher.read()]);
cipher.write(jsonToEncrypt);
cipher.end();
// remove encrypted fields from cleartext
encryptedFields.forEach(function(field){
setFieldValue(that, field, undefined);
});
var chunk, chunks = [];
while ((chunk = cipher.read()) !== null) {
chunks.push(chunk);
}
var encrypted = Buffer.concat(chunks);
cb(null);
// add ciphertext to document
that._ct = Buffer.concat([VERSION_BUF, iv, Buffer.from(encrypted, 'utf8')]);
// remove encrypted fields from cleartext
encryptedFields.forEach(function(field){
setFieldValue(that, field, undefined);
});
cb(null);
});

@@ -347,0 +354,0 @@ };

{
"name": "mongoose-encryption",
"description": "Simple encryption and authentication plugin for Mongoose",
"version": "2.0.3",
"version": "2.1.0",
"author": {

@@ -6,0 +6,0 @@ "name": "Joe Goldbeck"

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc