Skip to content

Commit 4831e9c

Browse files
Refactor previous pr. (#8893)
1 parent 480375f commit 4831e9c

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

execution.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,8 @@ def recursive_debug_dump(self):
123123
}
124124
return result
125125

126+
SENSITIVE_EXTRA_DATA_KEYS = ("auth_token_comfy_org", "api_key_comfy_org")
127+
126128
def get_input_data(inputs, class_def, unique_id, outputs=None, dynprompt=None, extra_data={}):
127129
valid_inputs = class_def.INPUT_TYPES()
128130
input_data_all = {}
@@ -1045,11 +1047,10 @@ def task_done(self, item_id, history_result,
10451047
if status is not None:
10461048
status_dict = copy.deepcopy(status._asdict())
10471049

1048-
# Remove auth tokens from extra_data before storing in history
1049-
if "auth_token_comfy_org" in prompt[3]:
1050-
del prompt[3]["auth_token_comfy_org"]
1051-
if "api_key_comfy_org" in prompt[3]:
1052-
del prompt[3]["api_key_comfy_org"]
1050+
# Remove sensitive data from extra_data before storing in history
1051+
for sensitive_val in SENSITIVE_EXTRA_DATA_KEYS:
1052+
if sensitive_val in prompt[3]:
1053+
prompt[3].pop(sensitive_val)
10531054

10541055
self.history[prompt[1]] = {
10551056
"prompt": prompt,

0 commit comments

Comments
 (0)