File tree Expand file tree Collapse file tree 2 files changed +5
-5
lines changed Expand file tree Collapse file tree 2 files changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -58,7 +58,7 @@ def spider_closed(self, spider):
5858 ]
5959 regex_list = settings .get ("MASKED_SENSITIVE_SETTINGS_REGEX_LIST" , default_regexes )
6060 for reg in regex_list :
61- updated_settings = {k : '*' * len (v ) for k , v in settings .items () if re .match (reg , k )}
61+ updated_settings = {k : '*' * len (v ) for k , v in settings .items () if re .search (reg , k )}
6262 settings = {** settings , ** updated_settings }
6363
6464 self .output_settings (settings , spider )
Original file line number Diff line number Diff line change @@ -108,8 +108,8 @@ class CustomClass:
108108def test_log_all_should_not_return_apikey_value_by_default (caplog ):
109109 settings = {
110110 "SETTINGS_LOGGING_ENABLED" : True ,
111- "APIKEY " : 'apikey_value1' ,
112- "apikey " : 'apikey_value2' ,
111+ "SHUB_APIKEY " : 'apikey_value1' ,
112+ "shub_apikey " : 'apikey_value2' ,
113113 "api_key" : 'apikey_value3' ,
114114 }
115115
@@ -118,8 +118,8 @@ def test_log_all_should_not_return_apikey_value_by_default(caplog):
118118 with caplog .at_level (logging .INFO ):
119119 logger .spider_closed (spider )
120120
121- assert '"APIKEY ": "*************"' in caplog .text
122- assert '"apikey ": "*************"' in caplog .text
121+ assert '"SHUB_APIKEY ": "*************"' in caplog .text
122+ assert '"shub_apikey ": "*************"' in caplog .text
123123 assert '"api_key": "*************"' in caplog .text
124124 assert 'apikey_value' not in caplog .text
125125
You can’t perform that action at this time.
0 commit comments