Package org.apache.hadoop.hbase.stargate

Examples of org.apache.hadoop.hbase.stargate.User


  @Path("{token: [0-9a-fA-F]{32} }") // 128 bit md5 sums
  public Response getTableRootResource(
      final @PathParam("token") String token) throws IOException {
    if (servlet.isMultiUser()) {
      User user = auth(token);
      if (!servlet.userRequestLimit(user, 1)) {
        return Response.status(509).build();
      }
      try {
        ResponseBuilder response = Response.ok(getTableListForUser(user));
View Full Code Here


  @Path("{token: [0-9a-fA-F]{32} }/status/cluster") // 128 bit md5 sums
  public StorageClusterStatusResource getClusterStatusResourceAuthorized(
      final @PathParam("token") String token) throws IOException {
    if (servlet.isMultiUser()) {
      User user = auth(token);
      if (user != null && user.isAdmin()) {
        return new StorageClusterStatusResource(user);
      }
      throw new WebApplicationException(Response.Status.FORBIDDEN);
    }
    throw new WebApplicationException(Response.Status.BAD_REQUEST);
View Full Code Here

  @Path("{token: [0-9a-fA-F]{32} }/{table}")
  public TableResource getTableResource(
      final @PathParam("token") String token,
      final @PathParam("table") String table) throws IOException {
    if (servlet.isMultiUser()) {
      User user = auth(token);
      return new TableResource(user, table);
    }
    throw new WebApplicationException(Response.Status.BAD_REQUEST);
  }
View Full Code Here

    conf.set("stargate.auth.user." + DISABLED_USERNAME + ".disabled", "true");
    authenticator = new HBCAuthenticator(conf);
  }

  public void testGetUserUnknown() throws Exception {
    User user = authenticator.getUserForToken(UNKNOWN_TOKEN);
    assertNull(user);
  }
View Full Code Here

    User user = authenticator.getUserForToken(UNKNOWN_TOKEN);
    assertNull(user);
  }

  public void testGetAdminUser() throws Exception {
    User user = authenticator.getUserForToken(ADMIN_TOKEN);
    assertNotNull(user);
    assertEquals(user.getName(), ADMIN_USERNAME);
    assertTrue(user.isAdmin());
    assertFalse(user.isDisabled());
  }
View Full Code Here

    assertTrue(user.isAdmin());
    assertFalse(user.isDisabled());
  }

  public void testGetPlainUser() throws Exception {
    User user = authenticator.getUserForToken(USER_TOKEN);
    assertNotNull(user);
    assertEquals(user.getName(), USER_USERNAME);
    assertFalse(user.isAdmin());
    assertFalse(user.isDisabled());
  }
View Full Code Here

    assertFalse(user.isAdmin());
    assertFalse(user.isDisabled());
  }

  public void testGetDisabledUser() throws Exception {
    User user = authenticator.getUserForToken(DISABLED_TOKEN);
    assertNotNull(user);
    assertEquals(user.getName(), DISABLED_USERNAME);
    assertFalse(user.isAdmin());
    assertTrue(user.isDisabled());
  }
View Full Code Here

        os.toByteArray(), Ids.OPEN_ACL_UNSAFE, CreateMode.PERSISTENT);
    }
  }

  public void testGetUserUnknown() throws Exception {
    User user = authenticator.getUserForToken(UNKNOWN_TOKEN);
    assertNull(user);
  }
View Full Code Here

    User user = authenticator.getUserForToken(UNKNOWN_TOKEN);
    assertNull(user);
  }

  public void testGetAdminUser() throws Exception {
    User user = authenticator.getUserForToken(ADMIN_TOKEN);
    assertNotNull(user);
    assertEquals(user.getName(), ADMIN_USERNAME);
    assertTrue(user.isAdmin());
    assertFalse(user.isDisabled());
  }
View Full Code Here

    assertTrue(user.isAdmin());
    assertFalse(user.isDisabled());
  }

  public void testGetPlainUser() throws Exception {
    User user = authenticator.getUserForToken(USER_TOKEN);
    assertNotNull(user);
    assertEquals(user.getName(), USER_USERNAME);
    assertFalse(user.isAdmin());
    assertFalse(user.isDisabled());
  }
View Full Code Here

TOP

Related Classes of org.apache.hadoop.hbase.stargate.User

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.