Package dev.enola.common.secret.yaml
Class YamlSecretManager
java.lang.Object
dev.enola.common.secret.InMemorySecretManager
dev.enola.common.secret.yaml.YamlSecretManager
- All Implemented Interfaces:
SecretManager
- Direct Known Subclasses:
InsecureUnencryptedYamlFileSecretManager
-
Constructor Summary
ConstructorsConstructorDescriptionYamlSecretManager(CheckedConsumer<String, IOException> saveConsumer, CheckedSupplier<String, IOException> loadSupplier) -
Method Summary
Methods inherited from class dev.enola.common.secret.InMemorySecretManager
getAll, getOptionalMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface dev.enola.common.secret.SecretManager
get
-
Constructor Details
-
YamlSecretManager
public YamlSecretManager(CheckedConsumer<String, IOException> saveConsumer, CheckedSupplier<String, throws IOExceptionIOException> loadSupplier) - Throws:
IOException
-
-
Method Details
-
load
- Throws:
IOException
-
save
- Throws:
IOException
-
store
Description copied from interface:SecretManagerStores a secret value associated with a unique key. The sensitive value is provided as a char array. Implementations will zero out the inputvaluearray immediately after calling this method for security. If a secret with the same key already exists, its value is overwritten.- Specified by:
storein interfaceSecretManager- Overrides:
storein classInMemorySecretManager- Parameters:
key- The unique key (name) for the secret.value- The sensitive secret value as a character array.- Throws:
IOException- If an error occurs while storing the secret.
-
delete
Description copied from interface:SecretManagerDeletes a secret from the manager.- Specified by:
deletein interfaceSecretManager- Overrides:
deletein classInMemorySecretManager- Parameters:
key- The unique key (name) of the secret to delete.- Throws:
IOException- If an error occurs while deleting the secret.
-