Tabnine Logo
JspHelper.getUGI
Code IndexAdd Tabnine to your IDE (free)

How to use
getUGI
method
in
org.apache.hadoop.hdfs.server.common.JspHelper

Best Java code snippets using org.apache.hadoop.hdfs.server.common.JspHelper.getUGI (Showing top 17 results out of 315)

origin: org.apache.hadoop/hadoop-hdfs

/** Same as getUGI(null, request, conf). */
public static UserGroupInformation getUGI(HttpServletRequest request,
  Configuration conf) throws IOException {
 return getUGI(null, request, conf);
}

origin: org.apache.hadoop/hadoop-hdfs

/** Same as getUGI(context, request, conf, KERBEROS_SSL, true). */
public static UserGroupInformation getUGI(ServletContext context,
  HttpServletRequest request, Configuration conf) throws IOException {
 return getUGI(context, request, conf, AuthenticationMethod.KERBEROS_SSL, true);
}
origin: org.apache.hadoop/hadoop-hdfs

@Override
public UserGroupInformation getValue(final HttpContext context) {
 final Configuration conf = (Configuration) servletcontext
   .getAttribute(JspHelper.CURRENT_CONF);
 try {
  return JspHelper.getUGI(servletcontext, request, conf,
    AuthenticationMethod.KERBEROS, false);
 } catch (IOException e) {
  throw new SecurityException(
    SecurityUtil.FAILED_TO_GET_UGI_MSG_HEADER + " " + e, e);
 }
}
origin: org.apache.hadoop/hadoop-hdfs

 protected UserGroupInformation getUGI(HttpServletRequest request,
                    Configuration conf) throws IOException {
  return JspHelper.getUGI(getServletContext(), request, conf);
 }
}
origin: ch.cern.hadoop/hadoop-hdfs

/** Same as getUGI(null, request, conf). */
public static UserGroupInformation getUGI(HttpServletRequest request,
  Configuration conf) throws IOException {
 return getUGI(null, request, conf);
}

origin: ch.cern.hadoop/hadoop-hdfs

/** Same as getUGI(context, request, conf, KERBEROS_SSL, true). */
public static UserGroupInformation getUGI(ServletContext context,
  HttpServletRequest request, Configuration conf) throws IOException {
 return getUGI(context, request, conf, AuthenticationMethod.KERBEROS_SSL, true);
}
origin: io.prestosql.hadoop/hadoop-apache

/** Same as getUGI(null, request, conf). */
public static UserGroupInformation getUGI(HttpServletRequest request,
  Configuration conf) throws IOException {
 return getUGI(null, request, conf);
}

origin: io.prestosql.hadoop/hadoop-apache

/** Same as getUGI(context, request, conf, KERBEROS_SSL, true). */
public static UserGroupInformation getUGI(ServletContext context,
  HttpServletRequest request, Configuration conf) throws IOException {
 return getUGI(context, request, conf, AuthenticationMethod.KERBEROS_SSL, true);
}
origin: ch.cern.hadoop/hadoop-hdfs

@Override
public UserGroupInformation getValue(final HttpContext context) {
 final Configuration conf = (Configuration) servletcontext
   .getAttribute(JspHelper.CURRENT_CONF);
 try {
  return JspHelper.getUGI(servletcontext, request, conf,
    AuthenticationMethod.KERBEROS, false);
 } catch (IOException e) {
  throw new SecurityException(
    SecurityUtil.FAILED_TO_GET_UGI_MSG_HEADER + " " + e, e);
 }
}
origin: io.prestosql.hadoop/hadoop-apache

@Override
public UserGroupInformation getValue(final HttpContext context) {
 final Configuration conf = (Configuration) servletcontext
   .getAttribute(JspHelper.CURRENT_CONF);
 try {
  return JspHelper.getUGI(servletcontext, request, conf,
    AuthenticationMethod.KERBEROS, false);
 } catch (IOException e) {
  throw new SecurityException(
    SecurityUtil.FAILED_TO_GET_UGI_MSG_HEADER + " " + e, e);
 }
}
origin: io.prestosql.hadoop/hadoop-apache

 protected UserGroupInformation getUGI(HttpServletRequest request,
                    Configuration conf) throws IOException {
  return JspHelper.getUGI(getServletContext(), request, conf);
 }
}
origin: ch.cern.hadoop/hadoop-hdfs

 protected UserGroupInformation getUGI(HttpServletRequest request,
                    Configuration conf) throws IOException {
  return JspHelper.getUGI(getServletContext(), request, conf);
 }
}
origin: org.apache.hadoop/hadoop-hdfs-test

@Test
public void testGetUgi() throws IOException {
 conf.set(DFSConfigKeys.FS_DEFAULT_NAME_KEY, "hdfs://localhost:4321/");
 HttpServletRequest request = mock(HttpServletRequest.class);
 String user = "TheDoctor";
 Text userText = new Text(user);
 DelegationTokenIdentifier dtId = new DelegationTokenIdentifier(userText,
   userText, null);
 Token<DelegationTokenIdentifier> token = new Token<DelegationTokenIdentifier>(
   dtId, new DummySecretManager(0, 0, 0, 0));
 String tokenString = token.encodeToUrlString();
 when(request.getParameter(JspHelper.DELEGATION_PARAMETER_NAME)).thenReturn(
   tokenString);
 when(request.getRemoteUser()).thenReturn(user);
 conf.set(DFSConfigKeys.HADOOP_SECURITY_AUTHENTICATION, "kerberos");
 UserGroupInformation.setConfiguration(conf);
 InetSocketAddress serviceAddr = NameNode.getAddress(conf);
 Text tokenService = new Text(serviceAddr.getAddress().getHostAddress()
   + ":" + serviceAddr.getPort());
 UserGroupInformation ugi = JspHelper.getUGI(request, conf);
 Token<? extends TokenIdentifier> tokenInUgi = ugi.getTokens().iterator()
   .next();
 Assert.assertEquals(tokenInUgi.getService(), tokenService);
}

