Revert "HADOOP-13707. Skip authorization for anonymous user to access Hadoop"

This reverts commit 7993fb5b81.
This commit is contained in:
Eric Yang 2019-02-21 17:35:19 -05:00
parent 665cad03f3
commit da854234a2
1 changed files with 2 additions and 8 deletions

View File

@ -25,7 +25,6 @@ import java.util.List;
import java.util.Map;
import java.util.TreeMap;
import javax.servlet.ServletContext;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
@ -110,12 +109,7 @@ public class MetricsServlet extends HttpServlet {
public void doGet(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
// If user is a static user and auth Type is null, that means
// there is a non-security environment and no need authorization,
// otherwise, do the authorization.
final ServletContext servletContext = getServletContext();
if (!HttpServer2.isStaticUserAndNoneAuthType(servletContext, request) &&
!HttpServer2.isInstrumentationAccessAllowed(servletContext,
if (!HttpServer2.isInstrumentationAccessAllowed(getServletContext(),
request, response)) {
return;
}