Package org.apache.accumulo.core.client.security.tokens

Examples of org.apache.accumulo.core.client.security.tokens.PasswordToken


    gc.confirmDeletes(candidates);
    Assert.assertEquals(expected, candidates.size());
  }
 
  private void load(Instance instance, String[] metadata, String[] deletes) throws Exception {
    TCredentials credential = CredentialHelper.create("root", new PasswordToken(new byte[0]), "instance");
   
    Scanner scanner = instance.getConnector(credential.getPrincipal(), CredentialHelper.extractToken(credential)).createScanner(Constants.METADATA_TABLE_NAME,
        Constants.NO_AUTHS);
    int count = 0;
    for (@SuppressWarnings("unused")
View Full Code Here


      Job job = new Job(getConf(), this.getClass().getSimpleName() + "_" + System.currentTimeMillis());
      job.setJarByClass(this.getClass());

      job.setInputFormatClass(inputFormatClass);

      AccumuloInputFormat.setConnectorInfo(job, user, new PasswordToken(pass));
      AccumuloInputFormat.setInputTableName(job, table);
      AccumuloInputFormat.setMockInstance(job, instanceName);

      job.setMapperClass(TestMapper.class);
      job.setMapOutputKeyClass(Key.class);
View Full Code Here

  @Deprecated
  @Override
  // Not really deprecated, just not for client use
  public Connector getConnector(String user, byte[] pass) throws AccumuloException, AccumuloSecurityException {
    return getConnector(user, new PasswordToken(pass));
  }
View Full Code Here

  }
 
  @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

  }

  @Test
  public void testAggregation() throws Exception {
    MockInstance mockInstance = new MockInstance();
    Connector c = mockInstance.getConnector("root", new PasswordToken(""));
    String table = "perDayCounts";
    c.tableOperations().create(table);
    IteratorSetting is = new IteratorSetting(10, "String Summation", SummingCombiner.class);
    Combiner.setColumns(is, Collections.singletonList(new IteratorSetting.Column("day")));
    SummingCombiner.setEncodingType(is, SummingCombiner.Type.STRING);
View Full Code Here

 
  @Test
  public void testMockConnectorReturnsCorrectInstance() throws AccumuloException, AccumuloSecurityException {
    String name = "an-interesting-instance-name";
    Instance mockInstance = new MockInstance(name);
    assertEquals(mockInstance, mockInstance.getConnector("foo", new PasswordToken("bar")).getInstance());
    assertEquals(name, mockInstance.getConnector("foo", new PasswordToken("bar")).getInstance().getInstanceName());
  }
View Full Code Here

  }

  @Override
  @Deprecated
  public Connector getConnector(String principal, byte[] pass) throws AccumuloException, AccumuloSecurityException {
    return getConnector(principal, new PasswordToken(pass));
  }
View Full Code Here

    if (p == null) {
      shellState.getReader().printNewline();
      return 0;
    } // user canceled
    pass = p.getBytes(Constants.UTF8);
    shellState.updateUser(user, new PasswordToken(pass));
    return 0;
  }
View Full Code Here

    if (p == null) {
      shellState.getReader().printNewline();
      return 0;
    } // user canceled
    final byte[] password = p.getBytes(Constants.UTF8);
    final boolean valid = shellState.getConnector().securityOperations().authenticateUser(user, new PasswordToken(password));
    shellState.getReader().printString((valid ? "V" : "Not v") + "alid\n");
    return 0;
  }
View Full Code Here

          reader.getTerminal().enableEcho();
        }
      });
     
      if (passw != null) {
        this.token = new PasswordToken(passw);
      }
     
      if (this.token == null) {
        passw = readMaskedLine("Password: ", '*');
        if (passw != null)
          this.token = new PasswordToken(passw);
      }
     
      if (this.token == null) {
        reader.printNewline();
        throw new MissingArgumentException("No password or token option supplied");
View Full Code Here

TOP

Related Classes of org.apache.accumulo.core.client.security.tokens.PasswordToken

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.