Class JspHelper
java.lang.Object
org.apache.hadoop.hdfs.server.common.JspHelper
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionstatic voidcheckUsername(String expected, String name) Expected user name should be a short name.static StringgetDefaultWebUserName(org.apache.hadoop.conf.Configuration conf) static StringgetRemoteAddr(javax.servlet.http.HttpServletRequest request) static intgetRemotePort(javax.servlet.http.HttpServletRequest request) static org.apache.hadoop.security.UserGroupInformationgetUGI(javax.servlet.http.HttpServletRequest request, org.apache.hadoop.conf.Configuration conf) Same as getUGI(null, request, conf).static org.apache.hadoop.security.UserGroupInformationgetUGI(javax.servlet.ServletContext context, javax.servlet.http.HttpServletRequest request, org.apache.hadoop.conf.Configuration conf) Same as getUGI(context, request, conf, KERBEROS_SSL, true).static org.apache.hadoop.security.UserGroupInformationgetUGI(javax.servlet.ServletContext context, javax.servlet.http.HttpServletRequest request, org.apache.hadoop.conf.Configuration conf, org.apache.hadoop.security.UserGroupInformation.AuthenticationMethod secureAuthMethod, boolean tryUgiParameter) GetUserGroupInformationand possibly the delegation token out of the request.
-
Field Details
-
CURRENT_CONF
- See Also:
-
DELEGATION_PARAMETER_NAME
- See Also:
-
NAMENODE_ADDRESS
- See Also:
-
-
Method Details
-
getDefaultWebUserName
public static String getDefaultWebUserName(org.apache.hadoop.conf.Configuration conf) throws IOException - Throws:
IOException
-
getUGI
public static org.apache.hadoop.security.UserGroupInformation getUGI(javax.servlet.http.HttpServletRequest request, org.apache.hadoop.conf.Configuration conf) throws IOException Same as getUGI(null, request, conf).- Throws:
IOException
-
getUGI
public static org.apache.hadoop.security.UserGroupInformation getUGI(javax.servlet.ServletContext context, javax.servlet.http.HttpServletRequest request, org.apache.hadoop.conf.Configuration conf) throws IOException Same as getUGI(context, request, conf, KERBEROS_SSL, true).- Throws:
IOException
-
getUGI
public static org.apache.hadoop.security.UserGroupInformation getUGI(javax.servlet.ServletContext context, javax.servlet.http.HttpServletRequest request, org.apache.hadoop.conf.Configuration conf, org.apache.hadoop.security.UserGroupInformation.AuthenticationMethod secureAuthMethod, boolean tryUgiParameter) throws IOException GetUserGroupInformationand possibly the delegation token out of the request.- Parameters:
context- the ServletContext that is serving this request.request- the http requestconf- configurationsecureAuthMethod- the AuthenticationMethod used in secure mode.tryUgiParameter- Should it try the ugi parameter?- Returns:
- a new user from the request
- Throws:
org.apache.hadoop.security.AccessControlException- if the request has no tokenIOException
-
getRemoteAddr
-
getRemotePort
public static int getRemotePort(javax.servlet.http.HttpServletRequest request) -
checkUsername
Expected user name should be a short name.- Throws:
IOException
-