You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by GitBox <gi...@apache.org> on 2021/06/01 17:23:03 UTC

[GitHub] [pulsar] jerrypeng commented on a change in pull request #10685: [Broker] Add multi roles support for authentication and authorization

jerrypeng commented on a change in pull request #10685:
URL: https://github.com/apache/pulsar/pull/10685#discussion_r643335535



##########
File path: pulsar-broker-common/src/main/java/org/apache/pulsar/broker/authentication/OneStageAuthenticationState.java
##########
@@ -35,20 +38,37 @@
 public class OneStageAuthenticationState implements AuthenticationState {
 
     private final AuthenticationDataSource authenticationDataSource;
-    private final String authRole;
+    private List<String> authRoles;
 
     public OneStageAuthenticationState(AuthData authData,
                                        SocketAddress remoteAddress,
                                        SSLSession sslSession,
                                        AuthenticationProvider provider) throws AuthenticationException {
         this.authenticationDataSource = new AuthenticationDataCommand(
             new String(authData.getBytes(), UTF_8), remoteAddress, sslSession);
-        this.authRole = provider.authenticate(authenticationDataSource);
+        if (provider.isSupportMultiRoles()) {

Review comment:
       Why are we making this change here?  The AuthenticationProviderToken doesn't even use this AuthenticationState Impl.  The AuthenticationProviderToken returns TokenAuthenticationState from its `newAuthState()` method.




-- 
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:
users@infra.apache.org