faker
faker copied to clipboard
Ability to prevent usage of some email domains
Using faker 2.22.0 (and prior) you can ask for an email address.
We would like to prevent Faker using any "dodgy" domains. Specifically one of these: https://github.com/FGRibreau/mailchecker/blob/198ab3fc99cfa35571a6858b992e6006dbdb5af7/list.txt
Can we add config (a callback?) where Faker asks "is this one of
Thanks!
hi @hlascelles could you explain more of the reason behind this proposal? Is it a security concern? Thanks!
It's a problem that has arisen during or acceptance testing. We use Faker at runtime in our test environment to generate fake data that a user (or automated test) can use to fill in forms.
We also are complying with various regulations to make sure that our customers don't choose false / throwaway email addresses. To do this we use that list of "throw away" domains and reject any customer signing up with one.
The problem is that Faker does use some of them.
So, we ask Faker for a fake email, and it creates (eg) [email protected]
, which is normally fine. But in our acceptance test flow that is rejected as a fake domain.
It would be good to tell Faker which domain names are "too fake", if you see what I mean?
hi @hlascelles thanks for providing more details. It makes sense.
The faker team has been discussing the possibility of only using safe domains here. Generally, for test data, we don't want to use real addresses anymore.
In that case, maybe you could generate random usernames and concatenate them to a list of domains that work for your usecase?
Hey @hlascelles do you think the approach @stefannibrasil suggested could work for you? If so would it be okay if we close this issue?
Aha, yes, I guess that the other bug is another side of the same coin.
OK - I'll add my comments to that. Thanks!