return new AuthenticatorMapper(authenticatorMap); return new AuthenticatorMapper(authenticatorMap);
@Inject public DruidMeta( final SqlLifecycleFactory sqlLifecycleFactory, final AvaticaServerConfig config, final Injector injector ) { super(null); this.sqlLifecycleFactory = Preconditions.checkNotNull(sqlLifecycleFactory, "sqlLifecycleFactory"); this.config = config; this.exec = Executors.newSingleThreadScheduledExecutor( new ThreadFactoryBuilder() .setNameFormat(StringUtils.format("DruidMeta@%s-ScheduledExecutor", Integer.toHexString(hashCode()))) .setDaemon(true) .build() ); final AuthenticatorMapper authenticatorMapper = injector.getInstance(AuthenticatorMapper.class); this.authenticators = authenticatorMapper.getAuthenticatorChain(); }
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; } }
@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 ); } } }
AuthenticationUtils.addNoopAuthorizationFilters(root, authConfig.getUnsecuredPaths()); final List<Authenticator> authenticators = authenticatorMapper.getAuthenticatorChain(); AuthenticationUtils.addAuthenticationFilterChain(root, authenticators);
new NoopRequestLogger(), new DefaultGenericQueryMetricsFactory(jsonMapper), new AuthenticatorMapper(ImmutableMap.of())
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); } } } } }
AuthenticationUtils.addNoopAuthorizationFilters(root, authConfig.getUnsecuredPaths()); final List<Authenticator> authenticators = authenticatorMapper.getAuthenticatorChain(); AuthenticationUtils.addAuthenticationFilterChain(root, authenticators);
new NoopRequestLogger(), new DefaultGenericQueryMetricsFactory(jsonMapper), new AuthenticatorMapper(ImmutableMap.of())
@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 ); } } }
AuthenticationUtils.addNoopAuthorizationFilters(root, authConfig.getUnsecuredPaths()); final List<Authenticator> authenticators = authenticatorMapper.getAuthenticatorChain(); AuthenticationUtils.addAuthenticationFilterChain(root, authenticators);
return new AuthenticatorMapper(authenticatorMap); return new AuthenticatorMapper(authenticatorMap);
BasicHTTPAuthenticator authenticator = (BasicHTTPAuthenticator) authenticatorMapper.getAuthenticatorMap().get( prefix );
List<Authenticator> authenticators = authenticatorMapper.getAuthenticatorChain(); AuthenticationUtils.addAuthenticationFilterChain(root, authenticators);
AuthConfig.DRUID_AUTHENTICATION_RESULT); if (authenticationResult != null && authenticationResult.getAuthenticatedBy() != null) { Authenticator authenticator = authenticatorMapper.getAuthenticatorMap() .get(authenticationResult.getAuthenticatedBy()); if (authenticator != null) {
AuthenticationUtils.addNoopAuthorizationFilters(root, authConfig.getUnsecuredPaths()); List<Authenticator> authenticators = authenticatorMapper.getAuthenticatorChain(); AuthenticationUtils.addAuthenticationFilterChain(root, authenticators);
if (authenticatorMapper == null || authenticatorMapper.getAuthenticatorMap() == null) { return; for (Map.Entry<String, Authenticator> entry : authenticatorMapper.getAuthenticatorMap().entrySet()) { Authenticator authenticator = entry.getValue(); if (authenticator instanceof BasicHTTPAuthenticator) {
@Inject public DruidMeta( final PlannerFactory plannerFactory, final AvaticaServerConfig config, final Injector injector ) { super(null); this.plannerFactory = Preconditions.checkNotNull(plannerFactory, "plannerFactory"); this.config = config; this.exec = Executors.newSingleThreadScheduledExecutor( new ThreadFactoryBuilder() .setNameFormat(StringUtils.format("DruidMeta@%s-ScheduledExecutor", Integer.toHexString(hashCode()))) .setDaemon(true) .build() ); final AuthenticatorMapper authenticatorMapper = injector.getInstance(AuthenticatorMapper.class); this.authenticators = authenticatorMapper.getAuthenticatorChain(); }
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); } } } } }
AuthenticationUtils.addNoopAuthorizationFilters(root, authConfig.getUnsecuredPaths()); final List<Authenticator> authenticators = authenticatorMapper.getAuthenticatorChain(); AuthenticationUtils.addAuthenticationFilterChain(root, authenticators);