Skip to content

Commit 74eed93

Browse files
authored
Merge branch 'zhayujie:master' into update-0626
2 parents d02e26c + 3afd99d commit 74eed93

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

config.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -242,15 +242,15 @@ def drag_sensitive(config):
242242
conf_dict_copy = copy.deepcopy(conf_dict)
243243
for key in conf_dict_copy:
244244
if "key" in key or "secret" in key:
245-
if isinstance(key, str):
245+
if isinstance(conf_dict_copy[key], str):
246246
conf_dict_copy[key] = conf_dict_copy[key][0:3] + "*" * 5 + conf_dict_copy[key][-3:]
247247
return json.dumps(conf_dict_copy, indent=4)
248248

249249
elif isinstance(config, dict):
250250
config_copy = copy.deepcopy(config)
251251
for key in config:
252252
if "key" in key or "secret" in key:
253-
if isinstance(key, str):
253+
if isinstance(config_copy[key], str):
254254
config_copy[key] = config_copy[key][0:3] + "*" * 5 + config_copy[key][-3:]
255255
return config_copy
256256
except Exception as e:

0 commit comments

Comments
 (0)