feat(base.py): add logic to detect api keys in FrontendNode fields

This commit is contained in:
Gabriel Almeida 2023-04-25 12:04:03 -03:00 • committed by Gabriel Luiz Freitas Almeida
commit c14fb1eac3

View file

@ -228,3 +228,7 @@ class FrontendNode(BaseModel):
field.required = False
if field.value is None:
field.value = ""
# If the field.name contains api or api and key, then it might be an api key
# other conditions are to make sure that it is not an input or output variable
if "api" in key.lower() and "key" in key.lower():
field.required = False