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.
    • Field Detail

      • PULSAR_AUTH_METHOD_NAME

        static final java.lang.String PULSAR_AUTH_METHOD_NAME
        See Also:
        Constant Field Values
    • 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