Class SecretToCredentialConverter

java.lang.Object
com.cloudbees.jenkins.plugins.kubernetes_credentials_provider.SecretToCredentialConverter
All Implemented Interfaces:
ExtensionPoint
Direct Known Subclasses:
AWSCredentialsConvertor, BasicSSHUserPrivateKeyCredentialsConvertor, CertificateCredentialsConvertor, DockerServerCredentialsConvertor, FileCredentialsConvertor, GitHubAppCredentialsConvertor, OpenstackCredentialv3Convertor, StringCredentialConvertor, UsernamePasswordCredentialsConvertor, VaultAppRoleCredentialsConvertor, VaultGitHubTokenCredentialsConvertor, VaultTokenCredentialsConvertor

public abstract class SecretToCredentialConverter extends Object implements ExtensionPoint
Class that converts a secret of a given type to an IdCredentials.
  • Constructor Details

    • SecretToCredentialConverter

      public SecretToCredentialConverter()
  • Method Details

    • canConvert

      public abstract boolean canConvert(String type)
      Check if this converter can transform secrets of a given type.
      Parameters:
      type - the type of secret. This is normally the symbol attached to the credential type by the credential binding plugin.
      Returns:
      true iff this SecretToCredentialConvertor can convert secrets of the specified type.
    • convert

      public abstract com.cloudbees.plugins.credentials.common.IdCredentials convert(io.fabric8.kubernetes.api.model.Secret secret) throws CredentialsConvertionException
      Convert the given Secret to an IdCredential. This will only be called for a secret of a type that the class has previously returned true from canConvert(String).
      Parameters:
      secret - the Secret to convert.
      Returns:
      the IdCredentials created from the secret.
      Throws:
      CredentialsConvertionException - if the Secret could not be converted.
    • all

      public static final ExtensionList<SecretToCredentialConverter> all()
      Helper to obtain all the implementations of this ExtensionPoint
      Returns:
      the ExtensionList containing all of the implementations.