Class GitHubAppCredentials
java.lang.Object
com.cloudbees.plugins.credentials.BaseCredentials
com.cloudbees.plugins.credentials.impl.BaseStandardCredentials
org.jenkinsci.plugins.github_branch_source.GitHubAppCredentials
- All Implemented Interfaces:
- com.cloudbees.plugins.credentials.common.IdCredentials,- com.cloudbees.plugins.credentials.common.PasswordCredentials,- com.cloudbees.plugins.credentials.common.StandardCredentials,- com.cloudbees.plugins.credentials.common.StandardUsernameCredentials,- com.cloudbees.plugins.credentials.common.StandardUsernamePasswordCredentials,- com.cloudbees.plugins.credentials.common.UsernameCredentials,- com.cloudbees.plugins.credentials.common.UsernamePasswordCredentials,- com.cloudbees.plugins.credentials.Credentials,- ExtensionPoint,- Describable<com.cloudbees.plugins.credentials.Credentials>,- Serializable
public class GitHubAppCredentials
extends com.cloudbees.plugins.credentials.impl.BaseStandardCredentials
implements com.cloudbees.plugins.credentials.common.StandardUsernamePasswordCredentials
- See Also:
- 
Nested Class SummaryNested ClassesNested classes/interfaces inherited from class com.cloudbees.plugins.credentials.impl.BaseStandardCredentialscom.cloudbees.plugins.credentials.impl.BaseStandardCredentials.BaseStandardCredentialsDescriptorNested classes/interfaces inherited from interface hudson.ExtensionPointExtensionPoint.LegacyInstancesAreScopedToHudsonNested classes/interfaces inherited from interface com.cloudbees.plugins.credentials.common.IdCredentialscom.cloudbees.plugins.credentials.common.IdCredentials.HelpersNested classes/interfaces inherited from interface com.cloudbees.plugins.credentials.common.StandardCredentialscom.cloudbees.plugins.credentials.common.StandardCredentials.NameProviderNested classes/interfaces inherited from interface com.cloudbees.plugins.credentials.common.StandardUsernamePasswordCredentialscom.cloudbees.plugins.credentials.common.StandardUsernamePasswordCredentials.NameProvider
- 
Field SummaryFieldsModifier and TypeFieldDescriptionstatic booleanControls whetherGithubProjectPropertyis considered byforRun(hudson.model.Run<?, ?>)for Pipeline builds.
- 
Constructor SummaryConstructorsConstructorDescriptionGitHubAppCredentials(com.cloudbees.plugins.credentials.CredentialsScope scope, String id, String description, String appID, Secret privateKey) 
- 
Method SummaryModifier and TypeMethodDescriptioncontextualize(GitHubAppUsageContext context) com.cloudbees.plugins.credentials.CredentialsgetAppID()getOwner()Deprecated.booleanvoidvoidvoidDo not call this method, usesetRepositoryAccessStrategy(org.jenkinsci.plugins.github_branch_source.app_credentials.RepositoryAccessStrategy)instead.voidprotected ObjectEnsures that the credentials state as serialized via Remoting to an agent calls back to the controller.Methods inherited from class com.cloudbees.plugins.credentials.impl.BaseStandardCredentialsequals, getDescription, getId, hashCodeMethods inherited from class com.cloudbees.plugins.credentials.BaseCredentialsgetDescriptor, getScopeMethods inherited from class java.lang.Objectclone, finalize, getClass, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.cloudbees.plugins.credentials.CredentialsgetDescriptor, getScopeMethods inherited from interface com.cloudbees.plugins.credentials.common.IdCredentialsgetIdMethods inherited from interface com.cloudbees.plugins.credentials.common.StandardCredentialsgetDescription
- 
Field Details- 
ALLOW_UNSAFE_REPOSITORY_INFERENCEpublic static boolean ALLOW_UNSAFE_REPOSITORY_INFERENCEControls whetherGithubProjectPropertyis considered byforRun(hudson.model.Run<?, ?>)for Pipeline builds.RepositoryAccessStrategyis intended to prevent users with the ability to edit a Jenkinsfile in a single repository from being able to use GitHub app credentials available to that Pipeline to access other repositories. The existence of thepropertiesstep means that job properties may not be trusted for Pipeline repository inference.
 
- 
- 
Constructor Details- 
GitHubAppCredentials
 
- 
- 
Method Details- 
getApiUri
- 
setApiUri
- 
getAppID
- 
getPrivateKey
- 
getOwnerDeprecated.
- 
setOwnerDo not call this method, usesetRepositoryAccessStrategy(org.jenkinsci.plugins.github_branch_source.app_credentials.RepositoryAccessStrategy)instead.
- 
getRepositoryAccessStrategy
- 
setRepositoryAccessStrategy@DataBoundSetter public void setRepositoryAccessStrategy(@NonNull RepositoryAccessStrategy strategy) 
- 
getDefaultPermissionsStrategy
- 
setDefaultPermissionsStrategy@DataBoundSetter public void setDefaultPermissionsStrategy(@NonNull DefaultPermissionsStrategy strategy) 
- 
getPassword- Specified by:
- getPasswordin interface- com.cloudbees.plugins.credentials.common.PasswordCredentials
 
- 
getUsername- Specified by:
- getUsernamein interface- com.cloudbees.plugins.credentials.common.UsernameCredentials
 
- 
isUsernameSecretpublic boolean isUsernameSecret()- Specified by:
- isUsernameSecretin interface- com.cloudbees.plugins.credentials.common.UsernameCredentials
 
- 
contextualize
- 
forRun- Specified by:
- forRunin interface- com.cloudbees.plugins.credentials.Credentials
 
- 
writeReplaceEnsures that the credentials state as serialized via Remoting to an agent calls back to the controller. Benefits:- The token is cached locally and used until it is stale.
- The agent never needs to have access to the plaintext private key.
- We avoid the considerable amount of class loading associated with the JWT library, Jackson data binding, Bouncy Castle, etc.
- The agent need not be able to contact GitHub.
 
 
- 
getRepositoryAccessStrategy().