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
Class that converts a secret of a given type to an
IdCredentials.-
Nested Class Summary
Nested classes/interfaces inherited from interface hudson.ExtensionPoint
ExtensionPoint.LegacyInstancesAreScopedToHudson -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic final ExtensionList<SecretToCredentialConverter>all()Helper to obtain all the implementations of thisExtensionPointabstract booleancanConvert(String type) Check if this converter can transform secrets of a given type.abstract com.cloudbees.plugins.credentials.common.IdCredentialsconvert(io.fabric8.kubernetes.api.model.Secret secret) Convert the givenSecretto anIdCredential.
-
Constructor Details
-
SecretToCredentialConverter
public SecretToCredentialConverter()
-
-
Method Details
-
canConvert
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:
trueiff thisSecretToCredentialConvertorcan 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 givenSecretto anIdCredential. This will only be called for a secret of a type that the class has previously returnedtruefromcanConvert(String).- Parameters:
secret- the Secret to convert.- Returns:
- the IdCredentials created from the secret.
- Throws:
CredentialsConvertionException- if the Secret could not be converted.
-
all
Helper to obtain all the implementations of thisExtensionPoint- Returns:
- the ExtensionList containing all of the implementations.
-