jackMintao commented on code in PR #8936:
URL: https://github.com/apache/hbase/pull/8936#discussion_r4800713280
##########
hbase-server/src/main/resources/hbase-webapps/master/hbck.jsp:
##########
@@ -39,27 +39,37 @@
<%@ page import="org.apache.hadoop.hbase.master.janitor.CatalogJanitorReport"
%>
<%@ page import="java.util.Optional" %>
<%@ page import="org.apache.hadoop.hbase.util.EnvironmentEdgeManager" %>
-<%@ page
import="org.apache.hbase.thirdparty.com.google.protobuf.ServiceException" %>
+<%@ page import="java.io.IOException" %>
+<%@ page import="org.apache.hadoop.hbase.http.InfoServer" %>
<%
final String cacheParameterValue = request.getParameter("cache");
final HMaster master = (HMaster)
getServletContext().getAttribute(HMaster.MASTER);
pageContext.setAttribute("pageTitle", "HBase Master HBCK Report: " +
master.getServerName());
- String hbckChoreErrorMessage = null;
+ final boolean canModifyUI =
+ InfoServer.canUserModifyUI(request, getServletContext(),
master.getConfiguration());
Review Comment:
Thanks for the suggestion — I validated it before applying.
You're right: on a default cluster (hbase.security.authorization=false,
non-Kerberos
UI) InfoServer.canUserModifyUI() is always false, so the page stopped
refreshing.
The gate is now:
!readOnly && (!authorizationEnabled || canUserModifyUI(...))
i.e. the UI gate is skipped when HBase authorization is off. I added
TestInfoServersHbck (default cluster, readonly=false) which asserts /hbck.jsp
actually runs the chore and creates a report; the existing read-only test
still
passes.
One additional hardening: the trusted-UI decision is now taken from the
authentication filter installed by InfoServer at startup, not from the
current
Configuration. This prevents a config reload (or a whitespace value such as
" kerberos ") from making the config claim Kerberos while the static-user
filter
is still serving requests.
--
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]