tomassirio / ListBot

ListBot is a Discord Bot which let's you create community lists on each channel.
https://discord.io/siriobots
MIT License
24 stars 49 forks source link

[ENCRYPTION] Integrate the encrypt.js file as a middleware to optimize project #109

Open AldoTu opened 3 years ago

AldoTu commented 3 years ago

:)

Apurva-Singh commented 3 years ago

Hey @AldoTu I would like to work on it. Please can you provide more deatils? Thanks!

tomassirio commented 3 years ago

@AldoTu think you can introduce @Apurva-Singh to the encryption middleware?

AldoTu commented 3 years ago

Hi @Apurva-Singh! What we want to do is to use the encrypt.js script inside the utils folder to encrypt the DB. We got to the conclusion that we should apply the script directly in the DB models so what I'm looking for is to execute the script as a middleware every time there's interaction with the models.

aaronzshey commented 3 years ago

Some resources that I found: https://mongoosejs.com/docs/plugins.html https://thecodebarbarian.com/2015/03/06/guide-to-mongoose-plugins

We might be able to use Schema.post or something to manipulate the values after they're put in.

aaronzshey commented 3 years ago

114