Search in sources :

Example 26 with Profile

use of org.springframework.context.annotation.Profile in project vorto by eclipse.

the class ElasticSearchConfiguration method awsIndexingClient.

@Bean
@Profile({ "prod", "int" })
public RestHighLevelClient awsIndexingClient() {
    logger.info("Creating an elastic server client with config(serviceName=" + serviceName + " region=" + region + " aesEndpoint=" + aesEndpoint);
    AWS4Signer signer = new AWS4Signer();
    signer.setServiceName(serviceName);
    signer.setRegionName(region);
    HttpRequestInterceptor interceptor = new AWSRequestSigningApacheInterceptor(serviceName, signer, credentialsProvider);
    RestClientBuilder builder = RestClient.builder(HttpHost.create(aesEndpoint)).setHttpClientConfigCallback(httpClientConfig(getProxy(), interceptor));
    return new RestHighLevelClient(builder);
}
Also used : AWS4Signer(com.amazonaws.auth.AWS4Signer) HttpRequestInterceptor(org.apache.http.HttpRequestInterceptor) RestClientBuilder(org.elasticsearch.client.RestClientBuilder) AWSRequestSigningApacheInterceptor(com.amazonaws.http.AWSRequestSigningApacheInterceptor) RestHighLevelClient(org.elasticsearch.client.RestHighLevelClient) Profile(org.springframework.context.annotation.Profile) Bean(org.springframework.context.annotation.Bean)

Example 27 with Profile

use of org.springframework.context.annotation.Profile in project webanno by webanno.

the class WebAnnoSecurity method preAuthFilter.

@Bean
@Profile("auto-mode-preauth")
public ShibbolethRequestHeaderAuthenticationFilter preAuthFilter(UserDao aUserRepository, UserDetailsManager aUserDetailsService, @Lazy AuthenticationManager aAuthenticationManager) {
    ShibbolethRequestHeaderAuthenticationFilter filter = new ShibbolethRequestHeaderAuthenticationFilter();
    filter.setPrincipalRequestHeader(preAuthPrincipalHeader);
    filter.setAuthenticationManager(aAuthenticationManager);
    filter.setUserDetailsManager(aUserDetailsService);
    filter.setUserRepository(aUserRepository);
    filter.setExceptionIfHeaderMissing(true);
    return filter;
}
Also used : ShibbolethRequestHeaderAuthenticationFilter(de.tudarmstadt.ukp.clarin.webanno.security.preauth.ShibbolethRequestHeaderAuthenticationFilter) Profile(org.springframework.context.annotation.Profile) Bean(org.springframework.context.annotation.Bean)

Aggregations

Bean (org.springframework.context.annotation.Bean)27 Profile (org.springframework.context.annotation.Profile)27 ObjectFactoryCreatingFactoryBean (org.springframework.beans.factory.config.ObjectFactoryCreatingFactoryBean)5 ArrayList (java.util.ArrayList)2 ConfigurationProperties (org.springframework.boot.context.properties.ConfigurationProperties)2 Scope (org.springframework.context.annotation.Scope)2 DaoAuthenticationProvider (org.springframework.security.authentication.dao.DaoAuthenticationProvider)2 ExternalConfiguration (alfio.manager.system.ExternalConfiguration)1 AWS4Signer (com.amazonaws.auth.AWS4Signer)1 AWSRequestSigningApacheInterceptor (com.amazonaws.http.AWSRequestSigningApacheInterceptor)1 ReportPortalRepositoryFactoryBean (com.epam.ta.reportportal.database.dao.ReportPortalRepositoryFactoryBean)1 RepositoriesFactoryBean (com.epam.ta.reportportal.database.support.RepositoriesFactoryBean)1 JcrIndexService (com.thinkbiganalytics.metadata.modeshape.service.JcrIndexService)1 SimpleServiceLevelAssessor (com.thinkbiganalytics.metadata.sla.spi.core.SimpleServiceLevelAssessor)1 WebAnnoDaoAuthenticationProvider (de.tudarmstadt.ukp.clarin.webanno.security.WebAnnoDaoAuthenticationProvider)1 ShibbolethRequestHeaderAuthenticationFilter (de.tudarmstadt.ukp.clarin.webanno.security.preauth.ShibbolethRequestHeaderAuthenticationFilter)1 InvocationTargetException (java.lang.reflect.InvocationTargetException)1 Method (java.lang.reflect.Method)1 SQLException (java.sql.SQLException)1 ScheduledExecutorService (java.util.concurrent.ScheduledExecutorService)1