Package org.apache.sentry.core

Examples of org.apache.sentry.core.AccessURI


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


  public void testValidateCreateFunctionAppropiateURI() throws Exception {
    inputTabHierarcyList.add(Arrays.asList(new Authorizable[] {
        new Server(SERVER1), new Database(CUSTOMER_DB), new Table(AccessConstants.ALL)
    }));
    inputTabHierarcyList.add(Arrays.asList(new Authorizable[] {
        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

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

          } else {
            uri = "hdfs://" + uri;
          }
        }
      }
      return new AccessURI(uri);
    }
    return new AccessURI(uri);
  }
View Full Code Here

public class TestURI {

  @Test(expected=IllegalArgumentException.class)
  public void testBadUriEmpty() {
    new AccessURI("");
  }
View Full Code Here

  public void testBadUriEmpty() {
    new AccessURI("");
  }
  @Test(expected=IllegalArgumentException.class)
  public void testBadUriNull() {
    new AccessURI(null);
  }
View Full Code Here

  public void testBadUriNull() {
    new AccessURI(null);
  }
  @Test(expected=IllegalArgumentException.class)
  public void testBadUriNoFilePrefix() {
    new AccessURI("/");
  }
View Full Code Here

  public void testBadUriNoFilePrefix() {
    new AccessURI("/");
  }
  @Test(expected=IllegalArgumentException.class)
  public void testBadUriIncorrectFilePrefix() {
    new AccessURI("file:/some/path");
  }
View Full Code Here

  public void testBadUriIncorrectFilePrefix() {
    new AccessURI("file:/some/path");
  }
  @Test(expected=IllegalArgumentException.class)
  public void testBadUriIncorrectHdfsPrefix() {
    new AccessURI("hdfs:/some/path");
  }
View Full Code Here

    case Table:
      return new Table(name);
    case View:
      return new View(name);
    case URI:
      return new AccessURI(name);
    default:
      return null;
    }
  }
View Full Code Here

TOP

Related Classes of org.apache.sentry.core.AccessURI

Copyright © 2018 www.massapicom. 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.