Interface AuthenticationDataProvider

All Superinterfaces:
Serializable

@LimitedPrivate @Stable public interface AuthenticationDataProvider extends Serializable
Interface for accessing data which are used in variety of authentication schemes on client side.
  • Method Details

    • hasDataForTls

      default boolean hasDataForTls()
      Check if data for TLS are available.
      Returns:
      true if this authentication data contain data for TLS
    • getTlsCertificates

      default Certificate[] getTlsCertificates()
      Returns:
      a client certificate chain, or null if the data are not available
    • getTlsCerificateFilePath

      default String getTlsCerificateFilePath()
      Returns:
      a client certificate file path
    • getTlsPrivateKey

      default PrivateKey getTlsPrivateKey()
      Returns:
      a private key for the client certificate, or null if the data are not available
    • getTlsPrivateKeyFilePath

      default String getTlsPrivateKeyFilePath()
      Returns:
      a private key file path
    • getTlsTrustStoreStream

      default 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 String getHttpAuthType()
      Returns:
      a authentication scheme, or null if the request will not be authenticated.
    • getHttpHeaders

      default Set<Map.Entry<String,String>> getHttpHeaders() throws Exception
      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

      default String getCommandData()
      Returns:
      authentication data which will be stored in a command
    • authenticate

      default AuthData authenticate(AuthData data) throws 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:
      AuthenticationException