Package io.datarouter.secret.client
Interface SecretClient
- All Known Implementing Classes:
LocalStorageSecretClient,MemorySecretClient
public interface SecretClient
This is an interface that enables simple CRUD methods for
Secret storage without any namespacing logic.
The recommended way to use this interface is to implement use CachedSecretFactory to obtain a
CachedSecretFactory.CachedSecret for reading. If more than just reading is required, SecretService should be used.
This interface should be used directly only as a last resort or for migrations across namespaces.-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static interfaceSecretClient.SecretClientSupplier -
Method Summary
Modifier and Type Method Description voidcreate(Secret secret)write the specifiedSecretto the secret storage for the first timedefault voidcreate(java.lang.String name, java.lang.String value)create aSecretas specified, then write it to the secret storage for the first timevoiddelete(java.lang.String name)delete the namedSecretfrom the secret storagejava.util.List<java.lang.String>listNames(java.util.Optional<java.lang.String> exclusivePrefix)returns the fullSecretnames that start with exclusive prefixSecretread(java.lang.String name)voidupdate(Secret secret)update the current value of theSecretin the secret storagedefault voidupdate(java.lang.String name, java.lang.String value)create aSecretas specified, then update the current value of it in the secret storagedefault voidvalidateName(java.lang.String name)validate the provided name according to the rules of the secret storagedefault voidvalidateSecret(Secret secret)validate the providedSecretaccording to the rules of the secret storage
-
Method Details
-
create
write the specifiedSecretto the secret storage for the first time -
create
default void create(java.lang.String name, java.lang.String value)create aSecretas specified, then write it to the secret storage for the first time -
read
-
listNames
java.util.List<java.lang.String> listNames(java.util.Optional<java.lang.String> exclusivePrefix)returns the fullSecretnames that start with exclusive prefix -
update
update the current value of theSecretin the secret storage -
update
default void update(java.lang.String name, java.lang.String value)create aSecretas specified, then update the current value of it in the secret storage -
delete
void delete(java.lang.String name)delete the namedSecretfrom the secret storage -
validateName
default void validateName(java.lang.String name)validate the provided name according to the rules of the secret storage -
validateSecret
validate the providedSecretaccording to the rules of the secret storage
-