Package org.ysb33r.gradle.git.publish
Interface Credentials
public interface Credentials
Credentials for remote Git access.
-
Method Summary
Modifier and TypeMethodDescriptionvoidOnly accept host keys from Github.voidOnly accept host keys from Gitlab.voidAccept all SSH hosts.voidacceptSshHost(Object host, Object protocol, Object key) Accept host key.getName()The name for this set of credentials.org.gradle.api.provider.Provider<GitTransport>A provider to the authentication methods that will be used.voidSets a token to be use for http(s) authentication.voidhttpUserNamePassword(Object user, Object pass) Sets a http(s) username & password.voidSets the passphrase-less private key for SSH authentication.voidsshKeyFromFile(org.gradle.api.provider.Provider<File> location) Use a file for the private key.voidsshKeyFromFileWithPassphrase(org.gradle.api.provider.Provider<File> location, Object passphrase) Use a file for the private along with a passphrase.voidsshKeyWithPassphrase(Object privateKey, Object passphrase) Sets the private key for SSH authentication along with a passphrase.
-
Method Details
-
getName
String getName()The name for this set of credentials.- Returns:
- Name
-
httpUserNamePassword
Sets a http(s) username & password.Unsets SSH authentication.
- Parameters:
user- Username. Anything that can lazy-evaluate to a string using Grolifant'sstringize.pass- Password. Anything that can lazy-evaluate to a string using Grolifant'sstringize.
-
httpToken
Sets a token to be use for http(s) authentication.Typically a token from Github or Gitlab.
Unsets SSH authentication.
- Parameters:
token- Authentication token. Anything that can lazy-evaluate to a string using Grolifant'sstringize.
-
sshKey
Sets the passphrase-less private key for SSH authentication.Unsets HTTP(s) authentication.
- Parameters:
privateKey- Anything that can be evaluated to a string or a byte array.
-
sshKeyWithPassphrase
Sets the private key for SSH authentication along with a passphrase.Unsets HTTP(s) authentication.
- Parameters:
privateKey- Anything that can be evaluated to a string or a byte array.passphrase- Anything that can be evaluated to a string.
-
sshKeyFromFile
Use a file for the private key.Unsets HTTP(s) authentication.
- Parameters:
location- Location of file.
-
sshKeyFromFileWithPassphrase
void sshKeyFromFileWithPassphrase(org.gradle.api.provider.Provider<File> location, Object passphrase) Use a file for the private along with a passphrase.Unsets HTTP(s) authentication.
- Parameters:
location- Location of file.passphrase- Anything that can be evaluated to a string.
-
acceptAllSshHosts
void acceptAllSshHosts()Accept all SSH hosts.This is a security hole, but it can be really useful for testing
-
acceptAllGitlabSshHosts
void acceptAllGitlabSshHosts()Only accept host keys from Gitlab. -
acceptAllGithubSshHosts
void acceptAllGithubSshHosts()Only accept host keys from Github. -
acceptSshHost
Accept host key.Call this multiple times to add multiple hosts. Calling any of the other
accept*methods, will unset any of the hosts set in this way.- Parameters:
host- Anything convertible to a string.protocol- Anything convertible to a string.key- Anything convertible to a string orbyte[]
-
getTransportCredentials
org.gradle.api.provider.Provider<GitTransport> getTransportCredentials()A provider to the authentication methods that will be used.- Returns:
- Authentication provider.
-