On this page:
git_  cred_  default_  new
git_  cred_  free
git_  cred_  has_  username
git_  cred_  ssh_  custom_  new
git_  cred_  ssh_  interactive_  new
git_  cred_  ssh_  key_  from_  agent
git_  cred_  ssh_  key_  memory_  new
git_  cred_  ssh_  key_  new
git_  cred_  username_  new
git_  cred_  userpass
git_  cred_  userpass_  plaintext_  new
8.12

11 Credentials🔗ℹ

 (require libgit2/include/cred) package: libgit2

procedure

(git_cred_default_new)  cred?

Create a "default" credential usable for Negotiate mechanisms like NTLM or Kerberos authentication.

procedure

(git_cred_free cred)  void?

  cred : cred?
Free a credential.

This is only necessary if you own the object; that is, if you are a transport.

procedure

(git_cred_has_username cred)  boolean?

  cred : cred?
Check whether a credential object contains username information.

procedure

(git_cred_ssh_custom_new username    
  publickey    
  publickey_len    
  sign_callback    
  payload)  cred?
  username : string?
  publickey : string?
  publickey_len : integer?
  sign_callback : git_cred_sign_callback
  payload : bytes?
Create an ssh key credential with a custom signing function.

This lets you use your own function to sign the challenge.

This function and its credential type is provided for completeness and wraps libssh2_userauth_publickey(), which is undocumented.

The supplied credential parameter will be internally duplicated.

procedure

(git_cred_ssh_interactive_new username    
  prompt_callback    
  payload)  cred?
  username : string?
  prompt_callback : git_cred_ssh_interactive_callback
  payload : bytes?
Create a new ssh keyboard-interactive based credential object. The supplied credential parameter will be internally duplicated.

procedure

(git_cred_ssh_key_from_agent username)  cred?

  username : string?
Create a new ssh key credential object used for querying an ssh-agent. The supplied credential parameter will be internally duplicated.

procedure

(git_cred_ssh_key_memory_new username    
  publickey    
  privatekey    
  passphrase)  cred?
  username : string?
  publickey : string?
  privatekey : string?
  passphrase : string?
Create a new ssh key credential object reading the keys from memory.

procedure

(git_cred_ssh_key_new username    
  publickey    
  privatekey    
  passphrase)  cred?
  username : string?
  publickey : string?
  privatekey : string?
  passphrase : string?
Create a new passphrase-protected ssh key credential object. The supplied credential parameter will be internally duplicated.

procedure

(git_cred_username_new username)  cred?

  username : string?
Create a credential to specify a username.

This is used with ssh authentication to query for the username if none is specified in the url.

procedure

(git_cred_userpass url    
  user_from_url    
  allowed_types    
  payload)  cred?
  url : string?
  user_from_url : string?
  allowed_types : integer?
  payload : bytes?
Stock callback usable as a git_cred_acquire_cb. This calls git_cred_userpass_plaintext_new unless the protocol has not specified GIT_CREDTYPE_USERPASS_PLAINTEXT as an allowed type.

procedure

(git_cred_userpass_plaintext_new username    
  password)  cred?
  username : string?
  password : string?
Create a new plain-text username and password credential object. The supplied credential parameter will be internally duplicated.