wheresvic / mongoose-field-encryption

A simple symmetric encryption plugin for individual fields. Dependency free, only mongoose peer dependency.
MIT License
74 stars 32 forks source link

Add secret factory for defering salt generation/loading #44

Closed tadejgasparovic closed 4 years ago

tadejgasparovic commented 4 years ago

Adds the option to pass a factory function for the secret. E.g.:

MongooseSchema.plugin(fieldEncryption, {
  secret: () => "my-super-secret-code123"
});
wheresvic commented 4 years ago

Looks great, thanks for contributing!