Interface AuthenticationDataSource
-
- All Known Implementing Classes:
AuthenticationDataCommand,AuthenticationDataHttp,AuthenticationDataHttps,AuthenticationDataSubscription
public interface AuthenticationDataSourceInterface for accessing data which are used in variety of authentication schemes on server side.
-
-
Method Summary
All Methods Instance Methods Default Methods Modifier and Type Method Description default org.apache.pulsar.common.api.AuthDataauthenticate(org.apache.pulsar.common.api.AuthData data)Evaluate and challenge the data that passed in, and return processed data back.default java.lang.StringgetCommandData()default java.lang.StringgetHttpAuthType()default java.lang.StringgetHttpHeader(java.lang.String name)default java.net.SocketAddressgetPeerAddress()default java.lang.StringgetSubscription()Subscription name can be necessary for consumption.default java.security.cert.Certificate[]getTlsCertificates()default booleanhasDataFromCommand()Check if data from Pulsar protocol are available.default booleanhasDataFromHttp()Check if data from HTTP are available.default booleanhasDataFromPeer()Check if data from peer are available.default booleanhasDataFromTls()Check if data from TLS are available.default booleanhasSubscription()Check if subscription is defined available.default voidsetSubscription(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
nullif the request is not be authenticated.
-
getHttpHeader
default java.lang.String getHttpHeader(java.lang.String name)
- Returns:
- a
Stringcontaining the value of the specified header, ornullif 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.AuthenticationExceptionEvaluate 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
Stringcontaining 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
Stringcontaining the subscription name
-
setSubscription
default void setSubscription(java.lang.String subscription)
Subscription name can be necessary for consumption.
-
-