Class BaseAzureKeyVaultCredentialsProvider

java.lang.Object
hudson.model.Descriptor<com.cloudbees.plugins.credentials.CredentialsProvider>
com.cloudbees.plugins.credentials.CredentialsProvider
org.jenkinsci.plugins.azurekeyvaultplugin.provider.BaseAzureKeyVaultCredentialsProvider
All Implemented Interfaces:
ExtensionPoint, Describable<com.cloudbees.plugins.credentials.CredentialsProvider>, Saveable, Loadable, OnMaster, IconSpec
Direct Known Subclasses:
AzureCredentialsProvider, FolderAzureCredentialsProvider

public abstract class BaseAzureKeyVaultCredentialsProvider extends com.cloudbees.plugins.credentials.CredentialsProvider
Common parent of the providers that serve credentials from Azure Key Vault.

The Azure credential types in this plugin are only applicable to subclasses, see isAzureKeyVaultProvider(CredentialsProvider).

  • Constructor Details

    • BaseAzureKeyVaultCredentialsProvider

      public BaseAzureKeyVaultCredentialsProvider()
  • Method Details

    • isAzureKeyVaultProvider

      public static boolean isAzureKeyVaultProvider(com.cloudbees.plugins.credentials.CredentialsProvider provider)
    • newCacheBuilder

      protected static com.github.benmanes.caffeine.cache.Caffeine<Object,Object> newCacheBuilder(long maximumSize)
      Creates the builder for a provider's credentials cache, so all providers expire and refresh on the same schedule. Metadata is refreshed every 10 minutes and dropped if it can't be refreshed for 2 hours.
    • credentialsLoader

      protected static <K> com.github.benmanes.caffeine.cache.CacheLoader<K,Map<String,com.cloudbees.plugins.credentials.common.IdCredentials>> credentialsLoader(Function<K,Map<String,com.cloudbees.plugins.credentials.common.IdCredentials>> fetch)
      Wraps a fetch of a vault's credentials for the cache, which treats failures differently on the first load and on a refresh.
      • A failed first load caches no credentials until the next refresh, so lookups while the vault is unavailable don't each block on retrying it.
      • A failed refresh is rethrown, so the cache keeps the last credentials loaded until they expire, rather than replacing them with none.
    • isLookupSupported

      protected static boolean isLookupSupported(Class<?> type)
      Key Vault can't hold the Azure credentials used to connect to it, and answering a lookup for them would re-enter the provider while it is connecting to the vault.
    • getIconClassName

      public String getIconClassName()
      Specified by:
      getIconClassName in interface IconSpec
      Overrides:
      getIconClassName in class com.cloudbees.plugins.credentials.CredentialsProvider