Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
callbacks.credentials = (repoUrl, username) => {
// Forward user name to validate authentication.
return git.Cred.sshKeyFromAgent(username, ssh.publicKey, ssh.privateKey, ssh.passphrase);
};
}
credentials: function(url, username) {
// Do not try ssh-agent if password is specified
if (password) {
if (!authTrials.userpassPlaintext) {
authTrials.userpassPlaintext = true;
return NodeGit.Cred.userpassPlaintextNew(username, password);
}
} else if (!authTrials.agent) {
authTrials.agent = true;
return NodeGit.Cred.sshKeyFromAgent(username);
}
}
}
credentials: () =>
settings.url.startsWith('ssh://')
? git.Cred.sshKeyNew(settings.username, settings.publicKey, settings.privateKey, '')
: git.Cred.userpassPlaintextNew(settings.username, settings.password),
},
credentials: function (url, userName) {
if (tries > 0) {
tries -= 1;
if (!helper.isSSH(url)) {
if (!username || !password) {
window.webContents.send('Repo-CredentialIssue', {});
return NodeGit.Cred.defaultNew();
}
return NodeGit.Cred.userpassPlaintextNew(username, password);
} else {
return NodeGit.Cred.sshKeyMemoryNew(userName, settings.publicKey(), settings.privateKey(), password)
}
}
window.webContents.send('Repo-CredentialIssue', {});
return NodeGit.Cred.defaultNew();
},
certificateCheck: function () {
function(result) {
resolve(git.Cred.userpassPlaintextNew(result.username, result.password));
},
function(error) {
credentials: function() {
return nodegit.Cred.userpassPlaintextNew(argv.username, argv.password);
},
certificateCheck: function() {
): CredCb => () => Git.Cred.userpassPlaintextNew(username, password);
credentials: function(url, userName){
return NodeGit.Cred.sshKeyNew(
userName,
config.deploy.sshPublicKey,
config.deploy.sshPrivateKey,
"");
}
}
credentials: function(url, userName) {
return Git.Cred.userpassPlaintextNew(token, "x-oauth-basic");
}
}}
credentials: function(url, userName) {
return NodeGit.Cred.sshKeyNew(
userName,
config.deploy.sshPublicKey,
config.deploy.sshPrivateKey,
"");
}
}