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);
}
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;
}
Aggregations