origin: ch.cern.hadoop/hadoop-hdfs

private void verifyServiceInToken(ServletContext context,
  HttpServletRequest request, String expected) throws IOException {
 UserGroupInformation ugi = JspHelper.getUGI(context, request, conf);
 Token<? extends TokenIdentifier> tokenInUgi = ugi.getTokens().iterator()
   .next();
 Assert.assertEquals(expected, tokenInUgi.getService().toString());
}

origin: ch.cern.hadoop/hadoop-hdfs

 JspHelper.getUGI(context, request, conf);
 Assert.fail("bad request allowed");
} catch (IOException ioe) {
 JspHelper.getUGI(context, request, conf);
 Assert.fail("bad request allowed");
} catch (IOException ioe) {
ugi = JspHelper.getUGI(context, request, conf);
Assert.assertNull(ugi.getRealUser());
Assert.assertEquals(ugi.getShortUserName(), realUser);
ugi = JspHelper.getUGI(context, request, conf);
Assert.assertNull(ugi.getRealUser());
Assert.assertEquals(ugi.getShortUserName(), realUser);
 JspHelper.getUGI(context, request, conf);
 Assert.fail("bad request allowed");
} catch (IOException ioe) {
origin: ch.cern.hadoop/hadoop-hdfs

when(request.getParameter(JspHelper.DELEGATION_PARAMETER_NAME)).thenReturn(
  tokenString);
ugi = JspHelper.getUGI(context, request, conf);
Assert.assertNotNull(ugi.getRealUser());
Assert.assertEquals(ugi.getRealUser().getShortUserName(), realUser);
when(request.getParameter(JspHelper.DELEGATION_PARAMETER_NAME)).thenReturn(
  tokenString);
ugi = JspHelper.getUGI(context, request, conf);
Assert.assertNotNull(ugi.getRealUser());
Assert.assertEquals(ugi.getRealUser().getShortUserName(), realUser);
when(request.getParameter(JspHelper.DELEGATION_PARAMETER_NAME)).thenReturn(
  tokenString);
ugi = JspHelper.getUGI(context, request, conf);
Assert.assertNotNull(ugi.getRealUser());
Assert.assertEquals(ugi.getRealUser().getShortUserName(), realUser);
when(request.getParameter(JspHelper.DELEGATION_PARAMETER_NAME)).thenReturn(
  tokenString);
ugi = JspHelper.getUGI(context, request, conf);
Assert.assertNotNull(ugi.getRealUser());
Assert.assertEquals(ugi.getRealUser().getShortUserName(), realUser);
  tokenString);
try {
 JspHelper.getUGI(context, request, conf);
 Assert.fail("bad request allowed");
} catch (IOException ioe) {
origin: ch.cern.hadoop/hadoop-hdfs

 JspHelper.getUGI(context, request, conf);
 Assert.fail("bad request allowed");
} catch (IOException ioe) {
 JspHelper.getUGI(context, request, conf);
 Assert.fail("bad request allowed");
} catch (IOException ioe) {
ugi = JspHelper.getUGI(context, request, conf);
Assert.assertNotNull(ugi.getRealUser());
Assert.assertEquals(ugi.getRealUser().getShortUserName(), realUser);
ugi = JspHelper.getUGI(context, request, conf);
Assert.assertNotNull(ugi.getRealUser());
Assert.assertEquals(ugi.getRealUser().getShortUserName(), realUser);
 JspHelper.getUGI(context, request, conf);
 Assert.fail("bad request allowed");
} catch (IOException ioe) {
 JspHelper.getUGI(context, request, conf);
 Assert.fail("bad proxy request allowed");
} catch (AuthorizationException ae) {
 JspHelper.getUGI(context, request, conf);
 Assert.fail("bad proxy request allowed");
} catch (AuthorizationException ae) {
org.apache.hadoop.hdfs.server.commonJspHelpergetUGI

Javadoc

Same as getUGI(context, request, conf, KERBEROS_SSL, true).

Popular methods of JspHelper

  • getRemoteAddr
  • checkUsername
    Expected user name should be a short name.
  • getDefaultWebUserName
  • getDelegationTokenUrlParam
    Returns the url parameter for the given token string.
  • getNNServiceAddress
  • getTokenUGI
  • getUrlParam
    Returns the url parameter for the given string, prefixed with '?' if firstParam is true, prefixed wi
  • getUsernameFromQuery
  • bestNode
  • validatePath
    Validate filename.

Popular in Java

  • Running tasks concurrently on multiple threads
  • setContentView (Activity)
  • scheduleAtFixedRate (Timer)
  • addToBackStack (FragmentTransaction)
  • Kernel (java.awt.image)
  • InputStreamReader (java.io)
    A class for turning a byte stream into a character stream. Data read from the source input stream is
  • HttpURLConnection (java.net)
    An URLConnection for HTTP (RFC 2616 [http://tools.ietf.org/html/rfc2616]) used to send and receive d
  • Handler (java.util.logging)
    A Handler object accepts a logging request and exports the desired messages to a target, for example
  • Notification (javax.management)
  • JOptionPane (javax.swing)
  • CodeWhisperer alternatives
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now