Search in sources :

Example 1 with GuiceBundle

use of uk.gov.ida.hub.shared.guice.GuiceBundle in project verify-hub by alphagov.

the class StubEventSinkApplication method initialize.

@Override
public final void initialize(Bootstrap<StubEventSinkConfiguration> bootstrap) {
    // Enable variable substitution with environment variables
    bootstrap.setConfigurationSourceProvider(new SubstitutingSourceProvider(bootstrap.getConfigurationSourceProvider(), new EnvironmentVariableSubstitutor(false)));
    GuiceBundle<StubEventSinkConfiguration> guiceBundle = new GuiceBundle<>(() -> asList(), StubEventSinkConfiguration.class);
    bootstrap.addBundle(guiceBundle);
    bootstrap.addBundle(new ServiceStatusBundle());
    bootstrap.addBundle(new MonitoringBundle());
    bootstrap.addBundle(new LoggingBundle());
}
Also used : SubstitutingSourceProvider(io.dropwizard.configuration.SubstitutingSourceProvider) GuiceBundle(uk.gov.ida.hub.shared.guice.GuiceBundle) LoggingBundle(uk.gov.ida.bundles.LoggingBundle) ServiceStatusBundle(uk.gov.ida.bundles.ServiceStatusBundle) EnvironmentVariableSubstitutor(io.dropwizard.configuration.EnvironmentVariableSubstitutor) MonitoringBundle(uk.gov.ida.bundles.MonitoringBundle)

Example 2 with GuiceBundle

use of uk.gov.ida.hub.shared.guice.GuiceBundle in project verify-hub by alphagov.

the class PolicyApplication method initialize.

@Override
public final void initialize(Bootstrap<PolicyConfiguration> bootstrap) {
    // Enable variable substitution with environment variables
    bootstrap.setConfigurationSourceProvider(new SubstitutingSourceProvider(bootstrap.getConfigurationSourceProvider(), new EnvironmentVariableSubstitutor(false)));
    GuiceBundle<PolicyConfiguration> guiceBundle = new GuiceBundle<>(() -> asList(getPolicyModule(), new EventEmitterModule()), PolicyConfiguration.class);
    bootstrap.addBundle(guiceBundle);
    bootstrap.addBundle(new ServiceStatusBundle());
    bootstrap.addBundle(new MonitoringBundle());
    bootstrap.addBundle(new LoggingBundle());
    bootstrap.addBundle(new PrometheusBundle());
    bootstrap.addBundle(new IdaJsonProcessingExceptionMapperBundle());
}
Also used : SubstitutingSourceProvider(io.dropwizard.configuration.SubstitutingSourceProvider) GuiceBundle(uk.gov.ida.hub.shared.guice.GuiceBundle) IdaJsonProcessingExceptionMapperBundle(uk.gov.ida.hub.policy.exception.IdaJsonProcessingExceptionMapperBundle) LoggingBundle(uk.gov.ida.bundles.LoggingBundle) ServiceStatusBundle(uk.gov.ida.bundles.ServiceStatusBundle) EnvironmentVariableSubstitutor(io.dropwizard.configuration.EnvironmentVariableSubstitutor) MonitoringBundle(uk.gov.ida.bundles.MonitoringBundle) PolicyConfiguration(uk.gov.ida.hub.policy.configuration.PolicyConfiguration) EventEmitterModule(uk.gov.ida.eventemitter.EventEmitterModule) PrometheusBundle(uk.gov.ida.metrics.bundle.PrometheusBundle)

Example 3 with GuiceBundle

use of uk.gov.ida.hub.shared.guice.GuiceBundle in project verify-hub by alphagov.

the class SamlEngineApplication method initialize.

@Override
public final void initialize(Bootstrap<SamlEngineConfiguration> bootstrap) {
    // Enable variable substitution with environment variables
    bootstrap.setConfigurationSourceProvider(new SubstitutingSourceProvider(bootstrap.getConfigurationSourceProvider(), new EnvironmentVariableSubstitutor(false)));
    MDC.clear();
    bootstrap.addBundle(new ServiceStatusBundle());
    bootstrap.addBundle(new MonitoringBundle());
    bootstrap.addBundle(new LoggingBundle());
    bootstrap.addBundle(verifyMetadataBundle);
    GuiceBundle<SamlEngineConfiguration> guiceBundle = new GuiceBundle<>(() -> asList(new SamlEngineModule(), new CryptoModule(), bindMetadata()), SamlEngineConfiguration.class);
    bootstrap.addBundle(guiceBundle);
    bootstrap.addBundle(new PrometheusBundle());
}
Also used : SubstitutingSourceProvider(io.dropwizard.configuration.SubstitutingSourceProvider) GuiceBundle(uk.gov.ida.hub.shared.guice.GuiceBundle) LoggingBundle(uk.gov.ida.bundles.LoggingBundle) ServiceStatusBundle(uk.gov.ida.bundles.ServiceStatusBundle) EnvironmentVariableSubstitutor(io.dropwizard.configuration.EnvironmentVariableSubstitutor) MonitoringBundle(uk.gov.ida.bundles.MonitoringBundle) PrometheusBundle(uk.gov.ida.metrics.bundle.PrometheusBundle)

