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.AuthDataauthenticate(org.apache.pulsar.common.api.AuthData data) Deprecated.default Stringdefault Stringdefault StringgetHttpHeader(String name) default SocketAddressdefault StringSubscription name can be necessary for consumption.default Certificate[]default booleanCheck if data from Pulsar protocol are available.default booleanCheck if data from HTTP are available.default booleanCheck if data from peer are available.default booleanCheck if data from TLS are available.default booleanCheck if subscription is defined available.default voidsetSubscription(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
nullif the request is not be authenticated.
-
getHttpHeader
- 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
- 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
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
Subscription name can be necessary for consumption.- Returns:
- a
Stringcontaining the subscription name
-
setSubscription
Subscription name can be necessary for consumption.
-
AuthenticationProviderorAuthenticationState.