BewareMyPower commented on code in PR #18529:
URL: https://github.com/apache/pulsar/pull/18529#discussion_r1025981351


##########
pulsar-broker-common/src/main/java/org/apache/pulsar/broker/authentication/AuthenticationService.java:
##########
@@ -107,6 +108,8 @@ public String authenticateHttpRequest(HttpServletRequest 
request, Authentication
                     LOG.debug("Authentication failed for provider " + 
providerToUse.getAuthMethodName() + " : "
                             + e.getMessage(), e);
                 }
+                // Store the exception so we can throw it later instead of a 
generic one
+                authenticationException = e;
                 throw e;

Review Comment:
   Maybe the original purpose is removing `throw e`? But the difference is only 
that the following check will be performed even if the authentication failed.
   
   ```java
               if (StringUtils.isNotBlank(anonymousUserRole)) {
                   return anonymousUserRole;
               }
   ```



-- 
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.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to