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
ConstructorDescriptionReactiveCredHubTemplate
(CredHubProperties credHubProperties, ClientHttpConnector clientHttpConnector) Create a newReactiveCredHubTemplate
using the provided base URI andClientHttpRequestFactory
.ReactiveCredHubTemplate
(CredHubProperties credHubProperties, ClientHttpConnector clientHttpConnector, org.springframework.security.oauth2.client.ReactiveOAuth2AuthorizedClientManager clientManager) Create a newReactiveCredHubTemplate
using 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 newReactiveCredHubTemplate
using the provided base URI andClientHttpRequestFactory
.ReactiveCredHubTemplate
(WebClient webClient) Create a newReactiveCredHubTemplate
using 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 configuredWebClient
not provided by other methods.info()
Get the operations for retrieving CredHub server information.Get the operations for interpolating service binding credentials.boolean
Get 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 newReactiveCredHubTemplate
using the providedWebClient
. Intended for internal testing only.- Parameters:
webClient
- theWebClient
to use for interactions with CredHub
-
ReactiveCredHubTemplate
public ReactiveCredHubTemplate(CredHubProperties credHubProperties, ClientHttpConnector clientHttpConnector) Create a newReactiveCredHubTemplate
using the provided base URI andClientHttpRequestFactory
.- Parameters:
credHubProperties
- connection properties for the CredHub serverclientHttpConnector
- theClientHttpConnector
to 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 newReactiveCredHubTemplate
using the provided base URI andClientHttpRequestFactory
.- Parameters:
credHubProperties
- connection properties for the CredHub serverclientHttpConnector
- theClientHttpConnector
to 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 newReactiveCredHubTemplate
using the provided base URI andClientHttpRequestFactory
.- Parameters:
credHubProperties
- connection properties for the CredHub serverclientHttpConnector
- theClientHttpConnector
to use when creating new connectionsclientManager
- an OAuth2 authorization client manager
-
-
Method Details
-
credentials
Get the operations for saving, retrieving, and deleting credentials.- Specified by:
credentials
in interfaceReactiveCredHubOperations
- Returns:
- the credentials operations
-
permissions
Get the operations for adding, retrieving, and deleting permissions from a credential.- Specified by:
permissions
in interfaceReactiveCredHubOperations
- Returns:
- the permissions operations
-
permissionsV2
Get the operations for adding, retrieving, and deleting permissions from a credential.- Specified by:
permissionsV2
in interfaceReactiveCredHubOperations
- Returns:
- the permissions operations
-
certificates
Get the operations for retrieving, regenerating, and updating certificates.- Specified by:
certificates
in interfaceReactiveCredHubOperations
- Returns:
- the certificates operations
-
interpolation
Get the operations for interpolating service binding credentials.- Specified by:
interpolation
in interfaceReactiveCredHubOperations
- Returns:
- the interpolation operations
-
info
Get the operations for retrieving CredHub server information.- Specified by:
info
in 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 configuredWebClient
not provided by other methods.- Specified by:
doWithWebClient
in 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()
-