Search in sources :

Example 1 with StaticModule

use of com.google.gerrit.httpd.raw.StaticModule in project gerrit by GerritCodeReview.

the class WebAppInitializer method createWebInjector.

private Injector createWebInjector() {
    final List<Module> modules = new ArrayList<>();
    modules.add(RequestContextFilter.module());
    modules.add(AllRequestFilter.module());
    modules.add(RequestMetricsFilter.module());
    modules.add(sysInjector.getInstance(GitOverHttpModule.class));
    modules.add(sysInjector.getInstance(WebModule.class));
    modules.add(sysInjector.getInstance(RequireSslFilter.Module.class));
    if (sshInjector != null) {
        modules.add(sshInjector.getInstance(WebSshGlueModule.class));
    } else {
        modules.add(new NoSshModule());
    }
    modules.add(H2CacheBasedWebSession.module());
    modules.add(new HttpPluginModule());
    AuthConfig authConfig = cfgInjector.getInstance(AuthConfig.class);
    if (authConfig.getAuthType() == AuthType.OPENID) {
        modules.add(new OpenIdModule());
    } else if (authConfig.getAuthType() == AuthType.OAUTH) {
        modules.add(new OAuthModule());
    }
    modules.add(sysInjector.getInstance(GetUserFilter.Module.class));
    // StaticModule contains a "/*" wildcard, place it last.
    modules.add(sysInjector.getInstance(StaticModule.class));
    return sysInjector.createChildInjector(modules);
}
Also used : HttpPluginModule(com.google.gerrit.httpd.plugins.HttpPluginModule) OAuthModule(com.google.gerrit.httpd.auth.oauth.OAuthModule) NoSshModule(com.google.gerrit.server.ssh.NoSshModule) OpenIdModule(com.google.gerrit.httpd.auth.openid.OpenIdModule) ArrayList(java.util.ArrayList) AuthConfig(com.google.gerrit.server.config.AuthConfig) GitRepositoryManagerModule(com.google.gerrit.server.git.GitRepositoryManagerModule) AuthConfigModule(com.google.gerrit.server.config.AuthConfigModule) Module(com.google.inject.Module) CanonicalWebUrlModule(com.google.gerrit.server.config.CanonicalWebUrlModule) GerritGlobalModule(com.google.gerrit.server.config.GerritGlobalModule) DataSourceModule(com.google.gerrit.server.schema.DataSourceModule) DatabaseModule(com.google.gerrit.server.schema.DatabaseModule) LifecycleModule(com.google.gerrit.lifecycle.LifecycleModule) LuceneIndexModule(com.google.gerrit.lucene.LuceneIndexModule) DefaultPermissionBackendModule(com.google.gerrit.server.project.DefaultPermissionBackendModule) OAuthModule(com.google.gerrit.httpd.auth.oauth.OAuthModule) SchemaModule(com.google.gerrit.server.schema.SchemaModule) MimeUtil2Module(com.google.gerrit.server.mime.MimeUtil2Module) GarbageCollectionModule(com.google.gerrit.server.git.GarbageCollectionModule) SshModule(com.google.gerrit.sshd.SshModule) GerritServerConfigModule(com.google.gerrit.server.config.GerritServerConfigModule) SshAddressesModule(com.google.gerrit.server.ssh.SshAddressesModule) HttpPluginModule(com.google.gerrit.httpd.plugins.HttpPluginModule) DefaultCommandModule(com.google.gerrit.sshd.commands.DefaultCommandModule) PluginRestApiModule(com.google.gerrit.server.plugins.PluginRestApiModule) ReceiveCommitsExecutorModule(com.google.gerrit.server.git.ReceiveCommitsExecutorModule) ElasticIndexModule(com.google.gerrit.elasticsearch.ElasticIndexModule) IndexModule(com.google.gerrit.server.index.IndexModule) StaticModule(com.google.gerrit.httpd.raw.StaticModule) RestCacheAdminModule(com.google.gerrit.server.config.RestCacheAdminModule) IndexCommandsModule(com.google.gerrit.sshd.commands.IndexCommandsModule) DiffExecutorModule(com.google.gerrit.server.patch.DiffExecutorModule) NoSshModule(com.google.gerrit.server.ssh.NoSshModule) GpgModule(com.google.gerrit.gpg.GpgModule) OpenIdModule(com.google.gerrit.httpd.auth.openid.OpenIdModule) SshHostKeyModule(com.google.gerrit.sshd.SshHostKeyModule) AbstractModule(com.google.inject.AbstractModule) StaticModule(com.google.gerrit.httpd.raw.StaticModule)

