Class GitHubAppCredentialsFactory

java.lang.Object
org.jenkinsci.plugins.azurekeyvaultplugin.credentials.githubapp.GitHubAppCredentialsFactory

public final class GitHubAppCredentialsFactory extends Object
Builds GitHubAppCredentials from an Azure Key Vault secret's tags.

All references to the optional github-branch-source plugin are isolated in this class. AzureCredentialsProvider must not import or reference GitHubAppCredentials directly: doing so makes the whole provider fail to load (a verification-time NoClassDefFoundError) when that optional plugin is absent, which would break every credential type, not just this one. Callers must confirm the plugin is installed before invoking create(com.cloudbees.plugins.credentials.CredentialsScope, java.lang.String, java.lang.String, java.util.Map<java.lang.String, java.lang.String>, java.util.function.Supplier<hudson.util.Secret>); that call is what first loads this class (and therefore the github-branch-source classes it references).

  • Method Details

    • create

      public static com.cloudbees.plugins.credentials.common.IdCredentials create(com.cloudbees.plugins.credentials.CredentialsScope scope, String jenkinsID, String description, Map<String,String> tags, Supplier<Secret> privateKey)
      Parameters:
      privateKey - supplier of the GitHub App private key (PKCS#8 PEM); resolved eagerly because GitHubAppCredentials reads its key field directly during token generation and cannot resolve it lazily.
      Returns:
      the credential (as an IdCredentials so callers need no compile-time reference to github-branch-source), or null if the required appID tag is blank.