Class SecretStorePropertySource
- All Implemented Interfaces:
SensitivePropertySource,PropertySource
SecretStore as a PropertySource, so a secret can be resolved
through the property/$P{...}/@Value machinery only where a consumer deliberately wires it in.
By default a SecretStore is intentionally not part of the general config/SVL namespace — that is
what keeps a secret one careless Settings dump or debug log away from disclosure. This adapter is the
conscious, greppable exception: attach it as a caller-scoped source (for example a session-scoped
PropertySource[] bean on a VarResolverSession) and its bridged keys become resolvable there, and
nowhere else.
It implements SensitivePropertySource so any dump/log path that honors that marker redacts its values, and
its own toString() never reveals the wrapped store or any secret.
Materialization trade-off. The PropertySource contract returns values as String, so this
bridge necessarily converts the retrieved char[] into a String that cannot be explicitly zeroed and
may linger in the string pool. That reintroduced exposure is precisely why bridging is opt-in and marked
sensitive rather than being the default way to reach a secret.
- Since:
- 10.0.0
-
Constructor Summary
Constructors -
Method Summary
-
Constructor Details
-
SecretStorePropertySource
Constructor.- Parameters:
store- The secret store to expose. Must not benull .
-
-
Method Details
-
get
Description copied from interface:PropertySourceReturns a property in this property source.- Specified by:
getin interfacePropertySource- Parameters:
name- The property name.- Returns:
- The property lookup result:
PropertyLookupResult.missing()if this source does not define the key.PropertyLookupResult.present(Optional)withOptional.empty()if the key exists with a null value.PropertyLookupResult.present(Optional)with a value if the key exists with a non-null value.
-
toString
-