Example 4 with GuiceBundle

use of uk.gov.ida.hub.shared.guice.GuiceBundle in project verify-hub by alphagov.

the class ConfigApplication method initialize.

@Override
public void initialize(Bootstrap<ConfigConfiguration> bootstrap) {
    // Enable variable substitution with environment variables
    bootstrap.setConfigurationSourceProvider(new SubstitutingSourceProvider(bootstrap.getConfigurationSourceProvider(), new EnvironmentVariableSubstitutor(false)));
    GuiceBundle<ConfigConfiguration> guiceBundle = new GuiceBundle<>(() -> asList(new ConfigModule(), bindS3ConfigSource()), ConfigConfiguration.class);
    bootstrap.addBundle(guiceBundle);
    bootstrap.addBundle(new ServiceStatusBundle());
    bootstrap.addBundle(new MonitoringBundle());
    bootstrap.addBundle(new LoggingBundle());
    bootstrap.addBundle(new PrometheusBundle());
    bootstrap.addCommand(new ConfigValidCommand());
}
Also used : SubstitutingSourceProvider(io.dropwizard.configuration.SubstitutingSourceProvider) GuiceBundle(uk.gov.ida.hub.shared.guice.GuiceBundle) LoggingBundle(uk.gov.ida.bundles.LoggingBundle) ServiceStatusBundle(uk.gov.ida.bundles.ServiceStatusBundle) EnvironmentVariableSubstitutor(io.dropwizard.configuration.EnvironmentVariableSubstitutor) MonitoringBundle(uk.gov.ida.bundles.MonitoringBundle) PrometheusBundle(uk.gov.ida.metrics.bundle.PrometheusBundle)

Example 5 with GuiceBundle

use of uk.gov.ida.hub.shared.guice.GuiceBundle in project verify-hub by alphagov.

the class SamlSoapProxyApplication method initialize.

@Override
public final void initialize(Bootstrap<SamlSoapProxyConfiguration> bootstrap) {
    // Enable variable substitution with environment variables
    bootstrap.setConfigurationSourceProvider(new SubstitutingSourceProvider(bootstrap.getConfigurationSourceProvider(), new EnvironmentVariableSubstitutor(false)));
    bootstrap.addBundle(verifyMetadataBundle);
    GuiceBundle<SamlSoapProxyConfiguration> guiceBundle = new GuiceBundle<>(() -> asList(new SamlSoapProxyModule(), new EventEmitterModule(), bindVerifyMetadata()), SamlSoapProxyConfiguration.class);
    bootstrap.addBundle(guiceBundle);
    bootstrap.addBundle(new ServiceStatusBundle());
    bootstrap.addBundle(new MonitoringBundle());
    bootstrap.addBundle(new LoggingBundle());
    bootstrap.addBundle(new PrometheusBundle());
}
Also used : SubstitutingSourceProvider(io.dropwizard.configuration.SubstitutingSourceProvider) GuiceBundle(uk.gov.ida.hub.shared.guice.GuiceBundle) LoggingBundle(uk.gov.ida.bundles.LoggingBundle) ServiceStatusBundle(uk.gov.ida.bundles.ServiceStatusBundle) EnvironmentVariableSubstitutor(io.dropwizard.configuration.EnvironmentVariableSubstitutor) MonitoringBundle(uk.gov.ida.bundles.MonitoringBundle) EventEmitterModule(uk.gov.ida.eventemitter.EventEmitterModule) PrometheusBundle(uk.gov.ida.metrics.bundle.PrometheusBundle)

Aggregations

EnvironmentVariableSubstitutor (io.dropwizard.configuration.EnvironmentVariableSubstitutor)6 SubstitutingSourceProvider (io.dropwizard.configuration.SubstitutingSourceProvider)6 LoggingBundle (uk.gov.ida.bundles.LoggingBundle)6 MonitoringBundle (uk.gov.ida.bundles.MonitoringBundle)6 ServiceStatusBundle (uk.gov.ida.bundles.ServiceStatusBundle)6 GuiceBundle (uk.gov.ida.hub.shared.guice.GuiceBundle)6 PrometheusBundle (uk.gov.ida.metrics.bundle.PrometheusBundle)5 EventEmitterModule (uk.gov.ida.eventemitter.EventEmitterModule)3 PolicyConfiguration (uk.gov.ida.hub.policy.configuration.PolicyConfiguration)1 IdaJsonProcessingExceptionMapperBundle (uk.gov.ida.hub.policy.exception.IdaJsonProcessingExceptionMapperBundle)1