public class AuthSettings
extends java.lang.Object
github {
auth {
token = "ghp_..." // a Personal Access Token
tokenFile = file("secrets/github.txt") // a file that contains a token
sshKey = file("~/.ssh/id_ed25519") // an SSH private key for git clone/pull
}
}
The token (used for REST calls and HTTPS git operations) is resolved with the precedence
token → tokenFile. The sshKey
is independent and drives git transport over SSH. All fields are optional; when none are set the
plugin operates unauthenticated (public repositories only).
| Constructor and Description |
|---|
AuthSettings() |
| Modifier and Type | Method and Description |
|---|---|
java.io.File |
getSshKey() |
java.lang.String |
getToken() |
java.io.File |
getTokenFile() |
void |
setSshKey(java.io.File sshKey)
Sets the SSH private key file used for git clone/pull over SSH.
|
void |
setSshKey(java.nio.file.Path sshKey)
Sets the path to the SSH private key file used for git clone/pull over SSH.
|
void |
setToken(java.lang.String token)
Sets an explicit GitHub token (Personal Access Token) used for REST calls and HTTPS git operations.
|
void |
setTokenFile(java.io.File tokenFile)
Sets a file whose contents are a GitHub token.
|
void |
setTokenFile(java.nio.file.Path tokenFile)
Sets a path to a file whose contents are a GitHub token.
|
public void setToken(java.lang.String token)
token - the token value.public java.lang.String getToken()
public void setTokenFile(java.io.File tokenFile)
token is not set.tokenFile - the file containing the token.public void setTokenFile(java.nio.file.Path tokenFile)
tokenFile - the path to the file containing the token.public java.io.File getTokenFile()
public void setSshKey(java.io.File sshKey)
sshKey - the private key file.public void setSshKey(java.nio.file.Path sshKey)
sshKey - the path to the private key file.public java.io.File getSshKey()