Skip to content

Commit

Permalink
Use userObj.username and not .name for ssh key lookup
Browse files Browse the repository at this point in the history
Closes #2109
  • Loading branch information
knolleary committed Apr 2, 2019
1 parent 63829b6 commit fbec803
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand All @@ -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");
Expand Down

0 comments on commit fbec803

Please sign in to comment.