Package dev.enola.common.secret
Class JavaPropertySecretManager
java.lang.Object
dev.enola.common.secret.ReadOnlySecretManager
dev.enola.common.secret.JavaPropertySecretManager
- All Implemented Interfaces:
SecretManager
SecretManager that reads secrets from the JVM properties (AKA
java -D...).
This is not very secure, and really only marginally better than the EnvironmentSecretManager (because JVM process launch parameters are often still too broadly
visible). Other implementations are preferred - but sometimes this may be useful.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetOptional(String key) Retrieves a secret by its key, with optionality.Methods inherited from class dev.enola.common.secret.ReadOnlySecretManager
delete, storeMethods 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
-
JavaPropertySecretManager
public JavaPropertySecretManager()
-
-
Method Details
-
getOptional
Description copied from interface:SecretManagerRetrieves a secret by its key, with optionality.- Parameters:
key- The unique key (name) of the secret to retrieve.- Returns:
- An
Optionalcontaining theSecret, if found. - Throws:
IOException- If an error occurs while retrieving the secret.
-