Examples of Groups


Examples of org.apache.hadoop.security.Groups

  @Test
  public void testGroupLookupForStaticUsers() throws Exception {
    conf.setClass(CommonConfigurationKeys.HADOOP_SECURITY_GROUP_MAPPING,
        FakeunPrivilegedGroupMapping.class, ShellBasedUnixGroupsMapping.class);
    conf.set(CommonConfigurationKeys.HADOOP_USER_GROUP_STATIC_OVERRIDES, "me=;user1=group1;user2=group1,group2");
    Groups groups = new Groups(conf);
    List<String> userGroups = groups.getGroups("me");
    assertTrue("non-empty groups for static user", userGroups.isEmpty());
    assertFalse("group lookup done for static user",
        FakeunPrivilegedGroupMapping.invoked);
   
    List<String> expected = new ArrayList<String>();
    expected.add("group1");

    FakeunPrivilegedGroupMapping.invoked = false;
    userGroups = groups.getGroups("user1");
    assertTrue("groups not correct", expected.equals(userGroups));
    assertFalse("group lookup done for unprivileged user",
        FakeunPrivilegedGroupMapping.invoked);

    expected.add("group2");
    FakeunPrivilegedGroupMapping.invoked = false;
    userGroups = groups.getGroups("user2");
    assertTrue("groups not correct", expected.equals(userGroups));
    assertFalse("group lookup done for unprivileged user",
        FakeunPrivilegedGroupMapping.invoked);

  }
View Full Code Here

Examples of org.apache.hadoop.security.Groups

    }
  }

  @Test
  public void TestGroupsCaching() throws Exception {
    Groups groups = new Groups(conf);
    groups.cacheGroupsAdd(Arrays.asList(myGroups));
    groups.refresh();
    FakeGroupMapping.clearBlackList();
    FakeGroupMapping.addToBlackList("user1");

    // regular entry
    assertTrue(groups.getGroups("me").size() == 2);

    // this must be cached. blacklisting should have no effect.
    FakeGroupMapping.addToBlackList("me");
    assertTrue(groups.getGroups("me").size() == 2);

    // ask for a negative entry
    try {
      LOG.error("We are not supposed to get here." + groups.getGroups("user1").toString());
      fail();
    } catch (IOException ioe) {
      if(!ioe.getMessage().startsWith("No groups found")) {
        LOG.error("Got unexpected exception: " + ioe.getMessage());
        fail();
      }
    }

    // this shouldn't be cached. remove from the black list and retry.
    FakeGroupMapping.clearBlackList();
    assertTrue(groups.getGroups("user1").size() == 2);
  }
View Full Code Here

Examples of org.apache.hadoop.security.Groups

    Configuration conf = new Configuration();
    conf.set(CommonConfigurationKeysPublic.HADOOP_SECURITY_GROUP_MAPPING,
      groupMappingClassName);

    Groups groups = Groups.getUserToGroupsMappingService(conf);

    AccessControlList acl;

    // create these ACLs to populate groups cache
    acl = new AccessControlList("ja my"); // plain
    acl = new AccessControlList("sinatra ratpack,@lasVegas"); // netgroup
    acl = new AccessControlList(" somegroup,@someNetgroup"); // no user

    // this ACL will be used for testing ACLs
    acl = new AccessControlList("carlPerkins ratpack,@lasVegas");
    acl.addGroup("@memphis");

    // validate the netgroups before and after rehresh to make
    // sure refresh works correctly
    validateNetgroups(groups, acl);
    groups.refresh();
    validateNetgroups(groups, acl);

  }
View Full Code Here

Examples of org.gwtoolbox.bean.client.validation.config.Groups

    private String messagesClassHolderClassName;

    public void addConfiguration(JClassType configClass) {
        if (configClass.isAnnotationPresent(Groups.class)) {
            Groups groupClasses = configClass.getAnnotation(Groups.class);
            for (Class group : groupClasses.value()) {
                Set<Class> groupSet = new HashSet<Class>(Arrays.asList(group.getInterfaces()));
                groupSetBySuperGroup.put(group, groupSet);
            }
        }
    }
View Full Code Here

Examples of zendeskapi.requests.Groups

    accountsAndActivity = new AccountsAndActivity(yourZendeskUrl, user, password);
    attachments = new Attachments(yourZendeskUrl, user, password);
    categories = new Categories(yourZendeskUrl, user, password);
    customAgentRoles = new CustomAgentRoles(yourZendeskUrl, user, password);
    forums = new Forums(yourZendeskUrl, user, password);
    groups = new Groups(yourZendeskUrl, user, password);
    jobStatuses = new JobStatuses(yourZendeskUrl, user, password);
    locales = new Locales(yourZendeskUrl, user, password);
    macros = new Macros(yourZendeskUrl, user, password);
    organizations = new Organizations(yourZendeskUrl, user, password);
    requests = new Requests(yourZendeskUrl, user, password);
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.