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 anIdCredentials
.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface hudson.ExtensionPoint
ExtensionPoint.LegacyInstancesAreScopedToHudson
-
-
Constructor Summary
Constructors Constructor Description SecretToCredentialConverter()
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description static ExtensionList<SecretToCredentialConverter>
all()
Helper to obtain all the implementations of thisExtensionPoint
abstract boolean
canConvert(String type)
Check if this converter can transform secrets of a given type.abstract com.cloudbees.plugins.credentials.common.IdCredentials
convert(io.fabric8.kubernetes.api.model.Secret secret)
Convert the givenSecret
to anIdCredential
.
-
-
-
Method Detail
-
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 thisSecretToCredentialConvertor
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 givenSecret
to anIdCredential
. This will only be called for a secret of a type that the class has previously returnedtrue
fromcanConvert(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 thisExtensionPoint
- Returns:
- the ExtensionList containing all of the implementations.
-
-