Package io.jenkins.plugins.casc
Class SecretSource
- java.lang.Object
-
- io.jenkins.plugins.casc.SecretSource
-
- All Implemented Interfaces:
ExtensionPoint
- Direct Known Subclasses:
DockerSecretSource
,EnvSecretSource
,PropertiesSecretSource
public abstract class SecretSource extends Object implements ExtensionPoint
Resolves variable references in configuration file of the form "${abc}"Variable references are meant to hide secrets from configuration files.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface hudson.ExtensionPoint
ExtensionPoint.LegacyInstancesAreScopedToHudson
-
-
Constructor Summary
Constructors Constructor Description SecretSource()
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description static List<SecretSource>
all()
void
init()
abstract Optional<String>
reveal(String secret)
Reveal the plaintext value of a secret.
-
-
-
Method Detail
-
init
public void init()
-
reveal
public abstract Optional<String> reveal(String secret) throws IOException
Reveal the plaintext value of a secret.- Parameters:
secret
- the variable reference to reveal- Returns:
- the secret's value, or Optional.empty() if a recoverable error occurred. (An empty Optional will allow CasC to continue processing the resolver chain.)
Recoverable errors include:
- the secret was not found in the backing store
- Throws:
IOException
- if an unrecoverable error occurred. (The exception will stop CasC processing the resolver chain.)Unrecoverable errors include:
- all attempts to contact the backing store have failed (including any applicable retry strategies)
- authentication or authorization with the backing store failed
- the secret's value was not convertible to a String
-
all
public static List<SecretSource> all()
-
-