Examples of securityOperations()


Examples of org.apache.accumulo.core.client.Connector.securityOperations()

   
    if (WalkingSecurity.get(state).userExists(WalkingSecurity.get(state).getTabUserName())) {
      String tableUserName = WalkingSecurity.get(state).getTabUserName();
      log.debug("Dropping user: " + tableUserName);
     
      conn.securityOperations().dropLocalUser(tableUserName);
    }
    String systemUserName = WalkingSecurity.get(state).getSysUserName();
    log.debug("Dropping user: " + systemUserName);
    conn.securityOperations().dropLocalUser(systemUserName);
    WalkingSecurity.clearInstance();
View Full Code Here

Examples of org.apache.accumulo.core.client.Connector.securityOperations()

     
      conn.securityOperations().dropLocalUser(tableUserName);
    }
    String systemUserName = WalkingSecurity.get(state).getSysUserName();
    log.debug("Dropping user: " + systemUserName);
    conn.securityOperations().dropLocalUser(systemUserName);
    WalkingSecurity.clearInstance();
   
    // Allow user drops to propagate, in case a new security test starts
    Thread.sleep(2000);
  }
View Full Code Here

Examples of org.apache.accumulo.core.client.Connector.securityOperations()

    boolean cloudTableExists = conn.tableOperations().list().contains(WalkingSecurity.get(state).getTableName());
    if (tableExists != cloudTableExists)
      throw new AccumuloException("Table existance out of sync");
   
    boolean tableUserExists = WalkingSecurity.get(state).userExists(WalkingSecurity.get(state).getTabUserName());
    boolean cloudTableUserExists = conn.securityOperations().listLocalUsers().contains(WalkingSecurity.get(state).getTabUserName());
    if (tableUserExists != cloudTableUserExists)
      throw new AccumuloException("Table User existance out of sync");
   
    Properties props = new Properties();
    props.setProperty("target", "system");
View Full Code Here

Examples of org.apache.accumulo.core.client.Connector.securityOperations()

    for (String user : new String[] {WalkingSecurity.get(state).getSysUserName(), WalkingSecurity.get(state).getTabUserName()}) {
      for (SystemPermission sp : SystemPermission.values()) {
        boolean hasSp = WalkingSecurity.get(state).hasSystemPermission(user, sp);
        boolean accuHasSp;
        try {
          accuHasSp = conn.securityOperations().hasSystemPermission(user, sp);
          log.debug("Just checked to see if user " + user + " has system perm " + sp.name() + " with answer " + accuHasSp);
        } catch (AccumuloSecurityException ae) {
          if (ae.getSecurityErrorCode().equals(SecurityErrorCode.USER_DOESNT_EXIST)) {
            if (tableUserExists)
              throw new AccumuloException("Got user DNE error when they should", ae);
View Full Code Here

Examples of org.apache.accumulo.core.client.Connector.securityOperations()

     
      for (TablePermission tp : TablePermission.values()) {
        boolean hasTp = WalkingSecurity.get(state).hasTablePermission(user, WalkingSecurity.get(state).getTableName(), tp);
        boolean accuHasTp;
        try {
          accuHasTp = conn.securityOperations().hasTablePermission(user, WalkingSecurity.get(state).getTableName(), tp);
          log.debug("Just checked to see if user " + user + " has table perm " + tp.name() + " with answer " + accuHasTp);
        } catch (AccumuloSecurityException ae) {
          if (ae.getSecurityErrorCode().equals(SecurityErrorCode.USER_DOESNT_EXIST)) {
            if (tableUserExists)
              throw new AccumuloException("Got user DNE error when they should", ae);
View Full Code Here

Examples of org.apache.accumulo.core.client.Connector.securityOperations()

   
    Authorizations accuAuths;
    Authorizations auths;
    try {
      auths = WalkingSecurity.get(state).getUserAuthorizations(WalkingSecurity.get(state).getTabCredentials());
      accuAuths = conn.securityOperations().getUserAuthorizations(WalkingSecurity.get(state).getTabUserName());
    } catch (ThriftSecurityException ae) {
      if (ae.getCode() == org.apache.accumulo.core.client.impl.thrift.SecurityErrorCode.USER_DOESNT_EXIST) {
        if (tableUserExists)
          throw new AccumuloException("Table user didn't exist when they should.", ae);
        else
View Full Code Here

Examples of org.apache.accumulo.core.client.Connector.securityOperations()

   
    boolean exists = WalkingSecurity.get(state).userExists(tableUserName);
    boolean hasPermission = WalkingSecurity.get(state).canCreateUser(WalkingSecurity.get(state).getSysCredentials(), tableUserName);
    PasswordToken tabUserPass = new PasswordToken("Super Sekret Table User Password");
    try {
      conn.securityOperations().createLocalUser(tableUserName, tabUserPass);
    } catch (AccumuloSecurityException ae) {
      switch (ae.getSecurityErrorCode()) {
        case PERMISSION_DENIED:
          if (hasPermission)
            throw new AccumuloException("Got a security exception when I should have had permission.", ae);
View Full Code Here

Examples of org.apache.accumulo.core.client.Connector.securityOperations()

   
    boolean exists = WalkingSecurity.get(state).userExists(tableUserName);
    boolean hasPermission = WalkingSecurity.get(state).canDropUser(WalkingSecurity.get(state).getSysCredentials(), tableUserName);
   
    try {
      conn.securityOperations().dropLocalUser(tableUserName);
    } catch (AccumuloSecurityException ae) {
      switch (ae.getSecurityErrorCode()) {
        case PERMISSION_DENIED:
          if (hasPermission)
            throw new AccumuloException("Got a security exception when I should have had permission.", ae);
View Full Code Here

Examples of org.apache.accumulo.core.client.Connector.securityOperations()

        boolean ambiguousZone = WalkingSecurity.get(state).inAmbiguousZone(conn.whoami(), tp);
        boolean ambiguousAuths = WalkingSecurity.get(state).ambiguousAuthorizations(conn.whoami());
       
        Scanner scan = null;
        try {
          scan = conn.createScanner(tableName, conn.securityOperations().getUserAuthorizations(conn.whoami()));
          int seen = 0;
          Iterator<Entry<Key,Value>> iter = scan.iterator();
          while (iter.hasNext()) {
            Entry<Key,Value> entry = iter.next();
            Key k = entry.getKey();
View Full Code Here

Examples of org.apache.accumulo.core.client.Connector.securityOperations()

      throw new IOException("Instance info has not been set.");
    // validate that we can connect as configured
    try {
      Connector c = getInstance(implementingClass, conf).getConnector(getPrincipal(implementingClass, conf),
          CredentialHelper.extractToken(getTokenClass(implementingClass, conf), getToken(implementingClass, conf)));
      if (!c.securityOperations().authenticateUser(getPrincipal(implementingClass, conf),
          CredentialHelper.extractToken(getTokenClass(implementingClass, conf), getToken(implementingClass, conf))))
        throw new IOException("Unable to authenticate user");
      if (!c.securityOperations().hasTablePermission(getPrincipal(implementingClass, conf), getInputTableName(implementingClass, conf), TablePermission.READ))
        throw new IOException("Unable to access table");
     
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.