use of org.springframework.beans.factory.annotation.Qualifier in project uPortal by Jasig.
the class PersonDirectoryConfiguration method getRequestAttributesDao.
/**
* The person attributes DAO that returns the attributes from the request. Uses a
* currentUserProvider since the username may not always be provided by the request object.
*/
@Bean(name = "requestAttributesDao")
@Qualifier("uPortalInternal")
public IPersonAttributeDao getRequestAttributesDao() {
final AdditionalDescriptorsPersonAttributeDao rslt = new AdditionalDescriptorsPersonAttributeDao();
rslt.setDescriptors(getRequestAdditionalDescriptors());
rslt.setUsernameAttributeProvider(getUsernameAttributeProvider());
rslt.setCurrentUserProvider(getCurrentUserProvider());
return rslt;
}
use of org.springframework.beans.factory.annotation.Qualifier in project uPortal by Jasig.
the class PersonDirectoryConfiguration method getUPortalJdbcUserSource.
/**
* Looks in the base UP_USER table, doesn't find attributes but will ensure a result if it the
* user exists in the portal database and is searched for by username, results are cached by the
* outer caching DAO.
*/
@Bean(name = "uPortalJdbcUserSource")
@Qualifier("uPortalInternal")
public IPersonAttributeDao getUPortalJdbcUserSource() {
final String sql = "SELECT USER_NAME FROM UP_USER WHERE {0}";
final SingleRowJdbcPersonAttributeDao rslt = new SingleRowJdbcPersonAttributeDao(personDb, sql);
rslt.setUsernameAttributeProvider(getUsernameAttributeProvider());
rslt.setQueryAttributeMapping(Collections.singletonMap(USERNAME_ATTRIBUTE, USERNAME_COLUMN_NAME));
final Map<String, Set<String>> resultAttributeMapping = new HashMap<>();
resultAttributeMapping.put(USERNAME_COLUMN_NAME, Stream.of(USERNAME_ATTRIBUTE, UID_ATTRIBUTE, USER_LOGIN_ID_ATTRIBUTE).collect(Collectors.toSet()));
rslt.setResultAttributeMapping(resultAttributeMapping);
return rslt;
}
use of org.springframework.beans.factory.annotation.Qualifier in project zipkin by openzipkin.
the class ZipkinElasticsearchStorageConfiguration method dynamicCredentialsScheduledExecutorService.
@Bean(destroyMethod = "shutdown")
@Qualifier(QUALIFIER)
@Conditional(DynamicRefreshRequired.class)
ScheduledExecutorService dynamicCredentialsScheduledExecutorService(@Value("${" + CREDENTIALS_FILE + "}") String credentialsFile, @Value("${" + CREDENTIALS_REFRESH_INTERVAL + "}") Integer credentialsRefreshInterval, @Qualifier(QUALIFIER) BasicCredentials basicCredentials) throws IOException {
ScheduledExecutorService ses = Executors.newSingleThreadScheduledExecutor(new NamedThreadFactory("zipkin-load-es-credentials"));
DynamicCredentialsFileLoader credentialsFileLoader = new DynamicCredentialsFileLoader(basicCredentials, credentialsFile);
credentialsFileLoader.updateCredentialsFromProperties();
ScheduledFuture<?> future = ses.scheduleAtFixedRate(credentialsFileLoader, 0, credentialsRefreshInterval, TimeUnit.SECONDS);
if (future.isDone())
throw new RuntimeException("credential refresh thread didn't start");
return ses;
}
use of org.springframework.beans.factory.annotation.Qualifier in project open-kilda by telstra.
the class SecurityConfig method ssoCircleExtendedMetadataProvider.
@Bean
@Qualifier("idp-ssocircle")
public ExtendedMetadataDelegate ssoCircleExtendedMetadataProvider() throws MetadataProviderException {
DbMetadataProvider provider = new DbMetadataProvider();
ExtendedMetadataDelegate extendedMetadataDelegate = new ExtendedMetadataDelegate(provider, extendedMetadata());
extendedMetadataDelegate.setMetadataTrustCheck(false);
extendedMetadataDelegate.setMetadataRequireSignature(false);
return extendedMetadataDelegate;
}
use of org.springframework.beans.factory.annotation.Qualifier in project open-kilda by telstra.
the class SecurityConfig method metadata.
@Bean
@Qualifier("metadata")
public CachingMetadataManager metadata(ExtendedMetadataDelegate extendedMetadataDelegate) throws MetadataProviderException, IOException {
List<MetadataProvider> metadataProviderList = new ArrayList<>();
List<SamlConfigEntity> samlConfigEntityList = samlRepository.findAll();
if (samlConfigEntityList != null) {
for (final SamlConfigEntity samlConfigEntity : samlConfigEntityList) {
if (samlConfigEntity.getUrl() != null) {
UrlMetadataProvider urlMetadataProvider = new UrlMetadataProvider(new Timer(true), new HttpClient(), samlConfigEntity.getUuid());
urlMetadataProvider.setParserPool(ParserPoolHolder.getPool());
ExtendedMetadataDelegate metadataDelegate = new ExtendedMetadataDelegate(urlMetadataProvider, extendedMetadata());
metadataDelegate.setMetadataTrustCheck(false);
metadataDelegate.setMetadataRequireSignature(false);
metadataProviderList.add(metadataDelegate);
} else {
DbMetadataProvider metadataProvider = new DbMetadataProvider(new Timer(true), samlConfigEntity.getUuid());
metadataProvider.setParserPool(ParserPoolHolder.getPool());
ExtendedMetadataDelegate metadataDelegate = new ExtendedMetadataDelegate(metadataProvider, extendedMetadata());
metadataDelegate.setMetadataTrustCheck(false);
metadataDelegate.setMetadataRequireSignature(false);
metadataProviderList.add(metadataDelegate);
}
}
}
return new CachingMetadataManager(metadataProviderList);
}
Aggregations