use of uk.gov.ida.hub.config.domain.IdentityProviderConfigEntityData in project verify-hub by alphagov.
the class ConfigModule method configure.
@Override
protected void configure() {
bind(ConfigHealthCheck.class).asEagerSingleton();
bind(ConfigDataBootstrap.class).asEagerSingleton();
bind(CertificateChainConfigValidator.class).annotatedWith(CertificateConfigValidator.class).to(LoggingCertificateChainConfigValidator.class);
bind(TrustStoreConfiguration.class).to(ConfigConfiguration.class);
bind(new TypeLiteral<ConfigurationFactoryFactory<IdentityProviderConfigEntityData>>() {
}).toInstance(new DefaultConfigurationFactoryFactory<IdentityProviderConfigEntityData>());
bind(new TypeLiteral<ConfigurationFactoryFactory<TransactionConfigEntityData>>() {
}).toInstance(new DefaultConfigurationFactoryFactory<TransactionConfigEntityData>());
bind(new TypeLiteral<ConfigurationFactoryFactory<MatchingServiceConfigEntityData>>() {
}).toInstance(new DefaultConfigurationFactoryFactory<MatchingServiceConfigEntityData>());
bind(new TypeLiteral<ConfigurationFactoryFactory<CountriesConfigEntityData>>() {
}).toInstance(new DefaultConfigurationFactoryFactory<CountriesConfigEntityData>());
bind(new TypeLiteral<ConfigDataSource<TransactionConfigEntityData>>() {
}).to(FileBackedTransactionConfigDataSource.class).asEagerSingleton();
bind(new TypeLiteral<ConfigDataSource<MatchingServiceConfigEntityData>>() {
}).to(FileBackedMatchingServiceConfigDataSource.class).asEagerSingleton();
bind(new TypeLiteral<ConfigDataSource<IdentityProviderConfigEntityData>>() {
}).to(FileBackedIdentityProviderConfigDataSource.class).asEagerSingleton();
bind(new TypeLiteral<ConfigDataSource<CountriesConfigEntityData>>() {
}).to(FileBackedCountriesConfigDataSource.class).asEagerSingleton();
bind(new TypeLiteral<ConfigEntityDataRepository<TransactionConfigEntityData>>() {
}).asEagerSingleton();
bind(new TypeLiteral<ConfigEntityDataRepository<CountriesConfigEntityData>>() {
}).asEagerSingleton();
bind(new TypeLiteral<ConfigEntityDataRepository<MatchingServiceConfigEntityData>>() {
}).asEagerSingleton();
bind(new TypeLiteral<ConfigEntityDataRepository<IdentityProviderConfigEntityData>>() {
}).asEagerSingleton();
bind(ObjectMapper.class).toInstance(new ObjectMapper().registerModule(new GuavaModule()));
bind(LevelsOfAssuranceConfigValidator.class).toInstance(new LevelsOfAssuranceConfigValidator());
bind(CertificateChainValidator.class);
bind(TrustStoreForCertificateProvider.class);
bind(X509CertificateFactory.class).toInstance(new X509CertificateFactory());
bind(KeyStoreCache.class);
bind(ExceptionFactory.class);
bind(OCSPCertificateChainValidityChecker.class);
bind(EntityConfigDataToCertificateDtoTransformer.class);
bind(OCSPCertificateChainValidator.class);
bind(IdpPredicateFactory.class);
bind(KeyStoreLoader.class).toInstance(new KeyStoreLoader());
bind(OCSPPKIXParametersProvider.class).toInstance(new OCSPPKIXParametersProvider());
bind(PKIXParametersProvider.class).toInstance(new PKIXParametersProvider());
bind(CertificateService.class);
}
use of uk.gov.ida.hub.config.domain.IdentityProviderConfigEntityData in project verify-hub by alphagov.
the class ConfigValidCommand method run.
@Override
public void run(Bootstrap<ConfigConfiguration> bootstrap, Namespace namespace, ConfigConfiguration configuration) throws Exception {
Injector injector = Guice.createInjector(new AbstractModule() {
@Override
protected void configure() {
bind(new TypeLiteral<ConfigurationFactoryFactory<IdentityProviderConfigEntityData>>() {
}).toInstance(new DefaultConfigurationFactoryFactory<>());
bind(new TypeLiteral<ConfigurationFactoryFactory<MatchingServiceConfigEntityData>>() {
}).toInstance(new DefaultConfigurationFactoryFactory<>());
bind(new TypeLiteral<ConfigurationFactoryFactory<TransactionConfigEntityData>>() {
}).toInstance(new DefaultConfigurationFactoryFactory<>());
bind(new TypeLiteral<ConfigurationFactoryFactory<CountriesConfigEntityData>>() {
}).toInstance(new DefaultConfigurationFactoryFactory<>());
bind(new TypeLiteral<ConfigDataSource<TransactionConfigEntityData>>() {
}).to(FileBackedTransactionConfigDataSource.class).asEagerSingleton();
bind(new TypeLiteral<ConfigDataSource<MatchingServiceConfigEntityData>>() {
}).to(FileBackedMatchingServiceConfigDataSource.class).asEagerSingleton();
bind(new TypeLiteral<ConfigDataSource<IdentityProviderConfigEntityData>>() {
}).to(FileBackedIdentityProviderConfigDataSource.class).asEagerSingleton();
bind(new TypeLiteral<ConfigDataSource<CountriesConfigEntityData>>() {
}).to(FileBackedCountriesConfigDataSource.class).asEagerSingleton();
bind(new TypeLiteral<ConfigEntityDataRepository<TransactionConfigEntityData>>() {
}).asEagerSingleton();
bind(new TypeLiteral<ConfigEntityDataRepository<CountriesConfigEntityData>>() {
}).asEagerSingleton();
bind(new TypeLiteral<ConfigEntityDataRepository<MatchingServiceConfigEntityData>>() {
}).asEagerSingleton();
bind(new TypeLiteral<ConfigEntityDataRepository<IdentityProviderConfigEntityData>>() {
}).asEagerSingleton();
bind(ConfigConfiguration.class).toInstance(configuration);
bind(LevelsOfAssuranceConfigValidator.class).toInstance(new LevelsOfAssuranceConfigValidator());
bind(TrustStoreConfiguration.class).to(ConfigConfiguration.class);
bind(TrustStoreForCertificateProvider.class);
bind(CertificateChainConfigValidator.class).annotatedWith(CertificateConfigValidator.class).to(ThrowingCertificateChainConfigValidator.class);
}
});
ConfigDataBootstrap checkConfigValid = injector.getInstance(ConfigDataBootstrap.class);
try {
checkConfigValid.start();
} catch (ConfigValidationException e) {
LOG.info(e.getMessage());
throw e;
}
}
Aggregations