@Inject public DefaultBasicAuthenticatorResourceHandler( BasicAuthenticatorCacheManager cacheManager, AuthenticatorMapper authenticatorMapper ) { this.cacheManager = cacheManager; this.authenticatorMap = new HashMap<>(); for (Map.Entry<String, Authenticator> authenticatorEntry : authenticatorMapper.getAuthenticatorMap().entrySet()) { final String authenticatorName = authenticatorEntry.getKey(); final Authenticator authenticator = authenticatorEntry.getValue(); if (authenticator instanceof BasicHTTPAuthenticator) { authenticatorMap.put( authenticatorName, (BasicHTTPAuthenticator) authenticator ); } } }
private Map<String, BasicAuthDBConfig> initAuthenticatorConfigMap(AuthenticatorMapper mapper) { Preconditions.checkNotNull(mapper); Preconditions.checkNotNull(mapper.getAuthenticatorMap()); Map<String, BasicAuthDBConfig> authenticatorConfigMap = new HashMap<>(); for (Map.Entry<String, Authenticator> entry : mapper.getAuthenticatorMap().entrySet()) { Authenticator authenticator = entry.getValue(); if (authenticator instanceof BasicHTTPAuthenticator) { String authenticatorName = entry.getKey(); BasicHTTPAuthenticator basicHTTPAuthenticator = (BasicHTTPAuthenticator) authenticator; BasicAuthDBConfig dbConfig = basicHTTPAuthenticator.getDbConfig(); authenticatorConfigMap.put(authenticatorName, dbConfig); } } return authenticatorConfigMap; } }
private void initUserMaps() { AuthenticatorMapper authenticatorMapper = injector.getInstance(AuthenticatorMapper.class); if (authenticatorMapper == null || authenticatorMapper.getAuthenticatorMap() == null) { return; } for (Map.Entry<String, Authenticator> entry : authenticatorMapper.getAuthenticatorMap().entrySet()) { Authenticator authenticator = entry.getValue(); if (authenticator instanceof BasicHTTPAuthenticator) { String authenticatorName = entry.getKey(); authenticatorPrefixes.add(authenticatorName); Map<String, BasicAuthenticatorUser> userMap = fetchUserMapFromCoordinator(authenticatorName, true); if (userMap != null) { cachedUserMaps.put(authenticatorName, userMap); } } } } }
@Inject public CoordinatorBasicAuthenticatorResourceHandler( BasicAuthenticatorMetadataStorageUpdater storageUpdater, AuthenticatorMapper authenticatorMapper, @Smile ObjectMapper objectMapper ) { this.storageUpdater = storageUpdater; this.objectMapper = objectMapper; this.authenticatorMap = new HashMap<>(); for (Map.Entry<String, Authenticator> authenticatorEntry : authenticatorMapper.getAuthenticatorMap().entrySet()) { final String authenticatorName = authenticatorEntry.getKey(); final Authenticator authenticator = authenticatorEntry.getValue(); if (authenticator instanceof BasicHTTPAuthenticator) { authenticatorMap.put( authenticatorName, (BasicHTTPAuthenticator) authenticator ); } } }
BasicHTTPAuthenticator authenticator = (BasicHTTPAuthenticator) authenticatorMapper.getAuthenticatorMap().get( prefix );
AuthConfig.DRUID_AUTHENTICATION_RESULT); if (authenticationResult != null && authenticationResult.getAuthenticatedBy() != null) { Authenticator authenticator = authenticatorMapper.getAuthenticatorMap() .get(authenticationResult.getAuthenticatedBy()); if (authenticator != null) {
if (authenticatorMapper == null || authenticatorMapper.getAuthenticatorMap() == null) { return; for (Map.Entry<String, Authenticator> entry : authenticatorMapper.getAuthenticatorMap().entrySet()) { Authenticator authenticator = entry.getValue(); if (authenticator instanceof BasicHTTPAuthenticator) {
private Map<String, BasicAuthDBConfig> initAuthenticatorConfigMap(AuthenticatorMapper mapper) { Preconditions.checkNotNull(mapper); Preconditions.checkNotNull(mapper.getAuthenticatorMap()); Map<String, BasicAuthDBConfig> authenticatorConfigMap = new HashMap<>(); for (Map.Entry<String, Authenticator> entry : mapper.getAuthenticatorMap().entrySet()) { Authenticator authenticator = entry.getValue(); if (authenticator instanceof BasicHTTPAuthenticator) { String authenticatorName = entry.getKey(); BasicHTTPAuthenticator basicHTTPAuthenticator = (BasicHTTPAuthenticator) authenticator; BasicAuthDBConfig dbConfig = basicHTTPAuthenticator.getDbConfig(); authenticatorConfigMap.put(authenticatorName, dbConfig); } } return authenticatorConfigMap; } }
private void initUserMaps() { AuthenticatorMapper authenticatorMapper = injector.getInstance(AuthenticatorMapper.class); if (authenticatorMapper == null || authenticatorMapper.getAuthenticatorMap() == null) { return; } for (Map.Entry<String, Authenticator> entry : authenticatorMapper.getAuthenticatorMap().entrySet()) { Authenticator authenticator = entry.getValue(); if (authenticator instanceof BasicHTTPAuthenticator) { String authenticatorName = entry.getKey(); authenticatorPrefixes.add(authenticatorName); Map<String, BasicAuthenticatorUser> userMap = fetchUserMapFromCoordinator(authenticatorName, true); if (userMap != null) { cachedUserMaps.put(authenticatorName, userMap); } } } } }
@Inject public DefaultBasicAuthenticatorResourceHandler( BasicAuthenticatorCacheManager cacheManager, AuthenticatorMapper authenticatorMapper ) { this.cacheManager = cacheManager; this.authenticatorMap = Maps.newHashMap(); for (Map.Entry<String, Authenticator> authenticatorEntry : authenticatorMapper.getAuthenticatorMap().entrySet()) { final String authenticatorName = authenticatorEntry.getKey(); final Authenticator authenticator = authenticatorEntry.getValue(); if (authenticator instanceof BasicHTTPAuthenticator) { authenticatorMap.put( authenticatorName, (BasicHTTPAuthenticator) authenticator ); } } }
@Inject public CoordinatorBasicAuthenticatorResourceHandler( BasicAuthenticatorMetadataStorageUpdater storageUpdater, AuthenticatorMapper authenticatorMapper, @Smile ObjectMapper objectMapper ) { this.storageUpdater = storageUpdater; this.objectMapper = objectMapper; this.authenticatorMap = Maps.newHashMap(); for (Map.Entry<String, Authenticator> authenticatorEntry : authenticatorMapper.getAuthenticatorMap().entrySet()) { final String authenticatorName = authenticatorEntry.getKey(); final Authenticator authenticator = authenticatorEntry.getValue(); if (authenticator instanceof BasicHTTPAuthenticator) { authenticatorMap.put( authenticatorName, (BasicHTTPAuthenticator) authenticator ); } } }
BasicHTTPAuthenticator authenticator = (BasicHTTPAuthenticator) authenticatorMapper.getAuthenticatorMap().get( prefix );
AuthConfig.DRUID_AUTHENTICATION_RESULT); if (authenticationResult != null && authenticationResult.getAuthenticatedBy() != null) { Authenticator authenticator = authenticatorMapper.getAuthenticatorMap() .get(authenticationResult.getAuthenticatedBy()); if (authenticator != null) {
if (authenticatorMapper == null || authenticatorMapper.getAuthenticatorMap() == null) { return; for (Map.Entry<String, Authenticator> entry : authenticatorMapper.getAuthenticatorMap().entrySet()) { Authenticator authenticator = entry.getValue(); if (authenticator instanceof BasicHTTPAuthenticator) {