Source:
@Override public void run(KeywhizConfig config, Environment environment) throws Exception { if (injector == null) { logger.debug("No existing guice injector; creating new one"); injector = Guice.createInjector( new ServiceModule(config, environment), new SecretGeneratorModule(secretGeneratorFactories, secretGenerators)); } JerseyEnvironment jersey = environment.jersey(); logger.debug("Registering resource filters"); jersey.register(injector.getInstance(ClientCertificateFilter.class)); logger.debug("Registering response filters"); environment.servlets().addFilter("meh", injector.getInstance(SecurityHeadersFilter.class)) .addMappingForUrlPatterns(EnumSet.of(DispatcherType.REQUEST), true, " , false , "/admin ); logger.debug("Registering providers"); jersey.register(new AuthResolver.Binder(injector.getInstance(ClientAuthFactory.class), injector.getInstance(AutomationClientAuthFactory.class), injector.getInstance(UserAuthFactory.class))); logger.debug("Registering resources"); jersey.register(injector.getInstance(ClientsResource.class)); jersey.register(injector.getInstance(GroupsResource.class)); jersey.register(injector.getInstance(MembershipResource.class)); jersey.register(injector.getInstance(SecretsDeliveryResource.class)); jersey.register(injector.getInstance(SecretsResource.class)); jersey.register(injector.getInstance(SecretGeneratorsResource.class)); jersey.register(injector.getInstance(SecretDeliveryResource.class)); jersey.register(injector.getInstance(SessionLoginResource.class)); jersey.register(injector.getInstance(SessionLogoutResource.class)); jersey.register(injector.getInstance(SessionMeResource.class)); jersey.register(injector.getInstance(AutomationClientResource.class)); jersey.register(injector.getInstance(AutomationGroupResource.class)); jersey.register(injector.getInstance(AutomationSecretResource.class)); jersey.register(injector.getInstance(AutomationEnrollClientGroupResource.class)); jersey.register(injector.getInstance(AutomationSecretAccessResource.class)); jersey.register(injector.getInstance(AutomationSecretGeneratorsResource.class)); logger.debug("Keywhiz configuration complete"); }

Target:
@Override public void run(KeywhizConfig config, Environment environment) throws Exception { if (injector == null) { logger.debug("No existing guice injector; creating new one"); injector = Guice.createInjector( new ServiceModule(config, environment), new SecretGeneratorModule(secretGeneratorFactories, secretGenerators)); } JerseyEnvironment jersey = environment.jersey(); logger.debug("Registering resource filters"); jersey.register(injector.getInstance(ClientCertificateFilter.class)); logger.debug("Registering servlet filters"); environment.servlets().addFilter("security-headers-filter", injector.getInstance(SecurityHeadersFilter.class)) .addMappingForUrlPatterns( null, false , " ); jersey.register(injector.getInstance(CookieRenewingFilter.class)); environment.servlets().addFilter("xsrf-filter", injector.getInstance(XsrfServletFilter.class)) .addMappingForUrlPatterns( null , false , "/admin ); logger.debug("Registering providers"); jersey.register(new AuthResolver.Binder(injector.getInstance(ClientAuthFactory.class), injector.getInstance(AutomationClientAuthFactory.class), injector.getInstance(UserAuthFactory.class))); logger.debug("Registering resources"); jersey.register(injector.getInstance(ClientsResource.class)); jersey.register(injector.getInstance(GroupsResource.class)); jersey.register(injector.getInstance(MembershipResource.class)); jersey.register(injector.getInstance(SecretsDeliveryResource.class)); jersey.register(injector.getInstance(SecretsResource.class)); jersey.register(injector.getInstance(SecretGeneratorsResource.class)); jersey.register(injector.getInstance(SecretDeliveryResource.class)); jersey.register(injector.getInstance(SessionLoginResource.class)); jersey.register(injector.getInstance(SessionLogoutResource.class)); jersey.register(injector.getInstance(SessionMeResource.class)); jersey.register(injector.getInstance(AutomationClientResource.class)); jersey.register(injector.getInstance(AutomationGroupResource.class)); jersey.register(injector.getInstance(AutomationSecretResource.class)); jersey.register(injector.getInstance(AutomationEnrollClientGroupResource.class)); jersey.register(injector.getInstance(AutomationSecretAccessResource.class)); jersey.register(injector.getInstance(AutomationSecretGeneratorsResource.class)); logger.debug("Keywhiz configuration complete"); }