diff --git a/docs/api-docs/api-docs.yml b/docs/api-docs/api-docs.yml index 2d4c5436..5316f870 100644 --- a/docs/api-docs/api-docs.yml +++ b/docs/api-docs/api-docs.yml @@ -193,7 +193,7 @@ paths: type: string example: "mask" example: - ["fpe", "hash", "mask", "redact", "replace"] + ["hash", "mask", "redact", "replace"] /health: diff --git a/e2e-tests/tests/test_anonymizer.py b/e2e-tests/tests/test_anonymizer.py index 58bbfdf8..613e4439 100644 --- a/e2e-tests/tests/test_anonymizer.py +++ b/e2e-tests/tests/test_anonymizer.py @@ -101,7 +101,7 @@ def test_given_anonymizers_called_then_expected_anonymizers_list_returned(): response_status, response_content = anonymizers() expected_response = """ - ["fpe", "hash", "mask", "redact", "replace"] + ["hash", "mask", "redact", "replace"] """ assert response_status == 200 diff --git a/presidio-anonymizer/README.MD b/presidio-anonymizer/README.MD index cfdc7642..c3c8b9c2 100644 --- a/presidio-anonymizer/README.MD +++ b/presidio-anonymizer/README.MD @@ -176,5 +176,5 @@ No paramaters are required. Response sample: ```json -["fpe", "hash", "mask", "redact", "replace"] +["hash", "mask", "redact", "replace"] ``` diff --git a/presidio-anonymizer/presidio_anonymizer/anonymizers/__init__.py b/presidio-anonymizer/presidio_anonymizer/anonymizers/__init__.py index 9188850e..c4270485 100644 --- a/presidio-anonymizer/presidio_anonymizer/anonymizers/__init__.py +++ b/presidio-anonymizer/presidio_anonymizer/anonymizers/__init__.py @@ -1,6 +1,5 @@ """Initializing all the existing anonymizers.""" from .anonymizer import Anonymizer -from .fpe import FPE from .hash import Hash from .mask import Mask from .redact import Redact @@ -8,7 +7,6 @@ from .replace import Replace __all__ = [ "Anonymizer", - "FPE", "Hash", "Mask", "Redact", diff --git a/presidio-anonymizer/presidio_anonymizer/anonymizers/fpe.py b/presidio-anonymizer/presidio_anonymizer/anonymizers/fpe.py deleted file mode 100644 index cffdb2c7..00000000 --- a/presidio-anonymizer/presidio_anonymizer/anonymizers/fpe.py +++ /dev/null @@ -1,31 +0,0 @@ -""" -Format Preserving encryption for PII text entities. - -Uses FF1 algorithm for the encryption. -""" -from presidio_anonymizer.anonymizers import Anonymizer - - -# TODO implement + test -class FPE(Anonymizer): - """ - FPE - Format Preserving Encryption. - - PII text will be replaced with a format preserving encryption using FF1 algorithm. - """ - - def anonymize(self, text: str = None, params: dict = None) -> str: - """Return anonymized text using FF1 algorithm.""" - old_text = params.get("old_text") - decrypt = params.get("decrypt") - tweak = params.get("tweak") - key = params.get("key") - return old_text + decrypt + tweak + key - - def validate(self, params: dict = None) -> None: - """TODO: [ADO-2547] docstring.""" - pass - - def anonymizer_name(self) -> str: - """Return anonymizer name.""" - return "fpe" diff --git a/presidio-anonymizer/tests/anonymizers/test_anonymizer.py b/presidio-anonymizer/tests/anonymizers/test_anonymizer.py index 3da2786c..e39065bf 100644 --- a/presidio-anonymizer/tests/anonymizers/test_anonymizer.py +++ b/presidio-anonymizer/tests/anonymizers/test_anonymizer.py @@ -3,6 +3,6 @@ from presidio_anonymizer.anonymizers import Anonymizer def test_given_anonymizers_list_then_all_classes_are_there(): anonymizers = Anonymizer.get_anonymizers() - assert len(anonymizers) >= 5 - for class_name in ["hash", "mask", "redact", "replace", "fpe"]: + assert len(anonymizers) >= 4 + for class_name in ["hash", "mask", "redact", "replace"]: assert anonymizers.get(class_name) diff --git a/presidio-anonymizer/tests/test_anonymizer_config.py b/presidio-anonymizer/tests/test_anonymizer_config.py index d0b2e522..bd4d8c64 100644 --- a/presidio-anonymizer/tests/test_anonymizer_config.py +++ b/presidio-anonymizer/tests/test_anonymizer_config.py @@ -7,7 +7,7 @@ from presidio_anonymizer.entities import AnonymizerConfig, InvalidParamException # fmt: off "class_name", [ - "fpe", "hash", "mask", "redact", "replace" + "hash", "mask", "redact", "replace" ], # fmt: on ) diff --git a/presidio-anonymizer/tests/test_anonymizer_engine.py b/presidio-anonymizer/tests/test_anonymizer_engine.py index 82a59b58..8fe4d5a5 100644 --- a/presidio-anonymizer/tests/test_anonymizer_engine.py +++ b/presidio-anonymizer/tests/test_anonymizer_engine.py @@ -9,7 +9,7 @@ from presidio_anonymizer.entities import AnonymizerConfig, InvalidParamException def test_given_request_anonymizers_return_list(): engine = AnonymizerEngine() - expected_list = ["fpe", "hash", "mask", "redact", "replace"] + expected_list = ["hash", "mask", "redact", "replace"] anon_list = engine.get_anonymizers() assert anon_list == expected_list