Examples of GroupPrincipal


Examples of org.apache.activemq.jaas.GroupPrincipal

* @version $Rev: $ $Date: $
*/
public class GroupPrincipalTest extends TestCase {

    public void testArguments() {
        GroupPrincipal principal = new GroupPrincipal("FOO");

       assertEquals("FOO", principal.getName());

        try {
            new GroupPrincipal(null);
            fail("Should have thrown IllegalArgumentException");
        } catch (IllegalArgumentException ingore) {

        }
    }
View Full Code Here

Examples of org.apache.activemq.jaas.GroupPrincipal

        }
    }

    public void testHash() {
        GroupPrincipal p1 = new GroupPrincipal("FOO");
        GroupPrincipal p2 = new GroupPrincipal("FOO");

        assertEquals(p1.hashCode(), p1.hashCode());
        assertEquals(p1.hashCode(), p2.hashCode());
    }
View Full Code Here

Examples of org.apache.activemq.jaas.GroupPrincipal

        assertEquals(p1.hashCode(), p1.hashCode());
        assertEquals(p1.hashCode(), p2.hashCode());
    }

    public void testEquals() {
        GroupPrincipal p1 = new GroupPrincipal("FOO");
        GroupPrincipal p2 = new GroupPrincipal("FOO");
        GroupPrincipal p3 = new GroupPrincipal("BAR");

        assertTrue(p1.equals(p1));
        assertTrue(p1.equals(p2));
        assertFalse(p1.equals(null));
        assertFalse(p1.equals("FOO"));
View Full Code Here

Examples of org.apache.hadoop.gateway.security.GroupPrincipal

  private void addMappedGroupsToSubject(String mappedPrincipalName, Subject subject) {
    String[] groups = mapper.mapGroupPrincipal(mappedPrincipalName);
    if (groups != null) {
      auditor.audit( Action.IDENTITY_MAPPING, mappedPrincipalName, ResourceType.PRINCIPAL, ActionOutcome.SUCCESS, RES.groupsList( Arrays.toString( groups ) ) );
      for (int i = 0; i < groups.length; i++) {
        subject.getPrincipals().add(new GroupPrincipal(groups[i]));
      }
    }
  }
View Full Code Here

Examples of org.apache.jetspeed.security.GroupPrincipal

    /**
     * @see org.apache.jetspeed.security.spi.GroupSecurityHandler#getGroupPrincipal(java.lang.String)
     */
    public Principal getGroupPrincipal(String groupFullPathName)
    {
        GroupPrincipal groupPrincipal = null;
        InternalGroupPrincipal internalGroup = commonQueries
                .getInternalGroupPrincipal(GroupPrincipalImpl
                        .getFullPathFromPrincipalName(groupFullPathName));
        if (null != internalGroup)
        {
View Full Code Here

Examples of org.apache.jetspeed.security.GroupPrincipal

        // Check if group already exists.
        if (groupExists(groupFullPathName)) { 
            throw new SecurityException(SecurityException.GROUP_ALREADY_EXISTS.create(groupFullPathName));
        }

        GroupPrincipal groupPrincipal = new GroupPrincipalImpl(
                groupFullPathName);
        String fullPath = groupPrincipal.getFullPath();
        // Add the preferences.
        Preferences preferences = Preferences.userRoot().node(fullPath);
        if (log.isDebugEnabled())
        {
            log.debug("Added group preferences node: " + fullPath);
View Full Code Here

Examples of org.apache.karaf.jaas.boot.principal.GroupPrincipal

                }
            }
            assertEquals(1, engine.listGroups(upa).size());
            assertEquals(2, engine.listGroups(upb).size());

            GroupPrincipal gp = engine.listGroups(upa).iterator().next();
            engine.deleteGroupRole("g", "role2");
            assertEquals(1, engine.listRoles(gp).size());
            assertEquals("role3", engine.listRoles(gp).iterator().next().getName());

            // check that the user roles are reported correctly
View Full Code Here

Examples of org.apache.karaf.jaas.boot.principal.GroupPrincipal

        principals = new HashSet<Principal>();
        principals.add(new UserPrincipal(user));
        for (int i = 1; i < infos.length; i++) {
            if (infos[i].startsWith(PropertiesBackingEngine.GROUP_PREFIX)) {
                // it's a group reference
                principals.add(new GroupPrincipal(infos[i].substring(PropertiesBackingEngine.GROUP_PREFIX.length())));
                String groupInfo = (String) users.get(infos[i]);
                if (groupInfo != null) {
                    String[] roles = groupInfo.split(",");
                    for (int j = 1; j < roles.length; j++) {
                        principals.add(new RolePrincipal(roles[j]));
View Full Code Here

Examples of org.apache.karaf.jaas.boot.principal.GroupPrincipal

        if (userInfo != null) {
            String[] infos = userInfo.split(",");
            for (int i = 1; i < infos.length; i++) {
                String name = infos[i];
                if (name.startsWith(GROUP_PREFIX)) {
                    result.add(new GroupPrincipal(name.substring(GROUP_PREFIX.length())));
                }
            }
        }
        return result;
    }
View Full Code Here

Examples of org.apache.karaf.jaas.boot.principal.GroupPrincipal

        principals = new HashSet<Principal>();
        principals.add(new UserPrincipal(user));
        for (int i = 1; i < infos.length; i++) {
            if (infos[i].startsWith(PropertiesBackingEngine.GROUP_PREFIX)) {
                // it's a group reference
                principals.add(new GroupPrincipal(infos[i].substring(PropertiesBackingEngine.GROUP_PREFIX.length())));
                String groupInfo = (String) users.get(infos[i]);
                if (groupInfo != null) {
                    String[] roles = groupInfo.split(",");
                    for (int j = 1; j < roles.length; j++) {
                        principals.add(new RolePrincipal(roles[j]));
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.