Examples of securityOperations()


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

  }
 
  @Test
  public void testChangeAuths() throws Exception {
    Connector c = new MockConnector("root", new MockInstance());
    c.securityOperations().createLocalUser("greg", new PasswordToken(new byte[0]));
    assertTrue(c.securityOperations().getUserAuthorizations("greg").isEmpty());
    c.securityOperations().changeUserAuthorizations("greg", new Authorizations("A".getBytes()));
    assertTrue(c.securityOperations().getUserAuthorizations("greg").contains("A".getBytes()));
    c.securityOperations().changeUserAuthorizations("greg", new Authorizations("X", "Y", "Z"));
    assertTrue(c.securityOperations().getUserAuthorizations("greg").contains("X".getBytes()));
View Full Code Here

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

 
  @Test
  public void testChangeAuths() throws Exception {
    Connector c = new MockConnector("root", new MockInstance());
    c.securityOperations().createLocalUser("greg", new PasswordToken(new byte[0]));
    assertTrue(c.securityOperations().getUserAuthorizations("greg").isEmpty());
    c.securityOperations().changeUserAuthorizations("greg", new Authorizations("A".getBytes()));
    assertTrue(c.securityOperations().getUserAuthorizations("greg").contains("A".getBytes()));
    c.securityOperations().changeUserAuthorizations("greg", new Authorizations("X", "Y", "Z"));
    assertTrue(c.securityOperations().getUserAuthorizations("greg").contains("X".getBytes()));
    assertFalse(c.securityOperations().getUserAuthorizations("greg").contains("A".getBytes()));
View Full Code Here

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

  @Test
  public void testChangeAuths() throws Exception {
    Connector c = new MockConnector("root", new MockInstance());
    c.securityOperations().createLocalUser("greg", new PasswordToken(new byte[0]));
    assertTrue(c.securityOperations().getUserAuthorizations("greg").isEmpty());
    c.securityOperations().changeUserAuthorizations("greg", new Authorizations("A".getBytes()));
    assertTrue(c.securityOperations().getUserAuthorizations("greg").contains("A".getBytes()));
    c.securityOperations().changeUserAuthorizations("greg", new Authorizations("X", "Y", "Z"));
    assertTrue(c.securityOperations().getUserAuthorizations("greg").contains("X".getBytes()));
    assertFalse(c.securityOperations().getUserAuthorizations("greg").contains("A".getBytes()));
  }
View Full Code Here

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

  public void testChangeAuths() throws Exception {
    Connector c = new MockConnector("root", new MockInstance());
    c.securityOperations().createLocalUser("greg", new PasswordToken(new byte[0]));
    assertTrue(c.securityOperations().getUserAuthorizations("greg").isEmpty());
    c.securityOperations().changeUserAuthorizations("greg", new Authorizations("A".getBytes()));
    assertTrue(c.securityOperations().getUserAuthorizations("greg").contains("A".getBytes()));
    c.securityOperations().changeUserAuthorizations("greg", new Authorizations("X", "Y", "Z"));
    assertTrue(c.securityOperations().getUserAuthorizations("greg").contains("X".getBytes()));
    assertFalse(c.securityOperations().getUserAuthorizations("greg").contains("A".getBytes()));
  }
 
View Full Code Here

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

    Connector c = new MockConnector("root", new MockInstance());
    c.securityOperations().createLocalUser("greg", new PasswordToken(new byte[0]));
    assertTrue(c.securityOperations().getUserAuthorizations("greg").isEmpty());
    c.securityOperations().changeUserAuthorizations("greg", new Authorizations("A".getBytes()));
    assertTrue(c.securityOperations().getUserAuthorizations("greg").contains("A".getBytes()));
    c.securityOperations().changeUserAuthorizations("greg", new Authorizations("X", "Y", "Z"));
    assertTrue(c.securityOperations().getUserAuthorizations("greg").contains("X".getBytes()));
    assertFalse(c.securityOperations().getUserAuthorizations("greg").contains("A".getBytes()));
  }
 
  @Test
View Full Code Here

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

    c.securityOperations().createLocalUser("greg", new PasswordToken(new byte[0]));
    assertTrue(c.securityOperations().getUserAuthorizations("greg").isEmpty());
    c.securityOperations().changeUserAuthorizations("greg", new Authorizations("A".getBytes()));
    assertTrue(c.securityOperations().getUserAuthorizations("greg").contains("A".getBytes()));
    c.securityOperations().changeUserAuthorizations("greg", new Authorizations("X", "Y", "Z"));
    assertTrue(c.securityOperations().getUserAuthorizations("greg").contains("X".getBytes()));
    assertFalse(c.securityOperations().getUserAuthorizations("greg").contains("A".getBytes()));
  }
 
  @Test
  public void testBadMutations() throws Exception {
View Full Code Here

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

    assertTrue(c.securityOperations().getUserAuthorizations("greg").isEmpty());
    c.securityOperations().changeUserAuthorizations("greg", new Authorizations("A".getBytes()));
    assertTrue(c.securityOperations().getUserAuthorizations("greg").contains("A".getBytes()));
    c.securityOperations().changeUserAuthorizations("greg", new Authorizations("X", "Y", "Z"));
    assertTrue(c.securityOperations().getUserAuthorizations("greg").contains("X".getBytes()));
    assertFalse(c.securityOperations().getUserAuthorizations("greg").contains("A".getBytes()));
  }
 
  @Test
  public void testBadMutations() throws Exception {
    Connector c = new MockConnector("root", new MockInstance());
View Full Code Here

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

    if (!isConnectorInfoSet(job))
      throw new IOException("Connector info has not been set.");
    try {
      // if the instance isn't configured, it will complain here
      Connector c = getInstance(job).getConnector(getPrincipal(job), CredentialHelper.extractToken(getTokenClass(job), getToken(job)));
      if (!c.securityOperations().authenticateUser(getPrincipal(job), CredentialHelper.extractToken(getTokenClass(job), getToken(job))))
        throw new IOException("Unable to authenticate user");
    } catch (AccumuloException e) {
      throw new IOException(e);
    } catch (AccumuloSecurityException e) {
      throw new IOException(e);
View Full Code Here

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

      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.securityOperations()

     
      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
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.