File tree Expand file tree Collapse file tree 2 files changed +10
-2
lines changed
aws_lambda_powertools/utilities/data_masking/provider
tests/functional/data_masking/required_dependencies Expand file tree Collapse file tree 2 files changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -128,8 +128,6 @@ def _mask_primitive(
128
128
return self ._pattern_mask (data , custom_mask )
129
129
elif dynamic_mask :
130
130
return self ._custom_erase (data )
131
- else :
132
- return DATA_MASKING_STRING
133
131
134
132
def _mask_dict (
135
133
self ,
Original file line number Diff line number Diff line change @@ -280,6 +280,16 @@ def test_erase_json_dict_with_complex_masking_rules(data_masker):
280
280
}
281
281
282
282
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
+
283
293
def test_no_matches_for_masking_rule (data_masker ):
284
294
# GIVEN a dictionary without the expected field
285
295
data = {"name" : "Ana" }
You can’t perform that action at this time.
0 commit comments