Package org.apache.pulsar.client.api
Interface AuthenticationDataProvider
-
- All Superinterfaces:
java.io.Serializable
@LimitedPrivate @Stable public interface AuthenticationDataProvider extends java.io.Serializable
Interface for accessing data which are used in variety of authentication schemes on client side.
-
-
Method Summary
All Methods Instance Methods Default Methods Modifier and Type Method Description default AuthData
authenticate(AuthData data)
For mutual authentication, This method use passed in `data` to evaluate and challenge, then returns null if authentication has completed; returns authenticated data back to server side, if authentication has not completed.default java.lang.String
getCommandData()
default java.lang.String
getHttpAuthType()
default java.util.Set<java.util.Map.Entry<java.lang.String,java.lang.String>>
getHttpHeaders()
default java.lang.String
getTlsCerificateFilePath()
default java.security.cert.Certificate[]
getTlsCertificates()
default KeyStoreParams
getTlsKeyStoreParams()
Used for TLS authentication with keystore type.default java.security.PrivateKey
getTlsPrivateKey()
default java.lang.String
getTlsPrivateKeyFilePath()
default java.io.InputStream
getTlsTrustStoreStream()
default boolean
hasDataForHttp()
Check if data for HTTP are available.default boolean
hasDataForTls()
Check if data for TLS are available.default boolean
hasDataFromCommand()
Check if data from Pulsar protocol are available.
-
-
-
Method Detail
-
hasDataForTls
default boolean hasDataForTls()
Check if data for TLS are available.- Returns:
- true if this authentication data contain data for TLS
-
getTlsCertificates
default java.security.cert.Certificate[] getTlsCertificates()
- Returns:
- a client certificate chain, or null if the data are not available
-
getTlsCerificateFilePath
default java.lang.String getTlsCerificateFilePath()
- Returns:
- a client certificate file path
-
getTlsPrivateKey
default java.security.PrivateKey getTlsPrivateKey()
- Returns:
- a private key for the client certificate, or null if the data are not available
-
getTlsPrivateKeyFilePath
default java.lang.String getTlsPrivateKeyFilePath()
- Returns:
- a private key file path
-
getTlsTrustStoreStream
default java.io.InputStream getTlsTrustStoreStream()
- Returns:
- an input-stream of the trust store, or null if the trust-store provided at
ClientConfigurationData#getTlsTrustStorePath()
-
getTlsKeyStoreParams
default KeyStoreParams getTlsKeyStoreParams()
Used for TLS authentication with keystore type.- Returns:
- a KeyStoreParams for the client certificate chain, or null if the data are not available
-
hasDataForHttp
default boolean hasDataForHttp()
Check if data for HTTP are available.- Returns:
- true if this authentication data contain data for HTTP
-
getHttpAuthType
default java.lang.String getHttpAuthType()
- Returns:
- a authentication scheme, or
null
if the request will not be authenticated.
-
getHttpHeaders
default java.util.Set<java.util.Map.Entry<java.lang.String,java.lang.String>> getHttpHeaders() throws java.lang.Exception
- Returns:
- an enumeration of all the header names
- Throws:
java.lang.Exception
-
hasDataFromCommand
default boolean hasDataFromCommand()
Check if data from Pulsar protocol are available.- Returns:
- true if this authentication data contain data from Pulsar protocol
-
getCommandData
default java.lang.String getCommandData()
- Returns:
- authentication data which will be stored in a command
-
authenticate
default AuthData authenticate(AuthData data) throws javax.naming.AuthenticationException
For mutual authentication, This method use passed in `data` to evaluate and challenge, then returns null if authentication has completed; returns authenticated data back to server side, if authentication has not completed.Mainly used for mutual authentication like sasl.
- Throws:
javax.naming.AuthenticationException
-
-