Examples of whoami()


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

      else
        return;
    }
    SecurityHelper.setTableExists(state, true);
    for (TablePermission tp : TablePermission.values())
      SecurityHelper.setTabPerm(state, conn.whoami(), tp, true);
    if (!hasPermission)
      throw new AccumuloException("Didn't get Security Exception when we should have");
  }
}
View Full Code Here

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

    // toggle
    if (!"take".equals(action) && !"give".equals(action)) {
      try {
        boolean res;
        if (hasPerm != (res = state.getConnector().securityOperations().hasTablePermission(target, SecurityHelper.getTableName(state), tabPerm)))
          throw new AccumuloException("Test framework and accumulo are out of sync for user " + conn.whoami() + " for perm " + tabPerm.name()
              + " with local vs. accumulo being " + hasPerm + " " + res);
       
        if (hasPerm)
          action = "take";
        else
View Full Code Here

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

              throw new AccumuloException("Framework and Accumulo are out of sync, we think user exists", ae);
            else
              return;
          case TABLE_DOESNT_EXIST:
            if (tabExists)
              throw new AccumuloException(conn.whoami(), ae);
            else
              return;
          default:
            throw ae;
        }
View Full Code Here

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

            seen++;
            if (!auths.contains(k.getColumnVisibilityData()))
              throw new AccumuloException("Got data I should not be capable of seeing: " + k + " table " + tableName);
          }
          if (!canRead)
            throw new AccumuloException("Was able to read when I shouldn't have had the perm with connection user " + conn.whoami() + " table " + tableName);
          for (Entry<String,Integer> entry : SecurityHelper.getAuthsMap(state).entrySet()) {
            if (auths.contains(entry.getKey().getBytes()))
              seen = seen - entry.getValue();
          }
          if (seen != 0)
View Full Code Here

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

    conn.tableOperations().create(TABLE);
    update(conn, TABLE, new Text("row"), new Text("cf"), new Text("cq"), new Value("value".getBytes()));
    Entry<Key, Value> logRef = getLogRef(conn, MetadataTable.NAME);
    conn.tableOperations().flush(TABLE, null, null, true);
    assertEquals("should not have any refs", 0, FunctionalTestUtils.count(getLogRefs(conn, MetadataTable.NAME)));
    conn.securityOperations().grantTablePermission(conn.whoami(), MetadataTable.NAME, TablePermission.WRITE);
    update(conn, MetadataTable.NAME, logRef);
    assertTrue(equals(logRef, getLogRef(conn, MetadataTable.NAME)));
    conn.tableOperations().flush(MetadataTable.NAME, null, null, true);
    conn.tableOperations().flush(RootTable.NAME, null, null, true);
    for (ProcessReference proc : cluster.getProcesses().get(ServerType.TABLET_SERVER)) {
View Full Code Here

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

    String testUser = makeUserName();
    PasswordToken testPasswd = new PasswordToken("test_password");

    // verify that the test is being run by root
    Connector c = getConnector();
    verifyHasOnlyTheseSystemPermissions(c, c.whoami(), SystemPermission.values());

    // create the test user
    c.securityOperations().createLocalUser(testUser, testPasswd);
    Connector test_user_conn = c.getInstance().getConnector(testUser, testPasswd);
    verifyHasNoSystemPermissions(c, testUser, SystemPermission.values());
View Full Code Here

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

      Text endText = ByteBufferUtil.toText(endRow);
      Authorizations auth;
      if (auths != null) {
        auth = getAuthorizations(auths);
      } else {
        auth = connector.securityOperations().getUserAuthorizations(connector.whoami());
      }
      Text max = connector.tableOperations().getMaxRow(tableName, auth, startText, startInclusive, endText, endInclusive);
      return TextUtil.getByteBuffer(max);
    } catch (Exception e) {
      handleExceptionTNF(e);
View Full Code Here

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

     
      Authorizations auth;
      if (opts != null && opts.isSetAuthorizations()) {
        auth = getAuthorizations(opts.authorizations);
      } else {
        auth = connector.securityOperations().getUserAuthorizations(connector.whoami());
      }
      Scanner scanner = connector.createScanner(tableName, auth);
     
      if (opts != null) {
        if (opts.iterators != null) {
View Full Code Here

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

      int threads = 10;
      Authorizations auth;
      if (opts != null && opts.isSetAuthorizations()) {
        auth = getAuthorizations(opts.authorizations);
      } else {
        auth = connector.securityOperations().getUserAuthorizations(connector.whoami());
      }
      if (opts != null && opts.threads > 0)
        threads = opts.threads;
     
      BatchScanner scanner = connector.createBatchScanner(tableName, auth, threads);
View Full Code Here

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

        case USER_DOESNT_EXIST:
          if (targetExists)
            throw new AccumuloException("User " + target + " doesn't exist and they SHOULD.", ae);
          return;
        case BAD_CREDENTIALS:
          if (!WalkingSecurity.get(state).userPassTransient(conn.whoami()))
            throw new AccumuloException("Bad credentials for user " + conn.whoami());
          return;
        default:
          throw new AccumuloException("Got unexpected exception", ae);
      }
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.