Class ReactiveCredHubInterpolationTemplate
java.lang.Object
org.springframework.credhub.core.interpolation.ReactiveCredHubInterpolationTemplate
- All Implemented Interfaces:
ReactiveCredHubInterpolationOperations
public class ReactiveCredHubInterpolationTemplate
extends Object
implements ReactiveCredHubInterpolationOperations
Implements the main interaction with CredHub to interpolate service binding
credentials.
- Author:
- Scott Frederick
-
Constructor Summary
ConstructorDescriptionReactiveCredHubInterpolationTemplate
(ReactiveCredHubOperations credHubOperations) Create a newReactiveCredHubInterpolationTemplate
. -
Method Summary
Modifier and TypeMethodDescriptionreactor.core.publisher.Mono<ServicesData>
interpolateServiceData
(ServicesData serviceData) Search the provided data structure of bound service credentials, looking for references to CredHub credentials.
-
Constructor Details
-
ReactiveCredHubInterpolationTemplate
Create a newReactiveCredHubInterpolationTemplate
.- Parameters:
credHubOperations
- theCredHubOperations
to use for interactions with CredHub
-
-
Method Details
-
interpolateServiceData
Description copied from interface:ReactiveCredHubInterpolationOperations
Search the provided data structure of bound service credentials, looking for references to CredHub credentials. Any CredHub credentials found in the data structure will be replaced by the credential value stored in CredHub. Example: A JSON data structure parsed from a VCAP_SERVICES environment variable might look like this if the service broker that provided the binding is integrated with CredHub:{ "service-offering": [{ "credentials": { "credhub-ref": "((/c/service-broker/service-offering/1111-2222-3333-4444/credentials))" } "label": "service-offering", "name": "service-instance", "plan": "standard", "tags": [" "cloud-service" ] }] }
{ "service-offering": [{ "credentials": { "url": "https://servicehost.example.com/", "username": "someuser", "password": "secret" } "label": "service-offering", "name": "service-instance", "plan": "standard", "tags": [" "cloud-service" ] }] }
- Specified by:
interpolateServiceData
in interfaceReactiveCredHubInterpolationOperations
- Parameters:
serviceData
- a data structure of bound service credentials, as would be parsed from the VCAP_SERVICES environment variable provided to applications running on Cloud Foundry- Returns:
- the serviceData structure with CredHub references replaced by stored credential values
-