From 042028fb5fa7f3ae5f164317b6c268a20c816dd1 Mon Sep 17 00:00:00 2001 From: Ricardo Espinoza Date: Thu, 12 Nov 2020 13:23:55 -0500 Subject: [PATCH] :zap: Add private key and passphrase fields to SFTP credentials (#1136) * :zap: Add private key and passphrase fields to credentials * :zap: Small improvement --- .../credentials/Sftp.credentials.ts | 22 +++++++++++++++++++ packages/nodes-base/nodes/Ftp.node.ts | 2 ++ 2 files changed, 24 insertions(+) diff --git a/packages/nodes-base/credentials/Sftp.credentials.ts b/packages/nodes-base/credentials/Sftp.credentials.ts index 5c7dd2122c..93f1e0dec4 100644 --- a/packages/nodes-base/credentials/Sftp.credentials.ts +++ b/packages/nodes-base/credentials/Sftp.credentials.ts @@ -38,5 +38,27 @@ export class Sftp implements ICredentialType { }, default: '', }, + { + displayName: 'Private Key', + name: 'privateKey', + required: true, + type: 'string' as NodePropertyTypes, + typeOptions: { + alwaysOpenEditWindow: true, + }, + default: '', + description: 'String that contains a private key for either key-based or hostbased user authentication (OpenSSH format).', + }, + { + displayName: 'Passphrase', + name: 'passphrase', + typeOptions: { + password: true, + }, + required: true, + type: 'string' as NodePropertyTypes, + default: '', + description: 'For an encrypted private key, this is the passphrase used to decrypt it', + }, ]; } diff --git a/packages/nodes-base/nodes/Ftp.node.ts b/packages/nodes-base/nodes/Ftp.node.ts index c71b096bf7..dacbd40a5d 100644 --- a/packages/nodes-base/nodes/Ftp.node.ts +++ b/packages/nodes-base/nodes/Ftp.node.ts @@ -288,6 +288,8 @@ export class Ftp implements INodeType { port: credentials.port as number, username: credentials.username as string, password: credentials.password as string, + privateKey: credentials.privateKey as string | undefined, + passphrase: credentials.passphrase as string | undefined, }); } else {