Package org.apache.pulsar.client.api
Interface AuthenticationDataProvider
- All Superinterfaces:
Serializable
Interface for accessing data which are used in variety of authentication schemes on client side.
-
Field Summary
-
Method Summary
Modifier and TypeMethodDescriptiondefault 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 String
default String
default String
default Certificate[]
default KeyStoreParams
Used for TLS authentication with keystore type.default PrivateKey
default String
default InputStream
default boolean
Check if data for HTTP are available.default boolean
Check if data for TLS are available.default boolean
Check if data from Pulsar protocol are available.
-
Field Details
-
PULSAR_AUTH_METHOD_NAME
- See Also:
-
-
Method Details
-
hasDataForTls
default boolean hasDataForTls()Check if data for TLS are available.- Returns:
- true if this authentication data contain data for TLS
-
getTlsCertificates
- Returns:
- a client certificate chain, or null if the data are not available
-
getTlsCerificateFilePath
- Returns:
- a client certificate file path
-
getTlsPrivateKey
- Returns:
- a private key for the client certificate, or null if the data are not available
-
getTlsPrivateKeyFilePath
- Returns:
- a private key file path
-
getTlsTrustStoreStream
- Returns:
- an input-stream of the trust store, or null if the trust-store provided at
ClientConfigurationData#getTlsTrustStorePath()
-
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
- Returns:
- a authentication scheme, or
null
if the request will not be authenticated.
-
getHttpHeaders
- Returns:
- an enumeration of all the header names
- Throws:
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
- Returns:
- authentication data which will be stored in a command
-
authenticate
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:
AuthenticationException
-