Class GitHubAppCredentialsAdapter

java.lang.Object
org.jenkinsci.plugins.azurekeyvaultplugin.credentials.AzureKeyVaultCredentialsAdapter
org.jenkinsci.plugins.azurekeyvaultplugin.credentials.githubapp.GitHubAppCredentialsAdapter
All Implemented Interfaces:
ExtensionPoint

@OptionalExtension(requirePlugins="github-branch-source") public class GitHubAppCredentialsAdapter extends AzureKeyVaultCredentialsAdapter
Builds GitHubAppCredentials from an Azure Key Vault secret's tags.

Only registered when the optional github-branch-source plugin is installed. This must stay the only class referencing that plugin: an always-loaded class doing so would fail with NoClassDefFoundError when it is absent and take the whole provider down with it.

  • Constructor Details

    • GitHubAppCredentialsAdapter

      public GitHubAppCredentialsAdapter()
  • Method Details

    • getType

      @NonNull public String getType()
      Specified by:
      getType in class AzureKeyVaultCredentialsAdapter
      Returns:
      the value of the secret's type tag this adapter handles, e.g. string
    • adapt

      public com.cloudbees.plugins.credentials.common.IdCredentials adapt(@NonNull AzureKeyVaultSecretContext context)
      The private key (PKCS#8 PEM) is resolved eagerly because GitHubAppCredentials reads its key field directly during token generation and cannot resolve it lazily.
      Specified by:
      adapt in class AzureKeyVaultCredentialsAdapter
      Returns:
      the credential, or null if both the clientID and appID tags are blank.