jackMintao commented on code in PR #8936:
URL: https://github.com/apache/hbase/pull/8936#discussion_r4800723561


##########
hbase-server/src/main/resources/hbase-webapps/master/operationDetails.jsp:
##########
@@ -18,28 +18,45 @@
  */
 --%>
 <%@ page contentType="text/html;charset=UTF-8"
-  import="java.util.Date"
+  import="java.util.Collections"
   import="java.util.List"
-  import="org.apache.hadoop.conf.Configuration"
-  import="org.apache.hadoop.hbase.client.Admin"
   import="org.apache.hadoop.hbase.master.HMaster"
   import="org.apache.hadoop.util.StringUtils"
-  import="org.apache.hadoop.hbase.client.ServerType"
-  import="org.apache.hadoop.hbase.client.LogEntry"
-  import="org.apache.hadoop.hbase.client.BalancerRejection"
-  import="org.apache.hadoop.hbase.client.BalancerDecision"
+  import="org.apache.hadoop.hbase.namequeues.BalancerDecisionDetails"
+  import="org.apache.hadoop.hbase.namequeues.BalancerRejectionDetails"
+  import="org.apache.hadoop.hbase.namequeues.NamedQueueRecorder"
+  import="org.apache.hadoop.hbase.namequeues.request.NamedQueueGetRequest"
+  import="org.apache.hadoop.hbase.namequeues.response.NamedQueueGetResponse"
+  import="org.apache.hadoop.hbase.shaded.protobuf.generated.MasterProtos"
+  import="org.apache.hadoop.hbase.shaded.protobuf.generated.RecentLogs"
 %>
 <%
   HMaster master = (HMaster)getServletContext().getAttribute(HMaster.MASTER);
   pageContext.setAttribute("pageTitle", "HBase Master Operation Details: " + 
master.getServerName());
-  Configuration conf = master.getConfiguration();
+  List<RecentLogs.BalancerRejection> logList = Collections.emptyList();
+  List<RecentLogs.BalancerDecision> decisionList = Collections.emptyList();
+  if (master.isInitialized()) {
+    NamedQueueRecorder namedQueueRecorder = master.getNamedQueueRecorder();

Review Comment:
   Right — the direct NamedQueueRecorder read dropped the ADMIN check that
   getLogEntries performed. I chose to restore the check rather than split the 
open
   read into a separate JIRA.
   
   operationDetails.jsp now performs the same global ADMIN check
   (requirePermission(webUser, "getLogEntries", null, ADMIN)) and shows an info 
note
   to others. The Web UI user is only trusted when the UI authentication filter 
was
   actually installed (Kerberos); otherwise the request is denied instead of 
trusting
   the static remoteUser.
   
   Test: a canary balancer rejection is pushed into the named queue — admin 
sees it,
   uiadmin/normal do not; non-admin responses also contain no region plans.



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