How to use the nodegit.Cred function in nodegit

To help you get started, we’ve selected a few nodegit examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github blond / nodegit-clone / lib / clone.js View on Github external
callbacks.credentials = (repoUrl, username) => {
            // Forward user name to validate authentication.
            return git.Cred.sshKeyFromAgent(username, ssh.publicKey, ssh.privateKey, ssh.passphrase);
        };
    }
github pswai / git-sweep / src / sweep.js View on Github external
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);
            }
          }
        }
github Soluto / tweek / services / authoring / src / repositories / git-repository.js View on Github external
credentials: () =>
          settings.url.startsWith('ssh://')
            ? git.Cred.sshKeyNew(settings.username, settings.publicKey, settings.privateKey, '')
            : git.Cred.userpassPlaintextNew(settings.username, settings.password),
      },
github Yamazaki93 / MetroGit / app / git / repo.js View on Github external
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 () {
github eclipse / orion.client / modules / orionode / lib / git / clone.js View on Github external
function(result) {
						resolve(git.Cred.userpassPlaintextNew(result.username, result.password));
					},
					function(error) {
github gladwinbobby / bitbucket-repository-downloader / clone.js View on Github external
credentials: function() {
				return nodegit.Cred.userpassPlaintextNew(argv.username, argv.password);
			},
			certificateCheck: function() {
github amazeeio / lagoon / services / api / src / util / git.js View on Github external
): CredCb => () => Git.Cred.userpassPlaintextNew(username, password);
github Glavin001 / GitLab-Pages / routes / webhooks.js View on Github external
credentials: function(url, userName){
                    return NodeGit.Cred.sshKeyNew(
                        userName,
                        config.deploy.sshPublicKey,
                        config.deploy.sshPrivateKey,
                        "");
                }
            }
github lorenzopicoli / Sark / src / server / gitManager.js View on Github external
credentials: function(url, userName) {
        					return Git.Cred.userpassPlaintextNew(token, "x-oauth-basic");
	        			}
	        		}}
github Glavin001 / GitLab-Pages / routes / webhooks.js View on Github external
credentials: function(url, userName) {
                return NodeGit.Cred.sshKeyNew(
                    userName,
                    config.deploy.sshPublicKey,
                    config.deploy.sshPrivateKey,
                    "");
            }
        }