use of uk.gov.ida.common.shared.security.TrustStoreMetrics in project verify-hub by alphagov.
the class ConfigApplication method run.
@Override
public void run(ConfigConfiguration configuration, Environment environment) {
environment.getObjectMapper().setDateFormat(new StdDateFormat());
registerResources(environment);
environment.servlets().addFilter("Logging SessionId registration Filter", SessionIdQueryParamLoggingFilter.class).addMappingForUrlPatterns(EnumSet.allOf(DispatcherType.class), true, "/*");
TrustStoreMetrics trustStoreMetrics = new TrustStoreMetrics();
registerMetrics(trustStoreMetrics, "rp", configuration.getRpTrustStoreConfiguration());
registerMetrics(trustStoreMetrics, "client", configuration.getClientTrustStoreConfiguration());
}
use of uk.gov.ida.common.shared.security.TrustStoreMetrics in project verify-hub by alphagov.
the class SamlProxyApplication method run.
@Override
public void run(SamlProxyConfiguration configuration, Environment environment) {
environment.getObjectMapper().setDateFormat(new StdDateFormat());
IdaSamlBootstrap.bootstrap();
for (Class klass : getResources()) {
environment.jersey().register(klass);
}
for (Class klass : getExceptionMappers()) {
environment.jersey().register(klass);
}
MetadataResolverConfiguration metadataConfiguration = configuration.getMetadataConfiguration();
ClientTrustStoreConfiguration rpTrustStoreConfiguration = configuration.getRpTrustStoreConfiguration();
KeyStore rpTrustStore = new KeyStoreLoader().load(rpTrustStoreConfiguration.getPath(), rpTrustStoreConfiguration.getPassword());
TrustStoreMetrics trustStoreMetrics = new TrustStoreMetrics();
metadataConfiguration.getHubTrustStore().ifPresent(hubTrustStore -> trustStoreMetrics.registerTrustStore("hub", hubTrustStore));
metadataConfiguration.getIdpTrustStore().ifPresent(idpTrustStore -> trustStoreMetrics.registerTrustStore("idp", idpTrustStore));
trustStoreMetrics.registerTrustStore("rp", rpTrustStore);
environment.servlets().addFilter("Logging SessionId registration Filter", SessionIdQueryParamLoggingFilter.class).addMappingForUrlPatterns(EnumSet.allOf(DispatcherType.class), true, "/*");
}
use of uk.gov.ida.common.shared.security.TrustStoreMetrics in project verify-hub by alphagov.
the class SamlSoapProxyApplication method run.
@Override
public void run(SamlSoapProxyConfiguration configuration, Environment environment) {
IdaSamlBootstrap.bootstrap();
environment.getObjectMapper().setDateFormat(new StdDateFormat());
registerResources(environment);
// calling .get() here is safe because the Optional is never empty
MetadataResolverConfiguration metadataConfiguration = configuration.getMetadataConfiguration().get();
ClientTrustStoreConfiguration rpTrustStoreConfiguration = configuration.getRpTrustStoreConfiguration();
KeyStore rpTrustStore = new KeyStoreLoader().load(rpTrustStoreConfiguration.getPath(), rpTrustStoreConfiguration.getPassword());
TrustStoreMetrics trustStoreMetrics = new TrustStoreMetrics();
metadataConfiguration.getHubTrustStore().ifPresent(hubTrustStore -> trustStoreMetrics.registerTrustStore("hub", hubTrustStore));
metadataConfiguration.getIdpTrustStore().ifPresent(idpTrustStore -> trustStoreMetrics.registerTrustStore("idp", idpTrustStore));
trustStoreMetrics.registerTrustStore("rp", rpTrustStore);
environment.servlets().addFilter("Logging SessionId registration Filter", SessionIdQueryParamLoggingFilter.class).addMappingForUrlPatterns(EnumSet.allOf(DispatcherType.class), true, "/*");
}
use of uk.gov.ida.common.shared.security.TrustStoreMetrics in project verify-hub by alphagov.
the class SamlEngineApplication method run.
@Override
public final void run(SamlEngineConfiguration configuration, Environment environment) {
IdaSamlBootstrap.bootstrap();
environment.getObjectMapper().registerModule(new GuavaModule());
environment.getObjectMapper().setDateFormat(new StdDateFormat());
// register resources
registerResources(environment, configuration);
// register exception mappers
environment.jersey().register(SamlEngineExceptionMapper.class);
// calling .get() here is safe because the Optional is never empty
MetadataResolverConfiguration metadataConfiguration = configuration.getMetadataConfiguration().get();
ClientTrustStoreConfiguration rpTrustStoreConfiguration = configuration.getRpTrustStoreConfiguration();
KeyStore rpTrustStore = new KeyStoreLoader().load(rpTrustStoreConfiguration.getPath(), rpTrustStoreConfiguration.getPassword());
TrustStoreMetrics trustStoreMetrics = new TrustStoreMetrics();
metadataConfiguration.getHubTrustStore().ifPresent(hubTrustStore -> trustStoreMetrics.registerTrustStore("hub", hubTrustStore));
metadataConfiguration.getIdpTrustStore().ifPresent(idpTrustStore -> trustStoreMetrics.registerTrustStore("idp", idpTrustStore));
trustStoreMetrics.registerTrustStore("rp", rpTrustStore);
environment.servlets().addFilter("Logging SessionId registration Filter", SessionIdQueryParamLoggingFilter.class).addMappingForUrlPatterns(EnumSet.allOf(DispatcherType.class), true, "/*");
}
Aggregations