-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
59d33c6
commit 1535ccd
Showing
3 changed files
with
297 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,6 +9,31 @@ History | |
* Added the following new values to the ``/payment/processor`` validation: | ||
* ``pxp_financial`` | ||
* ``trustpay`` | ||
* Equivalent domain names are now normalized when `hash_address` is used. | ||
For example, `googlemail.com` will become `gmail.com`. | ||
* Periods are now removed from `gmail.com` email address local parts when | ||
`hash_address` is used. For example, `[email protected]` will become | ||
`[email protected]`. | ||
* Fastmail alias subdomain email addresses are now normalized when | ||
`hash_address` is used. For example, `[email protected]` will | ||
become `[email protected]`. | ||
* Additional `yahoo.com` email addresses now have aliases removed from | ||
their local part when `hash_address` is used. For example, | ||
`[email protected]` will become `[email protected]` for additional | ||
`yahoo.com` domains. | ||
* Duplicate `.com`s are now removed from email domain names when | ||
`hash_address` is used. For example, `example.com.com` will become | ||
`example.com`. | ||
* Extraneous characters after `.com` are now removed from email domain | ||
names when `hash_address` is used. For example, `example.comfoo` will | ||
become `example.com`. | ||
* Certain `.com` typos are now normalized to `.com` when `hash_address` is | ||
used. For example, `example.cam` will become `example.com`. | ||
* Additional `gmail.com` domain names with leading digits are now | ||
normalized when `hash_address` is used. For example, `100gmail.com` will | ||
become `gmail.com`. | ||
* Additional `gmail.com` typos are now normalized when `hash_address` is | ||
used. For example, `gmali.com` will become `gmail.com`. | ||
|
||
2.9.0 (2023-12-05) | ||
++++++++++++++++++ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,10 @@ | ||
import unittest | ||
|
||
from minfraud.request import maybe_hash_email, clean_credit_card | ||
from minfraud.request import ( | ||
maybe_hash_email, | ||
clean_credit_card, | ||
_clean_email, | ||
) | ||
|
||
|
||
class TestRequest(unittest.TestCase): | ||
|
@@ -191,3 +195,38 @@ def test_clean_credit_card(self): | |
clean_credit_card(transaction) | ||
|
||
self.assertEqual(test["expected"], transaction) | ||
|
||
|
||
def test_clean_email(): | ||
tests = [ | ||
{"input": "", "output": None}, | ||
{"input": "fasfs", "output": None}, | ||
{"input": "test@gmail", "output": "test@gmail"}, | ||
{"input": "e4d909c290d0fb1ca068ffaddf22cbd0", "output": None}, | ||
{"input": "Test@maxmind", "output": "test@maxmind"}, | ||
{"input": "[email protected]", "output": "[email protected]"}, | ||
{"input": "[email protected]", "output": "[email protected]"}, | ||
{"input": "[email protected]", "output": "[email protected]"}, | ||
{"input": "[email protected]", "output": "[email protected]"}, | ||
{"input": "[email protected]", "output": "[email protected]"}, | ||
{"input": " [email protected]", "output": "[email protected]"}, | ||
{"input": "[email protected]|abc124472372", "output": "[email protected]"}, | ||
{"input": "[email protected]", "output": "[email protected]"}, | ||
{"input": "[email protected]", "output": "[email protected]"}, | ||
{"input": "[email protected]", "output": "[email protected]"}, | ||
{"input": "[email protected]", "output": "[email protected]"}, | ||
{"input": "[email protected]", "output": "[email protected]"}, | ||
{"input": "Test+alias@bücher.com", "output": "[email protected]"}, | ||
{"input": "[email protected]", "output": "[email protected]"}, | ||
{"input": "[email protected]", "output": "[email protected]"}, | ||
{"input": "[email protected]", "output": "[email protected]"}, | ||
{"input": "[email protected]", "output": "[email protected]"}, | ||
{"input": "[email protected]", "output": "[email protected]"}, | ||
{"input": "[email protected]", "output": "[email protected]"}, | ||
{"input": "[email protected]", "output": "[email protected]"}, | ||
{"input": "[email protected]", "output": "[email protected]"}, | ||
] | ||
|
||
for test in tests: | ||
got = _clean_email(test["input"]) | ||
assert test["output"] == got |