Search in sources :

Example 1 with BasicAuthorizerResource

use of org.apache.druid.security.basic.authorization.endpoint.BasicAuthorizerResource in project druid by druid-io.

the class CoordinatorBasicAuthorizerResourceTest method setUp.

@Before
public void setUp() {
    connector = derbyConnectorRule.getConnector();
    tablesConfig = derbyConnectorRule.metadataTablesConfigSupplier().get();
    connector.createConfigTable();
    AuthorizerMapper authorizerMapper = new AuthorizerMapper(ImmutableMap.of(AUTHORIZER_NAME, new BasicRoleBasedAuthorizer(null, AUTHORIZER_NAME, null, null, null, null, null, null), AUTHORIZER_NAME2, new BasicRoleBasedAuthorizer(null, AUTHORIZER_NAME2, null, null, null, null, null, null), AUTHORIZER_NAME3, new BasicRoleBasedAuthorizer(null, AUTHORIZER_NAME3, null, null, "adminGroupMapping", null, null, null)));
    storageUpdater = new CoordinatorBasicAuthorizerMetadataStorageUpdater(authorizerMapper, connector, tablesConfig, new BasicAuthCommonCacheConfig(null, null, null, null), new ObjectMapper(new SmileFactory()), new NoopBasicAuthorizerCacheNotifier(), null);
    resource = new BasicAuthorizerResource(new CoordinatorBasicAuthorizerResourceHandler(storageUpdater, authorizerMapper, new ObjectMapper(new SmileFactory())), authValidator);
    storageUpdater.start();
}
Also used : SmileFactory(com.fasterxml.jackson.dataformat.smile.SmileFactory) CoordinatorBasicAuthorizerMetadataStorageUpdater(org.apache.druid.security.basic.authorization.db.updater.CoordinatorBasicAuthorizerMetadataStorageUpdater) AuthorizerMapper(org.apache.druid.server.security.AuthorizerMapper) BasicAuthCommonCacheConfig(org.apache.druid.security.basic.BasicAuthCommonCacheConfig) BasicAuthorizerResource(org.apache.druid.security.basic.authorization.endpoint.BasicAuthorizerResource) BasicRoleBasedAuthorizer(org.apache.druid.security.basic.authorization.BasicRoleBasedAuthorizer) CoordinatorBasicAuthorizerResourceHandler(org.apache.druid.security.basic.authorization.endpoint.CoordinatorBasicAuthorizerResourceHandler) 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 BasicAuthCommonCacheConfig (org.apache.druid.security.basic.BasicAuthCommonCacheConfig)1 BasicRoleBasedAuthorizer (org.apache.druid.security.basic.authorization.BasicRoleBasedAuthorizer)1 CoordinatorBasicAuthorizerMetadataStorageUpdater (org.apache.druid.security.basic.authorization.db.updater.CoordinatorBasicAuthorizerMetadataStorageUpdater)1 BasicAuthorizerResource (org.apache.druid.security.basic.authorization.endpoint.BasicAuthorizerResource)1 CoordinatorBasicAuthorizerResourceHandler (org.apache.druid.security.basic.authorization.endpoint.CoordinatorBasicAuthorizerResourceHandler)1 AuthorizerMapper (org.apache.druid.server.security.AuthorizerMapper)1 Before (org.junit.Before)1