From fbec803129a0a065deebb3d76e7165861594bd0b Mon Sep 17 00:00:00 2001 From: Nick O'Leary Date: Tue, 2 Apr 2019 14:06:37 +0100 Subject: [PATCH] Use userObj.username and not .name for ssh key lookup Closes #2109 --- .../runtime/lib/storage/localfilesystem/projects/Project.js | 4 ++-- .../runtime/lib/storage/localfilesystem/projects/git/index.js | 2 ++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/packages/node_modules/@node-red/runtime/lib/storage/localfilesystem/projects/Project.js b/packages/node_modules/@node-red/runtime/lib/storage/localfilesystem/projects/Project.js index 86fd13775..7ba3bd2f3 100644 --- a/packages/node_modules/@node-red/runtime/lib/storage/localfilesystem/projects/Project.js +++ b/packages/node_modules/@node-red/runtime/lib/storage/localfilesystem/projects/Project.js @@ -35,8 +35,8 @@ var authCache = require("./git/authCache"); // TODO: DRY - red/api/editor/sshkeys ! function getSSHKeyUsername(userObj) { var username = '__default'; - if ( userObj && userObj.name ) { - username = userObj.name; + if ( userObj && userObj.username ) { + username = userObj.username; } return username; } diff --git a/packages/node_modules/@node-red/runtime/lib/storage/localfilesystem/projects/git/index.js b/packages/node_modules/@node-red/runtime/lib/storage/localfilesystem/projects/git/index.js index 05780f392..b9f114698 100644 --- a/packages/node_modules/@node-red/runtime/lib/storage/localfilesystem/projects/git/index.js +++ b/packages/node_modules/@node-red/runtime/lib/storage/localfilesystem/projects/git/index.js @@ -76,6 +76,7 @@ function runGitCommand(args,cwd,env,emit) { }) } function runGitCommandWithAuth(args,cwd,auth,emit) { + log.trace("runGitCommandWithAuth "+JSON.stringify(auth).replace(/("pass.*?"\s*:\s*").+?"/g,'$1[hidden]"')); return authResponseServer(auth).then(function(rs) { var commandEnv = clone(process.env); commandEnv.GIT_ASKPASS = path.join(__dirname,"node-red-ask-pass.sh"); @@ -93,6 +94,7 @@ function runGitCommandWithAuth(args,cwd,auth,emit) { } function runGitCommandWithSSHCommand(args,cwd,auth,emit) { + log.trace("runGitCommandWithSSHCommand "+JSON.stringify(auth).replace(/("pass.*?"\s*:\s*").+?"/g,'$1[hidden]"')); return sshResponseServer(auth).then(function(rs) { var commandEnv = clone(process.env); commandEnv.SSH_ASKPASS = path.join(__dirname,"node-red-ask-pass.sh");