Example 2 with StaticModule

use of com.google.gerrit.httpd.raw.StaticModule in project gerrit by GerritCodeReview.

the class Daemon method createWebInjector.

private Injector createWebInjector() {
    final List<Module> modules = new ArrayList<>();
    modules.add(RequestContextFilter.module());
    modules.add(RequestMetricsFilter.module());
    modules.add(H2CacheBasedWebSession.module());
    modules.add(sysInjector.getInstance(GerritAuthModule.class));
    modules.add(sysInjector.getInstance(GitOverHttpModule.class));
    modules.add(sysInjector.getInstance(HttpdModule.class));
    if (sshd) {
        modules.add(new ProjectQoSFilterModule());
    }
    modules.add(RequestCleanupFilter.module());
    modules.add(AllRequestFilter.module());
    modules.add(SetThreadNameFilter.module());
    modules.add(sysInjector.getInstance(WebModule.class));
    modules.add(sysInjector.getInstance(RequireSslFilterModule.class));
    modules.add(new HttpPluginModule());
    if (sshd) {
        modules.add(sshInjector.getInstance(WebSshGlueModule.class));
    } else {
        modules.add(new NoSshModule());
    }
    AuthConfig authConfig = cfgInjector.getInstance(AuthConfig.class);
    if (authConfig.getAuthType() == AuthType.OPENID || authConfig.getAuthType() == AuthType.OPENID_SSO) {
        modules.add(new OpenIdModule());
    } else if (authConfig.getAuthType() == AuthType.OAUTH) {
        modules.add(new OAuthModule());
    }
    modules.add(sysInjector.getInstance(GetUserFilterModule.class));
    // StaticModule contains a "/*" wildcard, place it last.
    GerritOptions opts = sysInjector.getInstance(GerritOptions.class);
    if (opts.enableMasterFeatures()) {
        modules.add(sysInjector.getInstance(StaticModule.class));
    }
    return sysInjector.createChildInjector(modules);
}
Also used : OAuthModule(com.google.gerrit.httpd.auth.oauth.OAuthModule) NoSshModule(com.google.gerrit.server.ssh.NoSshModule) OpenIdModule(com.google.gerrit.httpd.auth.openid.OpenIdModule) GitOverHttpModule(com.google.gerrit.httpd.GitOverHttpModule) GerritOptions(com.google.gerrit.server.config.GerritOptions) ArrayList(java.util.ArrayList) GetUserFilterModule(com.google.gerrit.httpd.GetUserFilter.GetUserFilterModule) WebModule(com.google.gerrit.httpd.WebModule) AuthConfig(com.google.gerrit.server.config.AuthConfig) GerritAuthModule(com.google.gerrit.httpd.GerritAuthModule) HttpPluginModule(com.google.gerrit.httpd.plugins.HttpPluginModule) ProjectQoSFilterModule(com.google.gerrit.pgm.http.jetty.ProjectQoSFilter.ProjectQoSFilterModule) HttpdModule(com.google.gerrit.httpd.HttpdModule) RequireSslFilterModule(com.google.gerrit.httpd.RequireSslFilter.RequireSslFilterModule) SubscriptionGraphModule(com.google.gerrit.server.submit.SubscriptionGraph.SubscriptionGraphModule) H2CacheModule(com.google.gerrit.server.cache.h2.H2CacheModule) PluginApiModule(com.google.gerrit.server.api.PluginApiModule) CanonicalWebUrlModule(com.google.gerrit.server.config.CanonicalWebUrlModule) OAuthModule(com.google.gerrit.httpd.auth.oauth.OAuthModule) ProjectQoSFilterModule(com.google.gerrit.pgm.http.jetty.ProjectQoSFilter.ProjectQoSFilterModule) InternalAccountDirectoryModule(com.google.gerrit.server.account.InternalAccountDirectory.InternalAccountDirectoryModule) WorkQueueModule(com.google.gerrit.server.git.WorkQueue.WorkQueueModule) SshModule(com.google.gerrit.sshd.SshModule) DefaultPermissionBackendModule(com.google.gerrit.server.permissions.DefaultPermissionBackendModule) ChangeCleanupRunnerModule(com.google.gerrit.server.change.ChangeCleanupRunner.ChangeCleanupRunnerModule) SshAddressesModule(com.google.gerrit.server.ssh.SshAddressesModule) DefaultMemoryCacheModule(com.google.gerrit.server.cache.mem.DefaultMemoryCacheModule) HttpPluginModule(com.google.gerrit.httpd.plugins.HttpPluginModule) DefaultCommandModule(com.google.gerrit.sshd.commands.DefaultCommandModule) WebModule(com.google.gerrit.httpd.WebModule) GetUserFilterModule(com.google.gerrit.httpd.GetUserFilter.GetUserFilterModule) SmtpEmailSenderModule(com.google.gerrit.server.mail.send.SmtpEmailSender.SmtpEmailSenderModule) StreamEventsApiListenerModule(com.google.gerrit.server.events.StreamEventsApiListener.StreamEventsApiListenerModule) PluginModule(com.google.gerrit.server.plugins.PluginModule) IndexModule(com.google.gerrit.server.index.IndexModule) StaticModule(com.google.gerrit.httpd.raw.StaticModule) AccountDeactivatorModule(com.google.gerrit.server.account.AccountDeactivator.AccountDeactivatorModule) AbstractIndexModule(com.google.gerrit.server.index.AbstractIndexModule) JettyModule(com.google.gerrit.pgm.http.jetty.JettyModule) HttpdModule(com.google.gerrit.httpd.HttpdModule) LocalMergeSuperSetComputationModule(com.google.gerrit.server.submit.LocalMergeSuperSetComputation.LocalMergeSuperSetComputationModule) JdbcAccountPatchReviewStoreModule(com.google.gerrit.server.schema.JdbcAccountPatchReviewStore.JdbcAccountPatchReviewStoreModule) SearchingChangeCacheImplModule(com.google.gerrit.server.git.SearchingChangeCacheImpl.SearchingChangeCacheImplModule) PeriodicGroupIndexerModule(com.google.gerrit.server.group.PeriodicGroupIndexer.PeriodicGroupIndexerModule) GpgModule(com.google.gerrit.gpg.GpgModule) OpenIdModule(com.google.gerrit.httpd.auth.openid.OpenIdModule) AuthModule(com.google.gerrit.auth.AuthModule) SshHostKeyModule(com.google.gerrit.sshd.SshHostKeyModule) DefaultProjectNameLockManagerModule(com.google.gerrit.server.project.DefaultProjectNameLockManager.DefaultProjectNameLockManagerModule) OAuthRestModule(com.google.gerrit.httpd.auth.restapi.OAuthRestModule) SignedTokenEmailTokenVerifierModule(com.google.gerrit.server.mail.SignedTokenEmailTokenVerifier.SignedTokenEmailTokenVerifierModule) AbstractModule(com.google.inject.AbstractModule) AuthConfigModule(com.google.gerrit.server.config.AuthConfigModule) SequenceCommandsModule(com.google.gerrit.sshd.commands.SequenceCommandsModule) Module(com.google.inject.Module) DefaultUrlFormatterModule(com.google.gerrit.server.config.DefaultUrlFormatter.DefaultUrlFormatterModule) GerritGlobalModule(com.google.gerrit.server.config.GerritGlobalModule) LfsPluginAuthCommandModule(com.google.gerrit.sshd.plugin.LfsPluginAuthCommand.LfsPluginAuthCommandModule) LuceneIndexModule(com.google.gerrit.lucene.LuceneIndexModule) GerritInstanceIdModule(com.google.gerrit.server.config.GerritInstanceIdModule) MimeUtil2Module(com.google.gerrit.server.mime.MimeUtil2Module) SysExecutorModule(com.google.gerrit.server.config.SysExecutorModule) GarbageCollectionModule(com.google.gerrit.server.git.GarbageCollectionModule) GerritAuthModule(com.google.gerrit.httpd.GerritAuthModule) WebSshGlueModule(com.google.gerrit.httpd.WebSshGlueModule) MailReceiverModule(com.google.gerrit.server.mail.receive.MailReceiver.MailReceiverModule) ExternalIdCommandsModule(com.google.gerrit.sshd.commands.ExternalIdCommandsModule) RequireSslFilterModule(com.google.gerrit.httpd.RequireSslFilter.RequireSslFilterModule) OnlineUpgraderModule(com.google.gerrit.server.index.OnlineUpgrader.OnlineUpgraderModule) AuditModule(com.google.gerrit.server.audit.AuditModule) GitOverHttpModule(com.google.gerrit.httpd.GitOverHttpModule) RestApiModule(com.google.gerrit.server.restapi.RestApiModule) LogFileCompressorModule(com.google.gerrit.pgm.util.LogFileCompressor.LogFileCompressorModule) SuperprojectUpdateSubmissionListenerModule(com.google.gerrit.server.update.SuperprojectUpdateSubmissionListener.SuperprojectUpdateSubmissionListenerModule) IndexCommandsModule(com.google.gerrit.sshd.commands.IndexCommandsModule) DiffExecutorModule(com.google.gerrit.server.patch.DiffExecutorModule) NoSshModule(com.google.gerrit.server.ssh.NoSshModule) EventBrokerModule(com.google.gerrit.server.events.EventBroker.EventBrokerModule) StartupChecksModule(com.google.gerrit.server.StartupChecks.StartupChecksModule) GerritApiModule(com.google.gerrit.server.api.GerritApiModule) GerritInstanceNameModule(com.google.gerrit.server.config.GerritInstanceNameModule) WebSshGlueModule(com.google.gerrit.httpd.WebSshGlueModule) StaticModule(com.google.gerrit.httpd.raw.StaticModule)

