Meteor-Community-Packages / meteor-collection2

A Meteor package that extends Mongo.Collection to provide support for specifying a schema and then validating against that schema when inserting and updating.
https://packosphere.com/aldeed/collection2
MIT License
1.02k stars 108 forks source link

FLE-Encryption #431

Closed danyhiol closed 3 years ago

danyhiol commented 3 years ago

MongoDB from version 4.2 offers the possibility to run encryption at field level in order to secure some data on the server. It would be nice if that could be incorporated into this package or at least if there is a document on how to do such using this package maybe together with SimpleSchema2. When researching, I found this package and this one that already to the same, but outside of the schema.

harryadel commented 3 years ago

Collection2 ultimate goal is to ensure consistent data according to the attached schema, so encrypting and decrypting fields seems out of hand but Collection2 shouldn't get in your way if you'd wish to do so. I recommend that you check out custom and autovalue. You can manipulate the storage using checks like isInsert, isUpdate and many more.

danyhiol commented 3 years ago

@harryadel indeed one can make use of custom and autoValue when inserting the data. But this means that one has to find another way (out of the schema) to decrypt the data. In that case, since my app is using graphql, i'll be using direcives for that purpose. Thanks for the hint.

harryadel commented 3 years ago

Feel free to reopen if the problem still exists. Thank you.