Skip to content

Commit cba411e

Browse files
Removing unnecessary code
1 parent fcab0c5 commit cba411e

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

aws_lambda_powertools/utilities/data_masking/provider/base.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -128,8 +128,6 @@ def _mask_primitive(
128128
return self._pattern_mask(data, custom_mask)
129129
elif dynamic_mask:
130130
return self._custom_erase(data)
131-
else:
132-
return DATA_MASKING_STRING
133131

134132
def _mask_dict(
135133
self,

tests/functional/data_masking/required_dependencies/test_erase_data_masking.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -280,6 +280,16 @@ def test_erase_json_dict_with_complex_masking_rules(data_masker):
280280
}
281281

282282

283+
def test_dynamic_mask_with_string(data_masker):
284+
# GIVEN the data type is a json representation of a dictionary with nested and filtered paths
285+
data = "XYZEKDEDE"
286+
287+
masked_json_string = data_masker.erase(data=data, dynamic_mask=True)
288+
289+
# THEN the result should have all specified fields masked according to their rules
290+
assert masked_json_string == "*********"
291+
292+
283293
def test_no_matches_for_masking_rule(data_masker):
284294
# GIVEN a dictionary without the expected field
285295
data = {"name": "Ana"}

0 commit comments

Comments
 (0)