Class OneStageAuthenticationState
java.lang.Object
org.apache.pulsar.broker.authentication.OneStageAuthenticationState
- All Implemented Interfaces:
AuthenticationState
A class to track single stage authentication. This class assumes that:
1.
authenticateAsync(AuthData) is called once and when the CompletableFuture completes,
authentication is complete.
2. Authentication does not expire, so AuthenticationState.isExpired() always returns false.
See AuthenticationState for Pulsar's contract on how this interface is used by Pulsar.
-
Constructor Summary
ConstructorsConstructorDescriptionOneStageAuthenticationState(javax.servlet.http.HttpServletRequest request, AuthenticationProvider provider) OneStageAuthenticationState(org.apache.pulsar.common.api.AuthData authData, SocketAddress remoteAddress, SSLSession sslSession, AuthenticationProvider provider) Constructor for aOneStageAuthenticationStatewhere there is no authentication performed during initialization. -
Method Summary
Modifier and TypeMethodDescriptionorg.apache.pulsar.common.api.AuthDataauthenticate(org.apache.pulsar.common.api.AuthData authData) Deprecated.CompletableFuture<org.apache.pulsar.common.api.AuthData>authenticateAsync(org.apache.pulsar.common.api.AuthData authData) Warning: this method is not intended to be called concurrently.Return AuthenticationDataSource.After the authentication between client and broker completed, get authentication role represent for the client.booleanDeprecated.rely on result fromauthenticateAsync(AuthData).Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.apache.pulsar.broker.authentication.AuthenticationState
getStateId, isExpired, refreshAuthentication
-
Constructor Details
-
OneStageAuthenticationState
public OneStageAuthenticationState(org.apache.pulsar.common.api.AuthData authData, SocketAddress remoteAddress, SSLSession sslSession, AuthenticationProvider provider) Constructor for aOneStageAuthenticationStatewhere there is no authentication performed during initialization.- Parameters:
remoteAddress- - remoteAddress associated with theAuthenticationStatesslSession- - sslSession associated with theAuthenticationStateprovider- -AuthenticationProviderto use to verifyAuthData
-
OneStageAuthenticationState
public OneStageAuthenticationState(javax.servlet.http.HttpServletRequest request, AuthenticationProvider provider)
-
-
Method Details
-
getAuthRole
Description copied from interface:AuthenticationStateAfter the authentication between client and broker completed, get authentication role represent for the client. It should throw exception if auth not complete.- Specified by:
getAuthRolein interfaceAuthenticationState- Throws:
AuthenticationException
-
getAuthDataSource
Description copied from interface:AuthenticationStateReturn AuthenticationDataSource.- Specified by:
getAuthDataSourcein interfaceAuthenticationState
-
authenticateAsync
public CompletableFuture<org.apache.pulsar.common.api.AuthData> authenticateAsync(org.apache.pulsar.common.api.AuthData authData) Warning: this method is not intended to be called concurrently.- Specified by:
authenticateAsyncin interfaceAuthenticationState
-
authenticate
@Deprecated(since="3.0.0") public org.apache.pulsar.common.api.AuthData authenticate(org.apache.pulsar.common.api.AuthData authData) throws AuthenticationException Deprecated.Description copied from interface:AuthenticationStateChallenge passed in auth data and get response data.- Specified by:
authenticatein interfaceAuthenticationState- Throws:
AuthenticationException
-
isComplete
Deprecated.rely on result fromauthenticateAsync(AuthData). For more information, see the Javadoc forAuthenticationState.isComplete().Description copied from interface:AuthenticationStateWhether the authentication is completed or not.- Specified by:
isCompletein interfaceAuthenticationState
-
authenticateAsync(AuthData)