Interface AuthenticationDataSource

    • Method Summary

      All Methods Instance Methods Default Methods 
      Modifier and Type Method Description
      default org.apache.pulsar.common.api.AuthData authenticate​(org.apache.pulsar.common.api.AuthData data)
      Evaluate and challenge the data that passed in, and return processed data back.
      default java.lang.String getCommandData()  
      default java.lang.String getHttpAuthType()  
      default java.lang.String getHttpHeader​(java.lang.String name)  
      default java.net.SocketAddress getPeerAddress()  
      default java.lang.String getSubscription()
      Subscription name can be necessary for consumption.
      default java.security.cert.Certificate[] getTlsCertificates()  
      default boolean hasDataFromCommand()
      Check if data from Pulsar protocol are available.
      default boolean hasDataFromHttp()
      Check if data from HTTP are available.
      default boolean hasDataFromPeer()
      Check if data from peer are available.
      default boolean hasDataFromTls()
      Check if data from TLS are available.
      default boolean hasSubscription()
      Check if subscription is defined available.
      default void setSubscription​(java.lang.String subscription)
      Subscription name can be necessary for consumption.
    • Method Detail

      • hasDataFromTls

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

        default java.security.cert.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 java.lang.String getHttpAuthType()
        Returns:
        a authentication scheme, or null if the request is not be authenticated.
      • getHttpHeader

        default java.lang.String getHttpHeader​(java.lang.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 java.lang.String getCommandData()
        Returns:
        authentication data which is stored in a command
      • authenticate

        default org.apache.pulsar.common.api.AuthData authenticate​(org.apache.pulsar.common.api.AuthData data)
                                                            throws javax.naming.AuthenticationException
        Evaluate and challenge the data that passed in, and return processed data back. It is used for mutual authentication like SASL.
        Throws:
        javax.naming.AuthenticationException
      • hasDataFromPeer

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

        default java.net.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 java.lang.String getSubscription()
        Subscription name can be necessary for consumption.
        Returns:
        a String containing the subscription name
      • setSubscription

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