ivankelly commented on a change in pull request #3677: PIP-30: interface and mutual change authentication URL: https://github.com/apache/pulsar/pull/3677#discussion_r264283198
########## File path: pulsar-broker-common/src/main/java/org/apache/pulsar/broker/authentication/AuthenticationProvider.java ########## @@ -50,32 +50,28 @@ String getAuthMethodName(); /** - * Validate the authentication for the given credentials with the specified authentication data + * Validate the authentication for the given credentials with the specified authentication data. + * This method is useful in one stage authn, if you're not doing one stage or if you're providing + * your own state implementation for one stage authn, it should throw an exception. * * @param authData * provider specific authentication data * @return the "role" string for the authenticated connection, if the authentication was successful * @throws AuthenticationException * if the credentials are not valid */ - String authenticate(AuthenticationDataSource authData) throws AuthenticationException; - - /** - * Create an authentication data provider which provides the data that this broker will be sent to the client. - */ - default AuthenticationDataSource newAuthDataSource(AuthData authData, - SocketAddress remoteAddress, - SSLSession sslSession) throws IOException { - return new AuthenticationDataCommand( - new String(authData.getBytes(), Charset.forName("UTF-8")), remoteAddress, sslSession); + default String authenticate(AuthenticationDataSource authData) throws AuthenticationException { + throw new UnsupportedOperationException(); Review comment: It would be better to throw AuthenticationException with some message about One stage auth unsupported. ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services