mongoose-encryption
Advanced tools
Comparing version 2.0.3 to 2.1.0
# 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 |
@@ -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
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
718
135547
21