|
@@ -256,11 +256,10 @@ class Workflow(Base):
|
|
|
|
|
|
# decrypt secret variables value
|
|
|
def decrypt_func(var):
|
|
|
- return (
|
|
|
- var.model_copy(update={"value": encrypter.decrypt_token(tenant_id=tenant_id, token=var.value)})
|
|
|
- if isinstance(var, SecretVariable)
|
|
|
- else var
|
|
|
- )
|
|
|
+ if isinstance(var, SecretVariable):
|
|
|
+ return var.model_copy(update={"value": encrypter.decrypt_token(tenant_id=tenant_id, token=var.value)})
|
|
|
+ else:
|
|
|
+ return var
|
|
|
|
|
|
results = list(map(decrypt_func, results))
|
|
|
return results
|
|
@@ -286,11 +285,10 @@ class Workflow(Base):
|
|
|
|
|
|
# encrypt secret variables value
|
|
|
def encrypt_func(var):
|
|
|
- return (
|
|
|
- var.model_copy(update={"value": encrypter.encrypt_token(tenant_id=tenant_id, token=var.value)})
|
|
|
- if isinstance(var, SecretVariable)
|
|
|
- else var
|
|
|
- )
|
|
|
+ if isinstance(var, SecretVariable):
|
|
|
+ return var.model_copy(update={"value": encrypter.encrypt_token(tenant_id=tenant_id, token=var.value)})
|
|
|
+ else:
|
|
|
+ return var
|
|
|
|
|
|
encrypted_vars = list(map(encrypt_func, value))
|
|
|
environment_variables_json = json.dumps(
|