Interface AuthenticationDataSource

All Known Implementing Classes:
AuthenticationDataCommand, AuthenticationDataHttp, AuthenticationDataHttps, AuthenticationDataSubscription

public interface AuthenticationDataSource
Interface for accessing data which are used in variety of authentication schemes on server side.
  • Method Details

    • hasDataFromTls

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

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

      default boolean hasDataFromHttp()
      Check if data from HTTP are available.
      Returns:
      true if this authentication data contain data from HTTP
    • getHttpAuthType

      default String getHttpAuthType()
      Returns:
      a authentication scheme, or null if the request is not be authenticated.
    • getHttpHeader

      default String getHttpHeader(String name)
      Returns:
      a String containing the value of the specified header, or null if the header does not exist.
    • 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 is stored in a command
    • authenticate

      @Deprecated default org.apache.pulsar.common.api.AuthData authenticate(org.apache.pulsar.common.api.AuthData data) throws AuthenticationException
      Evaluate and challenge the data that passed in, and return processed data back. It is used for mutual authentication like SASL. NOTE: this method is not called by the Pulsar authentication framework.
      Throws:
      AuthenticationException
    • hasDataFromPeer

      default boolean hasDataFromPeer()
      Check if data from peer are available.
      Returns:
      true if this authentication data contain data from peer
    • getPeerAddress

      default SocketAddress getPeerAddress()
      Returns:
      a String containing the IP address of the client
    • hasSubscription

      default boolean hasSubscription()
      Check if subscription is defined available.
      Returns:
      true if this authentication data contain subscription
    • getSubscription

      default String getSubscription()
      Subscription name can be necessary for consumption.
      Returns:
      a String containing the subscription name
    • setSubscription

      default void setSubscription(String subscription)
      Subscription name can be necessary for consumption.