Example 3 with StaticModule

use of com.google.gerrit.httpd.raw.StaticModule in project gerrit by GerritCodeReview.

the class WebAppInitializer method createWebInjector.

private Injector createWebInjector() {
    final List<Module> modules = new ArrayList<>();
    modules.add(RequestContextFilter.module());
    modules.add(RequestMetricsFilter.module());
    modules.add(sysInjector.getInstance(GerritAuthModule.class));
    modules.add(sysInjector.getInstance(GitOverHttpModule.class));
    modules.add(sysInjector.getInstance(HttpdModule.class));
    modules.add(RequestCleanupFilter.module());
    modules.add(SetThreadNameFilter.module());
    modules.add(AllRequestFilter.module());
    modules.add(sysInjector.getInstance(WebModule.class));
    modules.add(sysInjector.getInstance(RequireSslFilterModule.class));
    if (sshInjector != null) {
        modules.add(sshInjector.getInstance(WebSshGlueModule.class));
    } else {
        modules.add(new NoSshModule());
    }
    modules.add(H2CacheBasedWebSession.module());
    modules.add(new HttpPluginModule());
    AuthConfig authConfig = cfgInjector.getInstance(AuthConfig.class);
    if (authConfig.getAuthType() == AuthType.OPENID) {
        modules.add(new OpenIdModule());
    } else if (authConfig.getAuthType() == AuthType.OAUTH) {
        modules.add(new OAuthModule());
    }
    modules.add(new AuthModule(authConfig));
    modules.add(sysInjector.getInstance(GetUserFilter.GetUserFilterModule.class));
    // StaticModule contains a "/*" wildcard, place it last.
    GerritOptions opts = sysInjector.getInstance(GerritOptions.class);
    if (opts.enableMasterFeatures()) {
        modules.add(sysInjector.getInstance(StaticModule.class));
    }
    return sysInjector.createChildInjector(modules);
}
Also used : OAuthModule(com.google.gerrit.httpd.auth.oauth.OAuthModule) NoSshModule(com.google.gerrit.server.ssh.NoSshModule) OpenIdModule(com.google.gerrit.httpd.auth.openid.OpenIdModule) GitOverHttpModule(com.google.gerrit.httpd.GitOverHttpModule) GerritOptions(com.google.gerrit.server.config.GerritOptions) ArrayList(java.util.ArrayList) WebModule(com.google.gerrit.httpd.WebModule) AuthConfig(com.google.gerrit.server.config.AuthConfig) GerritAuthModule(com.google.gerrit.httpd.GerritAuthModule) HttpPluginModule(com.google.gerrit.httpd.plugins.HttpPluginModule) HttpdModule(com.google.gerrit.httpd.HttpdModule) RequireSslFilterModule(com.google.gerrit.httpd.RequireSslFilter.RequireSslFilterModule) OAuthModule(com.google.gerrit.httpd.auth.oauth.OAuthModule) AuthModule(com.google.gerrit.auth.AuthModule) GerritAuthModule(com.google.gerrit.httpd.GerritAuthModule) SubscriptionGraphModule(com.google.gerrit.server.submit.SubscriptionGraph.SubscriptionGraphModule) H2CacheModule(com.google.gerrit.server.cache.h2.H2CacheModule) PluginApiModule(com.google.gerrit.server.api.PluginApiModule) CanonicalWebUrlModule(com.google.gerrit.server.config.CanonicalWebUrlModule) OAuthModule(com.google.gerrit.httpd.auth.oauth.OAuthModule) InternalAccountDirectoryModule(com.google.gerrit.server.account.InternalAccountDirectory.InternalAccountDirectoryModule) WorkQueueModule(com.google.gerrit.server.git.WorkQueue.WorkQueueModule) SshModule(com.google.gerrit.sshd.SshModule) DefaultPermissionBackendModule(com.google.gerrit.server.permissions.DefaultPermissionBackendModule) ChangeCleanupRunnerModule(com.google.gerrit.server.change.ChangeCleanupRunner.ChangeCleanupRunnerModule) SshAddressesModule(com.google.gerrit.server.ssh.SshAddressesModule) DefaultMemoryCacheModule(com.google.gerrit.server.cache.mem.DefaultMemoryCacheModule) HttpPluginModule(com.google.gerrit.httpd.plugins.HttpPluginModule) DefaultCommandModule(com.google.gerrit.sshd.commands.DefaultCommandModule) WebModule(com.google.gerrit.httpd.WebModule) SmtpEmailSenderModule(com.google.gerrit.server.mail.send.SmtpEmailSender.SmtpEmailSenderModule) StreamEventsApiListenerModule(com.google.gerrit.server.events.StreamEventsApiListener.StreamEventsApiListenerModule) PluginModule(com.google.gerrit.server.plugins.PluginModule) IndexModule(com.google.gerrit.server.index.IndexModule) StaticModule(com.google.gerrit.httpd.raw.StaticModule) AccountDeactivatorModule(com.google.gerrit.server.account.AccountDeactivator.AccountDeactivatorModule) HttpdModule(com.google.gerrit.httpd.HttpdModule) LocalMergeSuperSetComputationModule(com.google.gerrit.server.submit.LocalMergeSuperSetComputation.LocalMergeSuperSetComputationModule) JdbcAccountPatchReviewStoreModule(com.google.gerrit.server.schema.JdbcAccountPatchReviewStore.JdbcAccountPatchReviewStoreModule) SearchingChangeCacheImplModule(com.google.gerrit.server.git.SearchingChangeCacheImpl.SearchingChangeCacheImplModule) GpgModule(com.google.gerrit.gpg.GpgModule) OpenIdModule(com.google.gerrit.httpd.auth.openid.OpenIdModule) AuthModule(com.google.gerrit.auth.AuthModule) SshHostKeyModule(com.google.gerrit.sshd.SshHostKeyModule) DefaultProjectNameLockManagerModule(com.google.gerrit.server.project.DefaultProjectNameLockManager.DefaultProjectNameLockManagerModule) OAuthRestModule(com.google.gerrit.httpd.auth.restapi.OAuthRestModule) SignedTokenEmailTokenVerifierModule(com.google.gerrit.server.mail.SignedTokenEmailTokenVerifier.SignedTokenEmailTokenVerifierModule) AbstractModule(com.google.inject.AbstractModule) GitRepositoryManagerModule(com.google.gerrit.server.git.GitRepositoryManagerModule) AuthConfigModule(com.google.gerrit.server.config.AuthConfigModule) SequenceCommandsModule(com.google.gerrit.sshd.commands.SequenceCommandsModule) Module(com.google.inject.Module) DefaultUrlFormatterModule(com.google.gerrit.server.config.DefaultUrlFormatter.DefaultUrlFormatterModule) GerritGlobalModule(com.google.gerrit.server.config.GerritGlobalModule) LfsPluginAuthCommandModule(com.google.gerrit.sshd.plugin.LfsPluginAuthCommand.LfsPluginAuthCommandModule) LifecycleModule(com.google.gerrit.lifecycle.LifecycleModule) LuceneIndexModule(com.google.gerrit.lucene.LuceneIndexModule) SchemaModule(com.google.gerrit.server.schema.SchemaModule) MimeUtil2Module(com.google.gerrit.server.mime.MimeUtil2Module) SysExecutorModule(com.google.gerrit.server.config.SysExecutorModule) GarbageCollectionModule(com.google.gerrit.server.git.GarbageCollectionModule) GerritAuthModule(com.google.gerrit.httpd.GerritAuthModule) WebSshGlueModule(com.google.gerrit.httpd.WebSshGlueModule) MailReceiverModule(com.google.gerrit.server.mail.receive.MailReceiver.MailReceiverModule) ExternalIdCommandsModule(com.google.gerrit.sshd.commands.ExternalIdCommandsModule) RequireSslFilterModule(com.google.gerrit.httpd.RequireSslFilter.RequireSslFilterModule) GerritServerConfigModule(com.google.gerrit.server.config.GerritServerConfigModule) OnlineUpgraderModule(com.google.gerrit.server.index.OnlineUpgrader.OnlineUpgraderModule) AuditModule(com.google.gerrit.server.audit.AuditModule) GitOverHttpModule(com.google.gerrit.httpd.GitOverHttpModule) RestApiModule(com.google.gerrit.server.restapi.RestApiModule) LogFileCompressorModule(com.google.gerrit.pgm.util.LogFileCompressor.LogFileCompressorModule) SuperprojectUpdateSubmissionListenerModule(com.google.gerrit.server.update.SuperprojectUpdateSubmissionListener.SuperprojectUpdateSubmissionListenerModule) IndexCommandsModule(com.google.gerrit.sshd.commands.IndexCommandsModule) DiffExecutorModule(com.google.gerrit.server.patch.DiffExecutorModule) NoSshModule(com.google.gerrit.server.ssh.NoSshModule) EventBrokerModule(com.google.gerrit.server.events.EventBroker.EventBrokerModule) StartupChecksModule(com.google.gerrit.server.StartupChecks.StartupChecksModule) GerritApiModule(com.google.gerrit.server.api.GerritApiModule) GerritInstanceNameModule(com.google.gerrit.server.config.GerritInstanceNameModule) WebSshGlueModule(com.google.gerrit.httpd.WebSshGlueModule) StaticModule(com.google.gerrit.httpd.raw.StaticModule)

