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 Summary
Modifier and TypeMethodDescriptiondefault org.apache.pulsar.common.api.AuthData
authenticate
(org.apache.pulsar.common.api.AuthData data) Deprecated.default String
default String
default String
getHttpHeader
(String name) default SocketAddress
default String
Subscription name can be necessary for consumption.default Certificate[]
default boolean
Check if data from Pulsar protocol are available.default boolean
Check if data from HTTP are available.default boolean
Check if data from peer are available.default boolean
Check if data from TLS are available.default boolean
Check if subscription is defined available.default void
setSubscription
(String subscription) Subscription name can be necessary for consumption.
-
Method Details
-
hasDataFromTls
default boolean hasDataFromTls()Check if data from TLS are available.- Returns:
- true if this authentication data contain data from TLS
-
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
- Returns:
- a authentication scheme, or
null
if the request is not be authenticated.
-
getHttpHeader
- Returns:
- a
String
containing the value of the specified header, ornull
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
- 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 Deprecated.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
- 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
Subscription name can be necessary for consumption.- Returns:
- a
String
containing the subscription name
-
setSubscription
Subscription name can be necessary for consumption.
-
AuthenticationProvider
orAuthenticationState
.