public class ReactiveCredHubInterpolationTemplate extends Object implements ReactiveCredHubInterpolationOperations
Constructor and Description |
---|
ReactiveCredHubInterpolationTemplate(ReactiveCredHubOperations credHubOperations)
Create a new
ReactiveCredHubInterpolationTemplate . |
Modifier and Type | Method and Description |
---|---|
reactor.core.publisher.Mono<ServicesData> |
interpolateServiceData(ServicesData serviceData)
Search the provided data structure of bound service credentials, looking for
references to CredHub credentials.
|
public ReactiveCredHubInterpolationTemplate(ReactiveCredHubOperations credHubOperations)
ReactiveCredHubInterpolationTemplate
.credHubOperations
- the CredHubOperations
to use for interactions with
CredHubpublic reactor.core.publisher.Mono<ServicesData> interpolateServiceData(ServicesData serviceData)
ReactiveCredHubInterpolationOperations
{
"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"
]
}]
}
Assuming that CredHub has a credential with the name
/c/service-broker/service-offering/1111-2222-3333-4444/credentials,
passing the data structure above to this method would result in the
credhub-ref field being replaced by the credentials stored in CredHub:
{
"service-offering": [{
"credentials": {
"url": "https://servicehost.example.com/",
"username": "someuser",
"password": "secret"
}
"label": "service-offering",
"name": "service-instance",
"plan": "standard",
"tags": ["
"cloud-service"
]
}]
}
interpolateServiceData
in interface ReactiveCredHubInterpolationOperations
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