adding real username and pwd keys (#3607)
This commit is contained in:
@@ -187,6 +187,28 @@ class Block(BaseModel, abc.ABC):
|
|||||||
template_data = workflow_run_context.values.copy()
|
template_data = workflow_run_context.values.copy()
|
||||||
if workflow_run_context.include_secrets_in_templates:
|
if workflow_run_context.include_secrets_in_templates:
|
||||||
template_data.update(workflow_run_context.secrets)
|
template_data.update(workflow_run_context.secrets)
|
||||||
|
|
||||||
|
# Create easier-to-access entries for credentials
|
||||||
|
# Look for credential parameters and create real_username/real_password entries
|
||||||
|
# First collect all credential parameters to avoid modifying dict during iteration
|
||||||
|
credential_params = []
|
||||||
|
for key, value in template_data.items():
|
||||||
|
if isinstance(value, dict) and "context" in value and "username" in value and "password" in value:
|
||||||
|
credential_params.append((key, value))
|
||||||
|
|
||||||
|
# Now add the real_username/real_password entries
|
||||||
|
for key, value in credential_params:
|
||||||
|
username_secret_id = value.get("username", "")
|
||||||
|
password_secret_id = value.get("password", "")
|
||||||
|
|
||||||
|
# Get the actual values from the secrets
|
||||||
|
real_username = template_data.get(username_secret_id, "")
|
||||||
|
real_password = template_data.get(password_secret_id, "")
|
||||||
|
|
||||||
|
# Add easier-to-access entries
|
||||||
|
template_data[f"{key}_real_username"] = real_username
|
||||||
|
template_data[f"{key}_real_password"] = real_password
|
||||||
|
|
||||||
if self.label in template_data:
|
if self.label in template_data:
|
||||||
current_value = template_data[self.label]
|
current_value = template_data[self.label]
|
||||||
if isinstance(current_value, dict):
|
if isinstance(current_value, dict):
|
||||||
|
|||||||
Reference in New Issue
Block a user