I have a design question and hope to become a bit wiser.
I am writing an API in ASP.NET Core and the API allows users to login. Users can gain admin status which other admins can do. (A default admin is made if there are none) To be able to reset passwords and for some other features I will be adding I want to be able to send emails to users.
To send those emails I obviously need SMTP credentials and I would need to store those somewhere. Aside from storing that I also want to have some global preferences I want to save such as server name and server location string.
I came up with 2 ideas to store this information.
- Storing them in SQL as a table with 1 row with all the information.
- Storing them in a JSON file in the root directory of the application.
The problem with solution 2 is that I also want admins to be able to change those settings using API requests. I know I can change JSON from code but I was wondering what the best practice would be here. And if there is an advantage over one or another. Security?
Aucun commentaire:
Enregistrer un commentaire