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
ConstructorDescriptionOneStageAuthenticationState
(javax.servlet.http.HttpServletRequest request, AuthenticationProvider provider) OneStageAuthenticationState
(org.apache.pulsar.common.api.AuthData authData, SocketAddress remoteAddress, SSLSession sslSession, AuthenticationProvider provider) Constructor for aOneStageAuthenticationState
where there is no authentication performed during initialization. -
Method Summary
Modifier and TypeMethodDescriptionorg.apache.pulsar.common.api.AuthData
authenticate
(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.boolean
Deprecated.rely on result fromauthenticateAsync(AuthData)
.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods 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 aOneStageAuthenticationState
where there is no authentication performed during initialization.- Parameters:
remoteAddress
- - remoteAddress associated with theAuthenticationState
sslSession
- - sslSession associated with theAuthenticationState
provider
- -AuthenticationProvider
to use to verifyAuthData
-
OneStageAuthenticationState
public OneStageAuthenticationState(javax.servlet.http.HttpServletRequest request, AuthenticationProvider provider)
-
-
Method Details
-
getAuthRole
Description copied from interface:AuthenticationState
After the authentication between client and broker completed, get authentication role represent for the client. It should throw exception if auth not complete.- Specified by:
getAuthRole
in interfaceAuthenticationState
- Throws:
AuthenticationException
-
getAuthDataSource
Description copied from interface:AuthenticationState
Return AuthenticationDataSource.- Specified by:
getAuthDataSource
in 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:
authenticateAsync
in 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:AuthenticationState
Challenge passed in auth data and get response data.- Specified by:
authenticate
in interfaceAuthenticationState
- Throws:
AuthenticationException
-
isComplete
Deprecated.rely on result fromauthenticateAsync(AuthData)
. For more information, see the Javadoc forAuthenticationState.isComplete()
.Description copied from interface:AuthenticationState
Whether the authentication is completed or not.- Specified by:
isComplete
in interfaceAuthenticationState
-
authenticateAsync(AuthData)