soumitra-st commented on code in PR #11501:
URL: https://github.com/apache/pinot/pull/11501#discussion_r1323288750


##########
pinot-broker/src/main/java/org/apache/pinot/broker/api/resources/PinotBrokerDebug.java:
##########
@@ -158,7 +158,7 @@ public Map<ServerInstance, List<String>> 
getRoutingTableForQuery(
       if (!_accessControlFactory.create()
           .hasAccess(httpHeaders, TargetType.TABLE, 
brokerRequest.getQuerySource().getTableName(),
               Actions.Table.GET_ROUTING_TABLE)) {
-        throw new WebApplicationException("Permission denied", 
Response.Status.FORBIDDEN);
+        throw new WebApplicationException("Unauthorized", 
Response.Status.UNAUTHORIZED);

Review Comment:
   Let's keep 403 here, and handle the authN issues in the access control 
object, such as for BasicAuthAccessControl, the change should be done 
[HERE](https://github.com/apache/pinot/blob/70c4c5b8019b3c3b71865bde71e4899c3659082e/pinot-broker/src/main/java/org/apache/pinot/broker/broker/BasicAuthAccessControlFactory.java#L90)
 .
   Instead of
         if (!principalOpt.isPresent()) {
           // no matching token? reject
           return false;
         }
   
   try:
   
         if (!principalOpt.isPresent()) {
           // no matching token? reject
          throw new WebApplicationException("No token", 
Response.Status.UNAUTHORIZED);
         }



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


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to