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

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

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

origin: org.apache.hadoop/hadoop-hdfs

public NamenodeWebHdfsMethods(@Context HttpServletRequest request) {
 // the request object is a proxy to thread-locals so we have to extract
 // what we want from it since the external call will be processed in a
 // different thread.
 scheme = request.getScheme();
 userPrincipal = request.getUserPrincipal();
 // get the remote address, if coming in via a trusted proxy server then
 // the address with be that of the proxied client
 remoteAddr = JspHelper.getRemoteAddr(request);
 supportEZ =
   Boolean.valueOf(request.getHeader(WebHdfsFileSystem.EZ_HEADER));
}
origin: org.apache.hadoop/hadoop-hdfs

ProxyUsers.authorize(ugi, getRemoteAddr(request));
origin: ch.cern.hadoop/hadoop-hdfs

private void init(final UserGroupInformation ugi,
  final DelegationParam delegation,
  final UserParam username, final DoAsParam doAsUser,
  final UriFsPathParam path, final HttpOpParam<?> op,
  final Param<?, ?>... parameters) {
 if (LOG.isTraceEnabled()) {
  LOG.trace("HTTP " + op.getValue().getType() + ": " + op + ", " + path
    + ", ugi=" + ugi + ", " + username + ", " + doAsUser
    + Param.toSortedString(", ", parameters));
 }
 //clear content type
 response.setContentType(null);
 
 // set the remote address, if coming in via a trust proxy server then
 // the address with be that of the proxied client
 REMOTE_ADDRESS.set(JspHelper.getRemoteAddr(request));
}
origin: ch.cern.hadoop/hadoop-hdfs

 private String getRemoteAddr(String clientAddr, String proxyAddr, boolean trusted) {
  HttpServletRequest req = mock(HttpServletRequest.class);
  when(req.getRemoteAddr()).thenReturn("1.2.3.4");

  Configuration conf = new Configuration();
  if (proxyAddr == null) {
   when(req.getRemoteAddr()).thenReturn(clientAddr);
  } else {
   when(req.getRemoteAddr()).thenReturn(proxyAddr);
   when(req.getHeader("X-Forwarded-For")).thenReturn(clientAddr);
   if (trusted) {
    conf.set(ProxyServers.CONF_HADOOP_PROXYSERVERS, proxyAddr);
   }
  }
  ProxyUsers.refreshSuperUserGroupsConfiguration(conf);
  return JspHelper.getRemoteAddr(req);
 }
}
origin: io.prestosql.hadoop/hadoop-apache

private void init(final UserGroupInformation ugi,
  final DelegationParam delegation,
  final UserParam username, final DoAsParam doAsUser,
  final UriFsPathParam path, final HttpOpParam<?> op,
  final Param<?, ?>... parameters) {
 if (LOG.isTraceEnabled()) {
  LOG.trace("HTTP " + op.getValue().getType() + ": " + op + ", " + path
    + ", ugi=" + ugi + ", " + username + ", " + doAsUser
    + Param.toSortedString(", ", parameters));
 }
 //clear content type
 response.setContentType(null);
 
 // set the remote address, if coming in via a trust proxy server then
 // the address with be that of the proxied client
 REMOTE_ADDRESS.set(JspHelper.getRemoteAddr(request));
}
origin: ch.cern.hadoop/hadoop-hdfs

ProxyUsers.authorize(ugi, getRemoteAddr(request));
origin: io.prestosql.hadoop/hadoop-apache

ProxyUsers.authorize(ugi, getRemoteAddr(request));
org.apache.hadoop.hdfs.server.commonJspHelpergetRemoteAddr

Popular methods of JspHelper

  • getUGI
    Same as getUGI(null, request, conf).
  • 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

  • Updating database using SQL prepared statement
  • getResourceAsStream (ClassLoader)
  • orElseThrow (Optional)
    Return the contained value, if present, otherwise throw an exception to be created by the provided s
  • getSystemService (Context)
  • Graphics2D (java.awt)
    This Graphics2D class extends the Graphics class to provide more sophisticated control overgraphics
  • InputStream (java.io)
    A readable source of bytes.Most clients will use input streams that read data from the file system (
  • KeyStore (java.security)
    KeyStore is responsible for maintaining cryptographic keys and their owners. The type of the syste
  • ZipFile (java.util.zip)
    This class provides random read access to a zip file. You pay more to read the zip file's central di
  • IsNull (org.hamcrest.core)
    Is the value null?
  • Loader (org.hibernate.loader)
    Abstract superclass of object loading (and querying) strategies. This class implements useful common
  • From CI to AI: The AI layer in your organization
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