Planifica / encryption

Client-Side Encryption for Mongo Collections
https://atmospherejs.com/planifica/encryption
MIT License
36 stars 5 forks source link

Encrypt on Insert? #15

Open dguedry opened 7 years ago

dguedry commented 7 years ago

Really cool solution. Are inserts into collections not encrypted? Updates encrypt just fine, but when initially inserting, I get plain text on the server-side collection. Thanks.

dguedry commented 7 years ago

Turns out that the following statement was evaluating to true in CollectionEncryption:

if (self.schema && !Match.test(doc, self.schema)) { // if the document does not match the schema we stop before encrypting // since collection2 will deny the db insert anyway return doc; }

I commented it out and the inserts are being encrypted now.