diff --git a/pulsar-broker-common/src/main/java/org/apache/pulsar/broker/authentication/AuthenticationDataSource.java b/pulsar-broker-common/src/main/java/org/apache/pulsar/broker/authentication/AuthenticationDataSource.java index 453fafbab3244..42a6ab445543a 100644 --- a/pulsar-broker-common/src/main/java/org/apache/pulsar/broker/authentication/AuthenticationDataSource.java +++ b/pulsar-broker-common/src/main/java/org/apache/pulsar/broker/authentication/AuthenticationDataSource.java @@ -102,10 +102,7 @@ default String getCommandData() { /** * 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. - * @deprecated use {@link AuthenticationProvider} or {@link AuthenticationState}. */ - @Deprecated default AuthData authenticate(AuthData data) throws AuthenticationException { throw new AuthenticationException("Not supported"); } diff --git a/pulsar-broker-common/src/main/java/org/apache/pulsar/broker/authentication/AuthenticationProvider.java b/pulsar-broker-common/src/main/java/org/apache/pulsar/broker/authentication/AuthenticationProvider.java index 6a25cc57db2c5..e3c50e7a6c6d5 100644 --- a/pulsar-broker-common/src/main/java/org/apache/pulsar/broker/authentication/AuthenticationProvider.java +++ b/pulsar-broker-common/src/main/java/org/apache/pulsar/broker/authentication/AuthenticationProvider.java @@ -21,15 +21,12 @@ import java.io.Closeable; import java.io.IOException; import java.net.SocketAddress; -import java.util.concurrent.CompletableFuture; import javax.naming.AuthenticationException; import javax.net.ssl.SSLSession; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import org.apache.pulsar.broker.ServiceConfiguration; import org.apache.pulsar.common.api.AuthData; -import org.apache.pulsar.common.classification.InterfaceStability; -import org.apache.pulsar.common.util.FutureUtil; /** * Provider of authentication mechanism. @@ -51,29 +48,6 @@ public interface AuthenticationProvider extends Closeable { */ String getAuthMethodName(); - /** - * Validate the authentication for the given credentials with the specified authentication data. - * This method is useful in one stage authentication, if you're not doing one stage or if you're providing - * your own state implementation for one stage authentication, it should return a failed future. - * - *
Warning: the calling thread is an IO thread. Any implementation that relies on blocking behavior - * must ensure that the execution is completed using a separate thread pool to ensure IO threads - * are never blocked.
- * - * @param authData authentication data generated while initiating a connection. There are several types, - * including, but not strictly limited to, {@link AuthenticationDataHttp}, - * {@link AuthenticationDataHttps}, and {@link AuthenticationDataCommand}. - * @return A completed future with the "role" string for the authenticated connection, if authentication is - * successful, or a failed future if the authData is not valid. - */ - default CompletableFutureWarning: the calling thread is an IO thread. Any implementations that rely on blocking behavior - * must ensure that the execution is completed on using a separate thread pool to ensure IO threads - * are never blocked.
- * - *Note: this method is marked as unstable because the Pulsar code base only calls it for the - * Pulsar Broker Auth SASL plugin. All non SASL HTTP requests are authenticated using the - * {@link AuthenticationProvider#authenticateAsync(AuthenticationDataSource)} method. As such, - * this method might be removed in favor of the SASL provider implementing the - * {@link AuthenticationProvider#authenticateAsync(AuthenticationDataSource)} method.
- * - * @return Set response, according to passed in request. - * and return whether we should do following chain.doFilter or not. - */ - @InterfaceStability.Unstable - default CompletableFutureNote: the implementation of {@link AuthenticationState#authenticate(AuthData)} converted a null result into a - * zero length byte array when {@link AuthenticationState#isComplete()} returned false after authentication. In - * order to simplify this interface, the determination of whether to send a challenge back to the client is only - * based on the result of this method. In order to maintain backwards compatibility, the default implementation of - * this method calls {@link AuthenticationState#isComplete()} and returns a result compliant with the new - * paradigm.
- */ - default CompletableFuture