Package org.springframework.credhub.core
Class ReactiveCredHubTemplate
java.lang.Object
org.springframework.credhub.core.ReactiveCredHubTemplate
- All Implemented Interfaces:
ReactiveCredHubOperations
Implements the main interaction with CredHub.
- Author:
- Scott Frederick
-
Constructor Summary
ConstructorsConstructorDescriptionReactiveCredHubTemplate(CredHubProperties credHubProperties, ClientHttpConnector clientHttpConnector) Create a newReactiveCredHubTemplateusing the provided base URI andClientHttpRequestFactory.ReactiveCredHubTemplate(CredHubProperties credHubProperties, ClientHttpConnector clientHttpConnector, org.springframework.security.oauth2.client.ReactiveOAuth2AuthorizedClientManager clientManager) Create a newReactiveCredHubTemplateusing the provided base URI andClientHttpRequestFactory.ReactiveCredHubTemplate(CredHubProperties credHubProperties, ClientHttpConnector clientHttpConnector, org.springframework.security.oauth2.client.registration.ReactiveClientRegistrationRepository clientRegistrationRepository, org.springframework.security.oauth2.client.web.server.ServerOAuth2AuthorizedClientRepository authorizedClientRepository) Create a newReactiveCredHubTemplateusing the provided base URI andClientHttpRequestFactory.ReactiveCredHubTemplate(WebClient webClient) Create a newReactiveCredHubTemplateusing the providedWebClient. -
Method Summary
Modifier and TypeMethodDescriptionGet the operations for retrieving, regenerating, and updating certificates.Get the operations for saving, retrieving, and deleting credentials.<V,T extends org.reactivestreams.Publisher<V>>
TdoWithWebClient(Function<WebClient, ? extends T> callback) Allow interaction with the configuredWebClientnot provided by other methods.info()Get the operations for retrieving CredHub server information.Get the operations for interpolating service binding credentials.booleanGet the operations for adding, retrieving, and deleting permissions from a credential.Get the operations for adding, retrieving, and deleting permissions from a credential.
-
Constructor Details
-
ReactiveCredHubTemplate
Create a newReactiveCredHubTemplateusing the providedWebClient. Intended for internal testing only.- Parameters:
webClient- theWebClientto use for interactions with CredHub
-
ReactiveCredHubTemplate
public ReactiveCredHubTemplate(CredHubProperties credHubProperties, ClientHttpConnector clientHttpConnector) Create a newReactiveCredHubTemplateusing the provided base URI andClientHttpRequestFactory.- Parameters:
credHubProperties- connection properties for the CredHub serverclientHttpConnector- theClientHttpConnectorto use when creating new connections
-
ReactiveCredHubTemplate
public ReactiveCredHubTemplate(CredHubProperties credHubProperties, ClientHttpConnector clientHttpConnector, org.springframework.security.oauth2.client.registration.ReactiveClientRegistrationRepository clientRegistrationRepository, org.springframework.security.oauth2.client.web.server.ServerOAuth2AuthorizedClientRepository authorizedClientRepository) Create a newReactiveCredHubTemplateusing the provided base URI andClientHttpRequestFactory.- Parameters:
credHubProperties- connection properties for the CredHub serverclientHttpConnector- theClientHttpConnectorto use when creating new connectionsclientRegistrationRepository- a repository of OAuth2 client registrationsauthorizedClientRepository- a repository of authorized OAuth2 clients
-
ReactiveCredHubTemplate
public ReactiveCredHubTemplate(CredHubProperties credHubProperties, ClientHttpConnector clientHttpConnector, org.springframework.security.oauth2.client.ReactiveOAuth2AuthorizedClientManager clientManager) Create a newReactiveCredHubTemplateusing the provided base URI andClientHttpRequestFactory.- Parameters:
credHubProperties- connection properties for the CredHub serverclientHttpConnector- theClientHttpConnectorto use when creating new connectionsclientManager- an OAuth2 authorization client manager
-
-
Method Details
-
credentials
Get the operations for saving, retrieving, and deleting credentials.- Specified by:
credentialsin interfaceReactiveCredHubOperations- Returns:
- the credentials operations
-
permissions
Get the operations for adding, retrieving, and deleting permissions from a credential.- Specified by:
permissionsin interfaceReactiveCredHubOperations- Returns:
- the permissions operations
-
permissionsV2
Get the operations for adding, retrieving, and deleting permissions from a credential.- Specified by:
permissionsV2in interfaceReactiveCredHubOperations- Returns:
- the permissions operations
-
certificates
Get the operations for retrieving, regenerating, and updating certificates.- Specified by:
certificatesin interfaceReactiveCredHubOperations- Returns:
- the certificates operations
-
interpolation
Get the operations for interpolating service binding credentials.- Specified by:
interpolationin interfaceReactiveCredHubOperations- Returns:
- the interpolation operations
-
info
Get the operations for retrieving CredHub server information.- Specified by:
infoin interfaceReactiveCredHubOperations- Returns:
- the info operations
-
doWithWebClient
public <V,T extends org.reactivestreams.Publisher<V>> T doWithWebClient(Function<WebClient, ? extends T> callback) Allow interaction with the configuredWebClientnot provided by other methods.- Specified by:
doWithWebClientin interfaceReactiveCredHubOperations- Type Parameters:
T- the credential implementation typeV- the publisher type- Parameters:
callback- wrapper for the callback method- Returns:
- the return value from the callback method
-
isUsingOAuth2
public boolean isUsingOAuth2()
-