code4romania / de-urgenta-backend

De Urgență backend - web & mobile
https://de-urgenta-backend.vercel.app/
Mozilla Public License 2.0
10 stars 21 forks source link

added throttling for register method to prevent batch e-mail checks +… #154

Closed Alexei000 closed 2 years ago

Alexei000 commented 2 years ago

… return http error status code on already existing e-mail

What does it fix?

Closes #61

This tries to allow the API to inform the client(s) that an e-mail is already used, but prevent a malicious actor from checking many e-mail addresses. This is done by using IP rate-limiting via AspNetCoreRateLimit library.

However, I am not sure about returning a Conflict response for existing e-mails. The alternative would be returning OK, but this requires a breaking change for the response payload model since now it is just a string.

How has it been tested?

Currently, I have performed only some manual checks and it works as expected.