Search in sources :

Example 1 with CoordinatorBasicAuthenticatorResourceHandler

use of org.apache.druid.security.basic.authentication.endpoint.CoordinatorBasicAuthenticatorResourceHandler in project druid by druid-io.

the class CoordinatorBasicAuthenticatorResourceTest method setUp.

@Before
public void setUp() {
    req = EasyMock.createStrictMock(HttpServletRequest.class);
    objectMapper = new ObjectMapper(new SmileFactory());
    TestDerbyConnector connector = derbyConnectorRule.getConnector();
    MetadataStorageTablesConfig tablesConfig = derbyConnectorRule.metadataTablesConfigSupplier().get();
    connector.createConfigTable();
    ObjectMapper objectMapper = new ObjectMapper(new SmileFactory());
    AuthenticatorMapper authenticatorMapper = new AuthenticatorMapper(ImmutableMap.of(AUTHENTICATOR_NAME, new BasicHTTPAuthenticator(null, AUTHENTICATOR_NAME, null, new DefaultPasswordProvider("druid"), new DefaultPasswordProvider("druid"), null, null, null, false, null), AUTHENTICATOR_NAME2, new BasicHTTPAuthenticator(null, AUTHENTICATOR_NAME2, null, new DefaultPasswordProvider("druid"), new DefaultPasswordProvider("druid"), null, null, null, false, null), AUTHENTICATOR_NAME_LDAP, new BasicHTTPAuthenticator(null, AUTHENTICATOR_NAME2, null, new DefaultPasswordProvider("druid"), new DefaultPasswordProvider("druid"), null, null, null, false, null)));
    storageUpdater = new CoordinatorBasicAuthenticatorMetadataStorageUpdater(authenticatorMapper, connector, tablesConfig, new BasicAuthCommonCacheConfig(null, null, null, null), objectMapper, new NoopBasicAuthenticatorCacheNotifier(), null);
    resource = new BasicAuthenticatorResource(new CoordinatorBasicAuthenticatorResourceHandler(storageUpdater, authenticatorMapper, objectMapper), authValidator);
    storageUpdater.start();
}
Also used : CoordinatorBasicAuthenticatorResourceHandler(org.apache.druid.security.basic.authentication.endpoint.CoordinatorBasicAuthenticatorResourceHandler) CoordinatorBasicAuthenticatorMetadataStorageUpdater(org.apache.druid.security.basic.authentication.db.updater.CoordinatorBasicAuthenticatorMetadataStorageUpdater) BasicAuthCommonCacheConfig(org.apache.druid.security.basic.BasicAuthCommonCacheConfig) TestDerbyConnector(org.apache.druid.metadata.TestDerbyConnector) HttpServletRequest(javax.servlet.http.HttpServletRequest) AuthenticatorMapper(org.apache.druid.server.security.AuthenticatorMapper) BasicHTTPAuthenticator(org.apache.druid.security.basic.authentication.BasicHTTPAuthenticator) MetadataStorageTablesConfig(org.apache.druid.metadata.MetadataStorageTablesConfig) SmileFactory(com.fasterxml.jackson.dataformat.smile.SmileFactory) BasicAuthenticatorResource(org.apache.druid.security.basic.authentication.endpoint.BasicAuthenticatorResource) DefaultPasswordProvider(org.apache.druid.metadata.DefaultPasswordProvider) ObjectMapper(com.fasterxml.jackson.databind.ObjectMapper) Before(org.junit.Before)

Aggregations

ObjectMapper (com.fasterxml.jackson.databind.ObjectMapper)1 SmileFactory (com.fasterxml.jackson.dataformat.smile.SmileFactory)1 HttpServletRequest (javax.servlet.http.HttpServletRequest)1 DefaultPasswordProvider (org.apache.druid.metadata.DefaultPasswordProvider)1 MetadataStorageTablesConfig (org.apache.druid.metadata.MetadataStorageTablesConfig)1 TestDerbyConnector (org.apache.druid.metadata.TestDerbyConnector)1 BasicAuthCommonCacheConfig (org.apache.druid.security.basic.BasicAuthCommonCacheConfig)1 BasicHTTPAuthenticator (org.apache.druid.security.basic.authentication.BasicHTTPAuthenticator)1 CoordinatorBasicAuthenticatorMetadataStorageUpdater (org.apache.druid.security.basic.authentication.db.updater.CoordinatorBasicAuthenticatorMetadataStorageUpdater)1 BasicAuthenticatorResource (org.apache.druid.security.basic.authentication.endpoint.BasicAuthenticatorResource)1 CoordinatorBasicAuthenticatorResourceHandler (org.apache.druid.security.basic.authentication.endpoint.CoordinatorBasicAuthenticatorResourceHandler)1 AuthenticatorMapper (org.apache.druid.server.security.AuthenticatorMapper)1 Before (org.junit.Before)1