From 1719fd5b76e3353098b64ac48d43c809de8803c6 Mon Sep 17 00:00:00 2001 From: Jan Oberhauser Date: Tue, 24 Aug 2021 23:50:22 +0200 Subject: [PATCH] :sparkles: Add backend expression support for credentials --- packages/core/src/NodeExecuteFunctions.ts | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/packages/core/src/NodeExecuteFunctions.ts b/packages/core/src/NodeExecuteFunctions.ts index 582f5ac1ca..9135729db2 100644 --- a/packages/core/src/NodeExecuteFunctions.ts +++ b/packages/core/src/NodeExecuteFunctions.ts @@ -403,7 +403,13 @@ export async function getCredentials(workflow: Workflow, node: INode, type: stri } as ICredentialsExpressionResolveValues; } - const name = node.credentials[type]; + let name = node.credentials[type]; + + if (name.charAt(0) === '=') { + // If the credential name is an expression resolve it + const additionalKeys = getAdditionalKeys(additionalData) + name = workflow.expression.getParameterValue(name, runExecutionData || null, runIndex || 0, itemIndex || 0, node.name, connectionInputData || [], mode, additionalKeys) as string; + } const decryptedDataObject = await additionalData.credentialsHelper.getDecrypted(name, type, mode, false, expressionResolveValues);