Refine search
/** * Method description * */ @Override protected void configureServlets() { bind(GitRepositoryViewer.class); bind(GitRepositoryResolver.class); bind(GitReceivePackFactory.class); bind(ScmTransportProtocol.class); bind(LfsBlobStoreFactory.class); bind(LfsStoreRemoveListener.class); // serlvelts and filters filter(PATTERN_GIT).through(GitBasicAuthenticationFilter.class); filter(PATTERN_GIT).through(GitPermissionFilter.class); serve(PATTERN_GIT).with(ScmGitServlet.class); } }
/** * Inject module dependencies and bind guice filter delegates. */ @Override protected void configureServlets() { bind(WebFilter.class).in(Singleton.class); bind(GuiceContainer.class); Map<String, String> params = new HashMap<>(); Properties properties = create(WebModule.PROPERTY_NAME, WebServletModule.class); for (Map.Entry<String, KeyValue<String>> entry : keys.entrySet()) { String key = entry.getKey(); String jerseyProperty = trimToNull(getProperty(key, properties, entry.getValue().getValue())); if (isNotBlank(jerseyProperty)) { params.put(entry.getValue().getKey(), jerseyProperty); } } filter("/*").through(WebFilter.class); serve("/*").with(GuiceContainer.class, params); }
@Override protected void configureServlets() { bind(JAXBContextResolver.class); bind(RMWebServices.class); bind(GenericExceptionHandler.class); Configuration conf = new Configuration(); conf.setClass(YarnConfiguration.RM_SCHEDULER, FifoScheduler.class, ResourceScheduler.class); rm = new MockRM(conf); bind(ResourceManager.class).toInstance(rm); serve("/*").with(GuiceContainer.class); RestCsrfPreventionFilter csrfFilter = new RestCsrfPreventionFilter(); Map<String,String> initParams = new HashMap<>(); // adding GET as protected method to make things a little easier... initParams.put(RestCsrfPreventionFilter.CUSTOM_METHODS_TO_IGNORE_PARAM, "OPTIONS,HEAD,TRACE"); filter("/*").through(csrfFilter, initParams); } };
/** * Method description * */ @Override protected void configureServlets() { bind(HgContext.class).toProvider(HgContextProvider.class); bind(HgHookManager.class); bind(HgPackageReader.class); // bind servlets serve(MAPPING_HOOK).with(HgHookCallbackServlet.class); // register hg cgi servlet filter(MAPPING_HG).through(HgBasicAuthenticationFilter.class); filter(MAPPING_HG).through(HgPermissionFilter.class); serve(MAPPING_HG).with(HgCGIServlet.class); } }
@Override protected void configureServlets() { // We add servlets here to override the DefaultServlet automatic registered by WebAppContext // in path "/" with our WaveClientServlet. Any other way to do this? // Related question (unanswered 08-Apr-2011) // http://web.archiveorange.com/archive/v/d0LdlXf1kN0OXyPNyQZp for (Pair<String, ServletHolder> servlet : servletRegistry) { String url = servlet.getFirst(); @SuppressWarnings("unchecked") Class<HttpServlet> clazz = (Class<HttpServlet>) servlet.getSecond().getHeldClass(); Map<String,String> params = servlet.getSecond().getInitParameters(); serve(url).with(clazz,params); bind(clazz).in(Singleton.class); } for (Pair<String, Class<? extends Filter>> filter : filterRegistry) { filter(filter.first).through(filter.second); } } };
/** * Inject module dependencies and bind guice filter delegates. */ @Override protected void configureServlets() { bind(WebFilter.class).in(Singleton.class); bind(GuiceContainer.class); Map<String, String> params = new HashMap<>(); Properties properties = create(PROPERTY_NAME, WebServletModule.class); for (Map.Entry<String, KeyValue<String>> entry : keys.entrySet()) { String key = entry.getKey(); String jerseyProperty = trimToNull(getProperty(key, properties, entry.getValue().getValue())); if (isNotBlank(jerseyProperty)) { params.put(entry.getValue().getKey(), jerseyProperty); } } filter("/*").through(WebFilter.class); serve("/*").with(GuiceContainer.class, params); }
@Override protected void configureServlets() { configureScheduler(); bind(JAXBContextResolver.class); bind(RMWebServices.class); bind(GenericExceptionHandler.class); conf.setInt(YarnConfiguration.RM_AM_MAX_ATTEMPTS, YarnConfiguration.DEFAULT_RM_AM_MAX_ATTEMPTS); conf.setBoolean(YarnConfiguration.RM_RESERVATION_SYSTEM_ENABLE, true); rm = new MockRM(conf); bind(ResourceManager.class).toInstance(rm); if (setAuthFilter) { filter("/*").through(TestRMCustomAuthFilter.class); } serve("/*").with(GuiceContainer.class); } }
/** * Method description * */ @Override protected void configureServlets() { filter(PATTERN_SVN).through(SvnGZipFilter.class); filter(PATTERN_SVN).through(SvnBasicAuthenticationFilter.class); filter(PATTERN_SVN).through(SvnPermissionFilter.class); Map<String, String> parameters = new HashMap<String, String>(); parameters.put(PARAMETER_SVN_PARENTPATH, System.getProperty("java.io.tmpdir")); serve(PATTERN_SVN).with(SvnDAVServlet.class, parameters); } }
@Override protected void configureServlets() { configureScheduler(); bind(JAXBContextResolver.class); bind(RMWebServices.class); bind(GenericExceptionHandler.class); conf.setInt(YarnConfiguration.RM_AM_MAX_ATTEMPTS, YarnConfiguration.DEFAULT_RM_AM_MAX_ATTEMPTS); rm = new MockRM(conf); bind(ResourceManager.class).toInstance(rm); if (setAuthFilter) { filter("/*").through(TestRMCustomAuthFilter.class); } serve("/*").with(GuiceContainer.class); } }
@Override protected void configureServlets() { super.configureServlets(); // JSON mapper, maps JSON to/from POJOs bind(JacksonJsonProvider.class).in(Singleton.class); // Turns exceptions into JSON responses bind(JsonExceptionMapper.class).in(Singleton.class); // Serve all URLs through Guice serve("/*").with(GuiceContainer.class); // The actual REST Endpoints bind(SuggestionResource.class).in(Singleton.class); // Stats filter("/suggest/v1/like").through(new RequestStatsFilter("suggest_v1_like")); filter("/suggest/v1/all_places").through(new RequestStatsFilter("suggest_v1_all_places")); }
@Override protected void configureServlets() { bind(MetricsServlet.class); bind(HealthCheckServlet.class); serve(MOUNT_POINT + "/ping").with(new PingServlet()); serve(MOUNT_POINT + "/threads").with(new ThreadDumpServlet()); serve(MOUNT_POINT + "/data").with(MetricsServlet.class); serve(MOUNT_POINT + "/healthcheck").with(HealthCheckServlet.class); // record metrics for all webapp access filter("/*").through(new InstrumentedFilter()); bind(SecurityFilter.class); // configure security filter(MOUNT_POINT + "/*").through(SecurityFilter.class); } });
@Override protected void setup() { String configFile = getSettings().getString("shiro.configurationFile", "classpath:conf/shiro.ini"); Ini ini = Ini.fromResourcePath(configFile); IniWebEnvironment webEnvironment = new IniWebEnvironment(); webEnvironment.setIni(ini); webEnvironment.setServletContext(getServletContext()); webEnvironment.init(); bind(WebEnvironment.class).toInstance(webEnvironment); bind(SecurityManager.class).toInstance(webEnvironment.getSecurityManager()); bind(WebSecurityManager.class).toInstance(webEnvironment.getWebSecurityManager()); String basePath = Strings.nullToEmpty(getSettings().getString(RestServlet.SETTING_URL, null)).trim(); filter(basePath + "/*").through(ShiroFilter.class); install(new AopModule()); }
@Override protected void configureServlets() { configureScheduler(); bind(JAXBContextResolver.class); bind(RMWebServices.class); bind(GenericExceptionHandler.class); conf.setInt(YarnConfiguration.RM_AM_MAX_ATTEMPTS, YarnConfiguration.DEFAULT_RM_AM_MAX_ATTEMPTS); rm = new MockRM(conf); bind(ResourceManager.class).toInstance(rm); if (setAuthFilter) { filter("/*").through(TestRMCustomAuthFilter.class); } serve("/*").with(GuiceContainer.class); } }
@Override protected void configureServlets() { Map<String, String> config = Maps.newHashMap(); config.put(GlobalParameters.PROVIDERS_URL, MOUNT_POINT.substring(1)); config.put("minify", Boolean.FALSE.toString()); config.put(GlobalParameters.DEBUG, Boolean.toString(log.isDebugEnabled())); config.put(GlobalParameters.JSON_REQUEST_PROCESSOR_THREAD_CLASS, ExtDirectJsonRequestProcessorThread.class.getName()); config.put(GlobalParameters.GSON_BUILDER_CONFIGURATOR_CLASS, ExtDirectGsonBuilderConfigurator.class.getName()); serve(MOUNT_POINT + "*").with(ExtDirectServlet.class, config); filter(MOUNT_POINT + "*").through(SecurityFilter.class); } });
@Override public void configureServlets() { filter("/api/*").through(GuiceRestEasyFilterDispatcher.class); } }
@Override public void configureServlets() { // Tracking token setup bind (TrackingConfig.class).toProvider(ConfigProvider.of(TrackingConfig.class)).in(Scopes.SINGLETON); bind (TrackingUUIDProvider.class).in(Scopes.SINGLETON); // Bind the TrackingToken in the right scope. bind(TrackingToken.class).in(ThreadDelegatedScope.SCOPE); // Hook up tracking token to the HttpClient. HttpClientModule.bindNewObserver(binder(), HttpClientObserverGroup.PLATFORM_INTERNAL).to(HttpClientTrackingObserver.class); bind(TrackingFilter.class).in(Scopes.SINGLETON); filter(pattern).through(TrackingFilter.class); } }
@Override protected void configureServlets() { bind(HeaderPatternFilter.class); bind(EnvironmentFilter.class); bind(ErrorPageFilter.class); filter("/*").through(HeaderPatternFilter.class); filter("/*").through(EnvironmentFilter.class); filter("/*").through(ErrorPageFilter.class); bind(ErrorPageServlet.class); serve("/error.html").with(ErrorPageServlet.class); serve("/throw.html").with(ThrowServlet.class); } });
@Override protected void configureServlets() { install(new JpaPersistModule("jpa-unit")); filter("/*").through(PersistFilter.class); }
@Override protected void configureServlets() { bind(KeycloakAuthenticationFilter.class).in(Singleton.class); filterRegex(KEYCLOAK_FILTER_PATHS).through(KeycloakAuthenticationFilter.class); filterRegex(KEYCLOAK_FILTER_PATHS).through(KeycloakEnvironmentInitalizationFilter.class); filterRegex(KEYCLOAK_FILTER_PATHS).through(IdentityIdLoggerFilter.class); // Ban change password (POST /user/password) and create a user (POST /user/) methods // but not remove user (DELETE /user/{USER_ID} filterRegex("^/user(/password/?|/)?$").through(UnavailableResourceInMultiUserFilter.class); filterRegex("^/profile/(.*/)?attributes$").through(UnavailableResourceInMultiUserFilter.class); } }