HttpServer2 httpServer = webApp.httpServer(); WebAppContext webAppContext = httpServer.getWebAppContext(); WebAppContext appWebAppContext = new WebAppContext(); appWebAppContext.setContextPath("/static/xlWebApp");
webAppBuild.invoke(WebApps.$for("jobhistory", HistoryClientService.class, this, "ws").with(conf).withHttpSpnegoKeytabKey(XLearningConfiguration.XLEARNING_WEBAPP_SPNEGO_KEYTAB_FILE_KEY).withHttpSpnegoPrincipalKey(XLearningConfiguration.XLEARNING_WEBAPP_SPNEGO_USER_NAME_KEY).at(NetUtils.getHostPortString(bindAddress)), webApp); HttpServer2 httpServer = webApp.httpServer(); WebAppContext webAppContext = httpServer.getWebAppContext(); WebAppContext appWebAppContext = new WebAppContext(); appWebAppContext.setContextPath("/static/xlWebApp");
HttpServer2.defineFilter(httpServer2.getWebAppContext(), name, className, params, new String[] { pathSpec }); HttpServer2.LOG.info("Added filter '" + name + "' (class=" + className .getFilterParams(conf, "dfs.webhdfs.rest-csrf."); String restCsrfClassName = RestCsrfPreventionFilter.class.getName(); HttpServer2.defineFilter(httpServer2.getWebAppContext(), restCsrfClassName, restCsrfClassName, restCsrfParams, new String[] {pathSpec});
public void defineConfFilter() { String confFilterName = ConfFilter.class.getName(); String confPath = "/has/v1/conf/*"; HttpServer2.defineFilter(httpServer.getWebAppContext(), confFilterName, confFilterName, getAuthFilterParams(conf), new String[]{confPath}); HttpServer2.LOG.info("Added filter '" + confFilterName + "' (class=" + confFilterName + ")"); }
public void defineConfFilter() { String confFilterName = ConfFilter.class.getName(); String confPath = "/has/v1/conf/*"; HttpServer2.defineFilter(httpServer.getWebAppContext(), confFilterName, confFilterName, getAuthFilterParams(conf), new String[]{confPath}); HttpServer2.LOG.info("Added filter '" + confFilterName + "' (class=" + confFilterName + ")"); }
private void initWebHdfs(Configuration conf) throws IOException { if (WebHdfsFileSystem.isEnabled(conf, HttpServer2.LOG)) { // set user pattern based on configuration file UserParam.setUserPattern(conf.get( DFSConfigKeys.DFS_WEBHDFS_USER_PATTERN_KEY, DFSConfigKeys.DFS_WEBHDFS_USER_PATTERN_DEFAULT)); // add authentication filter for webhdfs final String className = conf.get( DFSConfigKeys.DFS_WEBHDFS_AUTHENTICATION_FILTER_KEY, DFSConfigKeys.DFS_WEBHDFS_AUTHENTICATION_FILTER_DEFAULT); final String name = className; final String pathSpec = WebHdfsFileSystem.PATH_PREFIX + "/*"; Map<String, String> params = getAuthFilterParams(conf); HttpServer2.defineFilter(httpServer.getWebAppContext(), name, className, params, new String[] { pathSpec }); HttpServer2.LOG.info("Added filter '" + name + "' (class=" + className + ")"); // add webhdfs packages httpServer.addJerseyResourcePackage(NamenodeWebHdfsMethods.class .getPackage().getName() + ";" + Param.class.getPackage().getName(), pathSpec); } }
public void defineFilter() { String authType = conf.getString(WebConfigKey.HAS_AUTHENTICATION_FILTER_AUTH_TYPE); if (authType.equals("kerberos")) { // add authentication filter for webhdfs final String className = conf.getString( WebConfigKey.HAS_AUTHENTICATION_FILTER_KEY, WebConfigKey.HAS_AUTHENTICATION_FILTER_DEFAULT); final String name = className; Map<String, String> params = getAuthFilterParams(conf); String kadminPathSpec = "/has/v1/kadmin/*"; String hadminPathSpec = "/has/v1/hadmin/*"; HttpServer2.defineFilter(httpServer.getWebAppContext(), name, className, params, new String[]{kadminPathSpec, hadminPathSpec}); HttpServer2.LOG.info("Added filter '" + name + "' (class=" + className + ")"); } }
public void defineFilter() { String authType = conf.getString(WebConfigKey.HAS_AUTHENTICATION_FILTER_AUTH_TYPE); if (authType.equals("kerberos")) { // add authentication filter for webhdfs final String className = conf.getString( WebConfigKey.HAS_AUTHENTICATION_FILTER_KEY, WebConfigKey.HAS_AUTHENTICATION_FILTER_DEFAULT); final String name = className; Map<String, String> params = getAuthFilterParams(conf); String kadminPathSpec = "/has/v1/kadmin/*"; String hadminPathSpec = "/has/v1/hadmin/*"; HttpServer2.defineFilter(httpServer.getWebAppContext(), name, className, params, new String[]{kadminPathSpec, hadminPathSpec}); HttpServer2.LOG.info("Added filter '" + name + "' (class=" + className + ")"); } }
private void initWebHdfs(Configuration conf) throws IOException { if (WebHdfsFileSystem.isEnabled(conf, HttpServer2.LOG)) { // set user pattern based on configuration file UserParam.setUserPattern(conf.get( DFSConfigKeys.DFS_WEBHDFS_USER_PATTERN_KEY, DFSConfigKeys.DFS_WEBHDFS_USER_PATTERN_DEFAULT)); // add authentication filter for webhdfs final String className = conf.get( DFSConfigKeys.DFS_WEBHDFS_AUTHENTICATION_FILTER_KEY, DFSConfigKeys.DFS_WEBHDFS_AUTHENTICATION_FILTER_DEFAULT); final String name = className; final String pathSpec = WebHdfsFileSystem.PATH_PREFIX + "/*"; Map<String, String> params = getAuthFilterParams(conf); HttpServer2.defineFilter(httpServer.getWebAppContext(), name, className, params, new String[] { pathSpec }); HttpServer2.LOG.info("Added filter '" + name + "' (class=" + className + ")"); // add webhdfs packages httpServer.addJerseyResourcePackage(NamenodeWebHdfsMethods.class .getPackage().getName() + ";" + Param.class.getPackage().getName(), pathSpec); } }
WebAppContext webAppContext = httpServer.getWebAppContext();
WebAppContext webAppContext = httpServer.getWebAppContext();
server.setAttribute(entry.getKey(), entry.getValue()); HttpServer2.defineFilter(server.getWebAppContext(), "guice", GuiceFilter.class.getName(), null, new String[] { "/*" });
name); String restCsrfClassName = RestCsrfPreventionFilter.class.getName(); HttpServer2.defineFilter(server.getWebAppContext(), restCsrfClassName, restCsrfClassName, params, new String[] {"/*"}); HttpServer2.defineFilter(server.getWebAppContext(), xfsClassName, xfsClassName, params, new String[] {"/*"}); HttpServer2.defineFilter(server.getWebAppContext(), "guice", GuiceFilter.class.getName(), null, new String[] { "/*" });
server.setAttribute(entry.getKey(), entry.getValue()); HttpServer2.defineFilter(server.getWebAppContext(), "guice", GuiceFilter.class.getName(), null, new String[] { "/*" });
WebAppContext webAppContext = httpServer.getWebAppContext();