Examples of AccessURI


Examples of org.apache.sentry.core.model.db.AccessURI

  public void testValidateCreateFunctionAppropiateURI() throws Exception {
    inputTabHierarcyList.add(Arrays.asList(new DBModelAuthorizable[] {
        new Server(SERVER1), new Database(CUSTOMER_DB), new Table(AccessConstants.ALL)
    }));
    inputTabHierarcyList.add(Arrays.asList(new DBModelAuthorizable[] {
        new Server(SERVER1), new AccessURI("file:///path/to/some/lib/dir/my.jar")
    }));
    testAuth.authorize(HiveOperation.CREATEFUNCTION, createFuncPrivileges, ANALYST_SUBJECT,
        inputTabHierarcyList, outputTabHierarcyList);
  }
View Full Code Here

Examples of org.apache.sentry.core.model.db.AccessURI

  public void testValidateCreateFunctionRejectionForUserWithoutURI() throws Exception {
    inputTabHierarcyList.add(Arrays.asList(new DBModelAuthorizable[] {
        new Server(SERVER1), new Database(CUSTOMER_DB), new Table(AccessConstants.ALL)
    }));
    inputTabHierarcyList.add(Arrays.asList(new DBModelAuthorizable[] {
        new Server(SERVER1), new AccessURI("file:///some/path/to/a.jar")
    }));
    testAuth.authorize(HiveOperation.CREATEFUNCTION, createFuncPrivileges, ANALYST_SUBJECT,
        inputTabHierarcyList, outputTabHierarcyList);
  }
View Full Code Here

Examples of org.apache.sentry.core.model.db.AccessURI

  protected static AccessURI parseURI(String uri, boolean isLocal)
      throws SemanticException {
    try {
      HiveConf conf = SessionState.get().getConf();
      String warehouseDir = conf.getVar(ConfVars.METASTOREWAREHOUSE);
      return new AccessURI(PathUtils.parseDFSURI(warehouseDir, uri, isLocal));
    } catch (Exception e) {
      throw new SemanticException("Error parsing URI " + uri + ": " +
        e.getMessage(), e);
    }
  }
View Full Code Here

Examples of org.apache.sentry.core.model.db.AccessURI

   */
  @Test
  public void testValidateCreateFunctionForAdmin() throws Exception {
    inputTabHierarcyList.add(buildObjectHierarchy(SERVER1, CUSTOMER_DB, PURCHASES_TAB));
    inputTabHierarcyList.add(Arrays.asList(new DBModelAuthorizable[] {
        new Server(SERVER1), new AccessURI("file:///some/path/to/a/jar")
    }));
    testAuth.authorize(HiveOperation.CREATEFUNCTION, createFuncPrivileges, ADMIN_SUBJECT,
        inputTabHierarcyList, outputTabHierarcyList);
  }
View Full Code Here

Examples of org.apache.sentry.core.model.db.AccessURI

  public void testValidateCreateFunctionAppropiateURI() throws Exception {
    inputTabHierarcyList.add(Arrays.asList(new DBModelAuthorizable[] {
        new Server(SERVER1), new Database(CUSTOMER_DB), new Table(AccessConstants.ALL)
    }));
    inputTabHierarcyList.add(Arrays.asList(new DBModelAuthorizable[] {
        new Server(SERVER1), new AccessURI("file:///path/to/some/lib/dir/my.jar")
    }));
    testAuth.authorize(HiveOperation.CREATEFUNCTION, createFuncPrivileges, ANALYST_SUBJECT,
        inputTabHierarcyList, outputTabHierarcyList);
  }
View Full Code Here

Examples of org.apache.sentry.core.model.db.AccessURI

  public void testValidateCreateFunctionRejectionForUserWithoutURI() throws Exception {
    inputTabHierarcyList.add(Arrays.asList(new DBModelAuthorizable[] {
        new Server(SERVER1), new Database(CUSTOMER_DB), new Table(AccessConstants.ALL)
    }));
    inputTabHierarcyList.add(Arrays.asList(new DBModelAuthorizable[] {
        new Server(SERVER1), new AccessURI("file:///some/path/to/a.jar")
    }));
    testAuth.authorize(HiveOperation.CREATEFUNCTION, createFuncPrivileges, ANALYST_SUBJECT,
        inputTabHierarcyList, outputTabHierarcyList);
  }
View Full Code Here

Examples of org.apache.sentry.core.model.db.AccessURI

  @Test
  public void testAddPartition() throws Exception {
    ASTNode ast = parse("alter table parted add partition (day='Monday')");
    LOG.info("AST: " + ast.toStringTree());
    AccessURI partitionLocation = HiveAuthzBindingHook.extractPartition(ast);
    Assert.assertNull("Query without part location should not return location",
        partitionLocation);
  }
View Full Code Here

Examples of org.apache.sentry.core.model.db.AccessURI

  }
  @Test
  public void testAddPartitionWithLocation() throws Exception {
    ASTNode ast = parse("alter table parted add partition (day='Monday') location 'file:/'");
    LOG.info("AST: " + ast.toStringTree());
    AccessURI partitionLocation = HiveAuthzBindingHook.extractPartition(ast);
    Assert.assertNotNull("Query with part location must return location",
        partitionLocation);
    Assert.assertEquals("file:///", partitionLocation.getName());
  }
View Full Code Here

Examples of org.apache.sentry.core.model.db.AccessURI

  @Test
  public void testAddPartitionIfNotExists() throws Exception {
    ASTNode ast = parse("alter table parted add if not exists partition (day='Monday')");
    LOG.info("AST: " + ast.toStringTree());
    AccessURI partitionLocation = HiveAuthzBindingHook.extractPartition(ast);
    Assert.assertNull("Query without part location should not return location",
        partitionLocation);
  }
View Full Code Here

Examples of org.apache.sentry.core.model.db.AccessURI

  @Test
  public void testAddPartitionIfNotExistsWithLocation() throws Exception {
    ASTNode ast = parse("alter table parted add if not exists partition (day='Monday')" +
        " location 'file:/'");
    LOG.info("AST: " + ast.toStringTree());
    AccessURI partitionLocation = HiveAuthzBindingHook.extractPartition(ast);
    Assert.assertNotNull("Query with part location must return location",
        partitionLocation);
    Assert.assertEquals("file:///", partitionLocation.getName());
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.