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 #43

Closed tadejgasparovic closed 4 years ago

tadejgasparovic commented 4 years ago

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

MongooseSchema.plugin(mongooseFieldEncryption, {
  secret: () => "my-super-secret-code123"
});