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

This reverts commit 7993fb5b8127a219e6c936206b5c5c0790e82946.
This commit is contained in:
Eric Yang 2019-02-21 17:35:19 -05:00
parent 665cad03f3
commit da854234a2

View File

@ -25,7 +25,6 @@
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,13 +109,8 @@ Map<String, Map<String, List<TagsMetricsPair>>> makeMap(
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,
request, response)) {
if (!HttpServer2.isInstrumentationAccessAllowed(getServletContext(),
request, response)) {
return;
}