public class LeaseAwareVaultPropertySource extends EnumerablePropertySource<VaultOperations>
PropertySource
that requests renewable secrets from
SecretLeaseContainer
. Leases are renewed or rotated, depeding on
RequestedSecret.getMode()
. Contents of this PropertySource
is updated
from background threads and the content is mutable. Expiration and revocation removes
properties.PropertiesPropertySource
,
PropertyTransformer
,
PropertyTransformers
PropertySource.StubPropertySource
name, source
Constructor and Description |
---|
LeaseAwareVaultPropertySource(SecretLeaseContainer secretLeaseContainer,
RequestedSecret requestedSecret)
|
LeaseAwareVaultPropertySource(String name,
SecretLeaseContainer secretLeaseContainer,
RequestedSecret requestedSecret)
|
LeaseAwareVaultPropertySource(String name,
SecretLeaseContainer secretLeaseContainer,
RequestedSecret requestedSecret,
PropertyTransformer propertyTransformer)
|
Modifier and Type | Method and Description |
---|---|
protected Map<String,Object> |
doTransformProperties(Map<String,Object> properties)
Hook method to transform properties using
PropertyTransformer . |
protected Map<String,Object> |
flattenMap(Map<String,Object> data)
Utility method converting a
String/Object map to a flat
String/Object map. |
Object |
getProperty(String name) |
String[] |
getPropertyNames() |
RequestedSecret |
getRequestedSecret() |
protected void |
handleLeaseEvent(SecretLeaseEvent leaseEvent,
Map<String,Object> properties)
Hook method to handle a
SecretLeaseEvent . |
protected Map<String,String> |
toStringMap(Map<String,Object> data)
Deprecated.
since 2.0, use
flattenMap(Map) to retain JSON data types. |
containsProperty
public LeaseAwareVaultPropertySource(SecretLeaseContainer secretLeaseContainer, RequestedSecret requestedSecret)
LeaseAwareVaultPropertySource
given a
SecretLeaseContainer
and RequestedSecret
. This property source
requests the secret upon initialization and receives secrets once they are emitted
through events published by SecretLeaseContainer
.secretLeaseContainer
- must not be null.requestedSecret
- must not be null.public LeaseAwareVaultPropertySource(String name, SecretLeaseContainer secretLeaseContainer, RequestedSecret requestedSecret)
LeaseAwareVaultPropertySource
given a name
,
SecretLeaseContainer
and RequestedSecret
. This property source
requests the secret upon initialization and receives secrets once they are emitted
through events published by SecretLeaseContainer
.name
- name of the property source, must not be null.secretLeaseContainer
- must not be null.requestedSecret
- must not be null.public LeaseAwareVaultPropertySource(String name, SecretLeaseContainer secretLeaseContainer, RequestedSecret requestedSecret, PropertyTransformer propertyTransformer)
LeaseAwareVaultPropertySource
given a name
,
SecretLeaseContainer
and RequestedSecret
. This property source
requests the secret upon initialization and receives secrets once they are emitted
through events published by SecretLeaseContainer
.name
- name of the property source, must not be null.secretLeaseContainer
- must not be null.requestedSecret
- must not be null.propertyTransformer
- object to transform properties.PropertyTransformers
public RequestedSecret getRequestedSecret()
public Object getProperty(String name)
getProperty
in class PropertySource<VaultOperations>
public String[] getPropertyNames()
getPropertyNames
in class EnumerablePropertySource<VaultOperations>
protected void handleLeaseEvent(SecretLeaseEvent leaseEvent, Map<String,Object> properties)
SecretLeaseEvent
.leaseEvent
- must not be null.properties
- reference to property storage of this property source.protected Map<String,Object> doTransformProperties(Map<String,Object> properties)
PropertyTransformer
.properties
- must not be null.@Deprecated protected Map<String,String> toStringMap(Map<String,Object> data)
flattenMap(Map)
to retain JSON data types.String/Object
map to a flat
String/String
map. Nested objects are represented with property paths.data
- the mapCopyright © 2016–2020 Pivotal Software, Inc.. All rights reserved.