public class HttpServer extends Object
Modifier and Type | Class and Description |
---|---|
static class |
HttpServer.Builder |
Modifier and Type | Field and Description |
---|---|
static String |
ADMINS_ACL |
static String |
CONF_CONTEXT_ATTRIBUTE |
Modifier and Type | Method and Description |
---|---|
void |
addServlet(String name,
String pathSpec,
Class<? extends javax.servlet.http.HttpServlet> clazz)
Add a servlet in the server.
|
int |
getPort() |
static boolean |
hasAccess(String remoteUser,
String user,
javax.servlet.ServletContext ctx,
javax.servlet.http.HttpServletRequest request)
Check if the remote user has access to an object (e.g.
|
static boolean |
isInstrumentationAccessAllowed(javax.servlet.ServletContext servletContext,
javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
Checks the user has privileges to access to instrumentation servlets.
|
static boolean |
isInstrumentationAccessAllowedStrict(javax.servlet.ServletContext servletContext,
javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
Same as
isInstrumentationAccessAllowed(ServletContext, HttpServletRequest, HttpServletResponse)
except that it returns true only if hadoop.security.instrumentation.requires.admin is set to true. |
void |
start() |
void |
stop() |
public static final String CONF_CONTEXT_ATTRIBUTE
public static final String ADMINS_ACL
public int getPort()
@InterfaceAudience.LimitedPrivate(value="hive") public static boolean isInstrumentationAccessAllowed(javax.servlet.ServletContext servletContext, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) throws IOException
If hadoop.security.instrumentation.requires.admin
is set to FALSE
(default value) it always returns TRUE.
If hadoop.security.instrumentation.requires.admin
is set to TRUE
it will check if the current user is in the admin ACLS. If the user is
in the admin ACLs it returns TRUE, otherwise it returns FALSE.
servletContext
- the servlet context.request
- the servlet request.response
- the servlet response.IOException
@InterfaceAudience.LimitedPrivate(value="hive") public static boolean isInstrumentationAccessAllowedStrict(javax.servlet.ServletContext servletContext, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) throws IOException
isInstrumentationAccessAllowed(ServletContext, HttpServletRequest, HttpServletResponse)
except that it returns true only if hadoop.security.instrumentation.requires.admin
is set to true.IOException
public static boolean hasAccess(String remoteUser, String user, javax.servlet.ServletContext ctx, javax.servlet.http.HttpServletRequest request) throws IOException
ctx
- the context containing the admin ACL.request
- the HTTP request.remoteUser
- the user that sent out the request.user
- the user of the object being checked against.IOException
Copyright © 2022 The Apache Software Foundation. All rights reserved.