Search in sources :

Example 11 with RMRegistryOperationsService

use of org.apache.hadoop.registry.server.integration.RMRegistryOperationsService in project hadoop by apache.

the class TestSecureRMRegistryOperations method testUserHomedirsPermissionsRestricted.

@Test
public void testUserHomedirsPermissionsRestricted() throws Throwable {
    // test that the /users/$user permissions are restricted
    RMRegistryOperationsService rmRegistryOperations = startRMRegistryOperations();
    // create Alice's dir, so it should have an ACL for Alice
    final String home = rmRegistryOperations.initUserRegistry(ALICE);
    List<ACL> acls = rmRegistryOperations.zkGetACLS(home);
    ACL aliceACL = null;
    for (ACL acl : acls) {
        LOG.info(RegistrySecurity.aclToString(acl));
        Id id = acl.getId();
        if (id.getScheme().equals(ZookeeperConfigOptions.SCHEME_SASL) && id.getId().startsWith(ALICE)) {
            aliceACL = acl;
            break;
        }
    }
    assertNotNull(aliceACL);
    assertEquals(RegistryAdminService.USER_HOMEDIR_ACL_PERMISSIONS, aliceACL.getPerms());
}
Also used : ACL(org.apache.zookeeper.data.ACL) Id(org.apache.zookeeper.data.Id) RMRegistryOperationsService(org.apache.hadoop.registry.server.integration.RMRegistryOperationsService) Test(org.junit.Test)

Example 12 with RMRegistryOperationsService

use of org.apache.hadoop.registry.server.integration.RMRegistryOperationsService in project jstorm by alibaba.

the class Executor method setupInitialRegistryPaths.

/**
 * TODO: purge this once RM is doing the work
 *
 * @throws IOException
 */
protected void setupInitialRegistryPaths() throws IOException {
    if (registryOperations instanceof RMRegistryOperationsService) {
        RMRegistryOperationsService rmRegOperations = (RMRegistryOperationsService) registryOperations;
        rmRegOperations.initUserRegistryAsync(RegistryUtils.currentUser());
    }
}
Also used : RMRegistryOperationsService(org.apache.hadoop.registry.server.integration.RMRegistryOperationsService)

Aggregations

RMRegistryOperationsService (org.apache.hadoop.registry.server.integration.RMRegistryOperationsService)12 Test (org.junit.Test)8 RegistryOperations (org.apache.hadoop.registry.client.api.RegistryOperations)7 FileNotFoundException (java.io.FileNotFoundException)2 IOException (java.io.IOException)2 LoginException (javax.security.auth.login.LoginException)2 PathPermissionException (org.apache.hadoop.fs.PathPermissionException)2 NoPathPermissionsException (org.apache.hadoop.registry.client.exceptions.NoPathPermissionsException)2 ZKPathDumper (org.apache.hadoop.registry.client.impl.zk.ZKPathDumper)2 ServiceStateException (org.apache.hadoop.service.ServiceStateException)2 ACL (org.apache.zookeeper.data.ACL)2 RegistryOperationsClient (org.apache.hadoop.registry.client.impl.RegistryOperationsClient)1 Id (org.apache.zookeeper.data.Id)1 Before (org.junit.Before)1