Secure Shell URL support in Git integration

Secure Shell (SSH) URL is supported to access the Git repository.

The REST API actions GitInit, GitStats, GitPull, GitPush, and GitDeploy can take three additional parameters to pass the SSH credential. These additional parameters are PublicKey, PrivateKey, and Passphrase.

The content of the PublicKey and PrivateKey parameters should be identical to the content of the generated SSH key files. Passphrase is the same as was specified when generating the private key.

The PrivateKey and Passphrase will not be written to the server log.

The Git credential is cached in the HTTP session.

This example shows a GitInit with the supported SSH parameters:

POST /api/v1/GitInit
{
 "URL": "git@github.com:GithubAccountXXX/RepoXXX.git",
 "Deployment": "prod",
 "PublicKey": "ssh-rsa AAAAB3NzaC1yc2Exxx...",
 "PrivateKey": "----BEGIN RSA PRIVATE KEY----\nMIIJKAIBxxx...",
 "Passphrase": "xxx"
}

Assuming Git is initialized with SSH URL, a full GitPull looks like this:

POST /api/v1/GitPull
{
 "Branch": "DB_PlanSamp",
 "PublicKey": "ssh-rsa AAAAB3NzaC1yc2Exxx...",
 "PrivateKey": "-----BEGIN RSA PRIVATE KEY-----\nMIIJKAIBxxx..."
 "Passphrase": "xxx"
}

However, since the Git credential is cached, you can exclude the credentials in the GitPull request if you'd like:

POST /api/v1/GitPull {   
  "Branch": "DB_PlanSamp" 
} 

Once Git is initialized with SSH URL, GitStats, GitPush, and GitDeploy can be used in the same manner as GitPull, as shown previously.