Interface ISecretsStore
- All Known Implementing Classes:
SecretsStore
public interface ISecretsStore
The secrets store as the property framework sees it: a map from a key (see
ISecretsContext) to the value of a secret property in its element-string form, i.e. what toElementString would have written to the XML file. A PasswordProp thus stays obfuscated, a StringProp clear and a PKCS12IdentityProp its hexadecimal bytes: the store never needs the property class, and each class keeps its own codec.An implementation never puts a value in a log line, an exception message or its toString. Whether and when a change reaches the file is the implementation's business; the property framework only calls these methods.
- Author:
- Christopher Mindus
Method Summary
Modifier and TypeMethodDescriptionGets the value of a key.default booleanTells whether the store has an entry for a key, without handing out its value: the Designer's Push page shows where a secret is, never what it is (ruling PP-D-4).booleanChecks if the store can be written to.voidPuts a value under a key, replacing a previous one.default voidPuts the value of a secret property under a key: its element-string form, and, for an implementation that keeps the class of an entry in its file (decision P-13), the class.voidRemoves a key.
Method Details
get
has
Tells whether the store has an entry for a key, without handing out its value: the Designer's Push page shows where a secret is, never what it is (ruling PP-D-4). The default asksget(String)and drops the answer; a store that can list its keys answers from them.- Parameters:
key- The key.- Returns:
- true when the store has an entry for the key.
put
Puts a value under a key, replacing a previous one.- Parameters:
key- The key.value- The element-string value, never null: useremove(String)instead.- Throws:
IllegalStateException- if the store is read-only.
putProp
Puts the value of a secret property under a key: its element-string form, and, for an implementation that keeps the class of an entry in its file (decision P-13), the class. The default putsprop.toElementString(value)throughput(String,String);SecretsStores.commitcalls this method (CC-SECRETS-SK2-STORE, decision SK2-D-4).- Parameters:
key- The key.prop- The property, whose value must not be null: useremove(String)instead.- Throws:
IllegalArgumentException- if the property has no value.IllegalStateException- if the store is read-only.
remove
Removes a key. Removing an absent key does nothing.- Parameters:
key- The key.- Throws:
IllegalStateException- if the store is read-only.
isReadOnly
boolean isReadOnly()Checks if the store can be written to.- Returns:
- true when the store is read-only, e.g. a mounted container secret, false otherwise.