Aggregations

GpgModule (com.google.gerrit.gpg.GpgModule)3 OAuthModule (com.google.gerrit.httpd.auth.oauth.OAuthModule)3 OpenIdModule (com.google.gerrit.httpd.auth.openid.OpenIdModule)3 HttpPluginModule (com.google.gerrit.httpd.plugins.HttpPluginModule)3 StaticModule (com.google.gerrit.httpd.raw.StaticModule)3 LuceneIndexModule (com.google.gerrit.lucene.LuceneIndexModule)3 AuthConfig (com.google.gerrit.server.config.AuthConfig)3 AuthConfigModule (com.google.gerrit.server.config.AuthConfigModule)3 CanonicalWebUrlModule (com.google.gerrit.server.config.CanonicalWebUrlModule)3 GerritGlobalModule (com.google.gerrit.server.config.GerritGlobalModule)3 GarbageCollectionModule (com.google.gerrit.server.git.GarbageCollectionModule)3 AuthModule (com.google.gerrit.auth.AuthModule)2 GerritAuthModule (com.google.gerrit.httpd.GerritAuthModule)2 GitOverHttpModule (com.google.gerrit.httpd.GitOverHttpModule)2 HttpdModule (com.google.gerrit.httpd.HttpdModule)2 RequireSslFilterModule (com.google.gerrit.httpd.RequireSslFilter.RequireSslFilterModule)2 WebModule (com.google.gerrit.httpd.WebModule)2 WebSshGlueModule (com.google.gerrit.httpd.WebSshGlueModule)2 OAuthRestModule (com.google.gerrit.httpd.auth.restapi.OAuthRestModule)2 LifecycleModule (com.google.gerrit.lifecycle.LifecycleModule)2