public final class ClientCredentialsHttpDestination extends Object implements HttpDestination
HttpDestination
implementation automatically
adding an authentication header retrieved from an XSUAA service with client credentials.Constructor and Description |
---|
ClientCredentialsHttpDestination(HttpDestinationProperties baseDestination,
ClientCredentials clientCredentials,
ClientCredentialsGrantType grantType,
URI xsuaaUri,
XsuaaService xsuaaService)
Wraps the given destination and adds the authentication header retrieved from the given XSUAA service with the
given credentials via the given grant type.
|
ClientCredentialsHttpDestination(HttpDestinationProperties baseDestination,
ClientCredentials clientCredentials,
URI xsuaaUri,
XsuaaService xsuaaService)
Wraps the given destination and adds the authentication header retrieved from the given XSUAA service with the
given credentials via the
ClientCredentialsGrantType.CLIENT_CREDENTIALS grant type. |
Modifier and Type | Method and Description |
---|---|
io.vavr.control.Option<Object> |
get(String key)
Gets the value associated with the given key (if any).
|
AuthenticationType |
getAuthenticationType()
Returns the authentication type to be expected when authenticating at the remote system.
|
io.vavr.control.Option<BasicCredentials> |
getBasicCredentials()
Returns the basic credentials to be used for authentication at the remote system.
|
ClientCredentials |
getClientCredentials()
Returns the credentials to be used to retrieve the AuthToken.
|
Collection<Header> |
getHeaders(URI requestUri)
Getter for a collection of header that should be added to the outgoing request for this destination.
|
io.vavr.control.Option<KeyStore> |
getKeyStore()
The KeyStore to be used when communicating over HTTP.
|
io.vavr.control.Option<String> |
getKeyStorePassword()
The password for the Key Store to be used when communicating over HTTP.
|
io.vavr.control.Option<String> |
getName() |
io.vavr.control.Option<ProxyConfiguration> |
getProxyConfiguration()
The
ProxyConfiguration to be used when communicating over HTTP. |
io.vavr.control.Option<ProxyType> |
getProxyType()
Returns the
ProxyType that is configured for this destination. |
io.vavr.control.Option<String> |
getTlsVersion()
The TLS version to be used when communicating over HTTP.
|
io.vavr.control.Option<KeyStore> |
getTrustStore() |
io.vavr.control.Option<String> |
getTrustStorePassword() |
URI |
getUri()
Getter for the
URI to communicate with. |
URI |
getXsuaaUri()
Returns the URI to be used to retrieve the AuthToken.
|
boolean |
isTrustingAllCertificates()
Indicates whether all server certificates should be accepted when communicating over HTTP.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
decorate
get, get, get
public ClientCredentialsHttpDestination(@Nonnull HttpDestinationProperties baseDestination, @Nonnull ClientCredentials clientCredentials, @Nonnull URI xsuaaUri, @Nonnull XsuaaService xsuaaService)
ClientCredentialsGrantType.CLIENT_CREDENTIALS
grant type.baseDestination
- The destination to wrap.clientCredentials
- The credentials to be used to retrieve the AuthToken.xsuaaUri
- The URI of the XSUAA service to retrieve the AuthToken from.xsuaaService
- XsuaaService instance to be used to retrieve the AuthToken.public ClientCredentialsHttpDestination(@Nonnull HttpDestinationProperties baseDestination, @Nonnull ClientCredentials clientCredentials, @Nullable ClientCredentialsGrantType grantType, @Nonnull URI xsuaaUri, @Nonnull XsuaaService xsuaaService)
baseDestination
- The destination to wrap.clientCredentials
- The credentials to be used to retrieve the AuthToken.grantType
- The grant type to retrieve the access token with.xsuaaUri
- The URI of the XSUAA service to retrieve the AuthToken from.xsuaaService
- XsuaaService instance to be used to retrieve the AuthToken.@Nonnull public io.vavr.control.Option<Object> get(@Nonnull String key)
get
in interface DestinationProperties
key
- The key to get the value for.Option
object containing the value, if any.@Nonnull public URI getUri()
URI
to communicate with.
This is a mandatory property of a HttpDestination.
getUri
in interface HttpDestinationProperties
URI
to be used with this destination.@Nonnull public io.vavr.control.Option<String> getTlsVersion()
getTlsVersion
in interface HttpDestinationProperties
Option
wrapping the TLS version to use, if any.@Nonnull public io.vavr.control.Option<ProxyConfiguration> getProxyConfiguration()
ProxyConfiguration
to be used when communicating over HTTP.getProxyConfiguration
in interface HttpDestinationProperties
Option
wrapping the ProxyConfiguration
to use, if any.@Nonnull public io.vavr.control.Option<KeyStore> getKeyStore()
getKeyStore
in interface HttpDestinationProperties
Option
wrapping the KeyStore to use, if any.@Nonnull public io.vavr.control.Option<String> getKeyStorePassword()
getKeyStorePassword
in interface HttpDestinationProperties
Option
wrapping the password to use, if any.public boolean isTrustingAllCertificates()
isTrustingAllCertificates
in interface HttpDestinationProperties
true
if all certificates should be accepted, false
otherwise.@Nonnull public io.vavr.control.Option<BasicCredentials> getBasicCredentials()
getBasicCredentials
in interface HttpDestinationProperties
Option
wrapping the BasicCredentials
to use, if any.@Nonnull public AuthenticationType getAuthenticationType()
getAuthenticationType
in interface HttpDestinationProperties
@Nonnull public io.vavr.control.Option<ProxyType> getProxyType()
ProxyType
that is configured for this destination.getProxyType
in interface HttpDestinationProperties
Option
wrapping the ProxyType
to use, if any.@Nonnull public io.vavr.control.Option<KeyStore> getTrustStore()
getTrustStore
in interface HttpDestinationProperties
@Nonnull public io.vavr.control.Option<String> getTrustStorePassword()
getTrustStorePassword
in interface HttpDestinationProperties
@Nonnull public URI getXsuaaUri()
@Nonnull public ClientCredentials getClientCredentials()
@Nonnull public Collection<Header> getHeaders(@Nonnull URI requestUri) throws DestinationAccessException
getHeaders
in interface HttpDestinationProperties
requestUri
- The target URI of a request to which HTTP headers should be added.DestinationAccessException
Copyright © 2019 SAP SE. All rights reserved.