|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.ObjectTestCase
org.apache.directory.server.core.unit.AbstractTestCase
org.apache.directory.server.core.authz.AbstractAuthorizationITest
public abstract class AbstractAuthorizationITest
A base class used for authorization tests. It has some extra utility methods added to it which are required by all authorization tests. Note that we use the admin test case otherwise failures will result without browse permission when setting up the test case for non-admin users. Anyway we do not use the context created for the non-admin user since it is anonymous, we get our own contexts.
| Field Summary |
|---|
| Fields inherited from class org.apache.directory.server.core.unit.AbstractTestCase |
|---|
configuration, doDelete, LDIF, password, sysRoot, testEntries, username |
| Constructor Summary | |
|---|---|
AbstractAuthorizationITest()
Creates an abstract authorization test case which enables the authorization subsystem of the server. |
|
| Method Summary | |
|---|---|
void |
addEntryACI(javax.naming.Name rdn,
java.lang.String aciItem)
Adds and entryACI attribute to an entry specified by a relative name with respect to ou=system |
void |
addSubentryACI(java.lang.String aciItem)
Adds and subentryACI attribute to ou=system |
void |
addUserToGroup(java.lang.String userUid,
java.lang.String groupCn)
Adds an existing user under ou=users,ou=system to an existing group under the ou=groups,ou=system container. |
void |
createAccessControlSubentry(java.lang.String cn,
java.lang.String aciItem)
Creates an access control subentry under ou=system whose subtree covers the entire naming context. |
void |
createAccessControlSubentry(java.lang.String cn,
java.lang.String subtree,
java.lang.String aciItem)
Creates an access control subentry under ou=system whose subtree covers the entire naming context. |
javax.naming.Name |
createGroup(java.lang.String groupName)
Creates a simple groupOfUniqueNames under the ou=groups,ou=system container. |
javax.naming.Name |
createGroup(java.lang.String cn,
java.lang.String firstMemberDn)
Creates a group using the groupOfUniqueNames objectClass under the ou=groups,ou=sytem container with an initial member. |
javax.naming.Name |
createUser(java.lang.String uid,
java.lang.String password)
Creates a simple user as an inetOrgPerson under the ou=users,ou=system container. |
void |
deleteAccessControlSubentry(java.lang.String cn)
|
void |
deleteUser(java.lang.String uid)
Deletes a user with a specific UID under ou=users,ou=system. |
javax.naming.directory.DirContext |
getContextAs(javax.naming.Name user,
java.lang.String password)
Gets the context at ou=system as a specific user. |
javax.naming.directory.DirContext |
getContextAs(javax.naming.Name user,
java.lang.String password,
java.lang.String dn)
Gets the context at any DN under ou=system as a specific user. |
javax.naming.directory.DirContext |
getContextAsAdmin()
Gets a context at ou=system as the admin user. |
javax.naming.directory.DirContext |
getContextAsAdmin(java.lang.String dn)
Gets a context at some dn within the directory as the admin user. |
void |
removeUserFromGroup(java.lang.String userUid,
java.lang.String groupCn)
Removes a user from a group. |
| Methods inherited from class org.apache.directory.server.core.unit.AbstractTestCase |
|---|
doDelete, getOverriddenEnvironment, overrideEnvironment, setLdifPath, setLdifPath, setLoadClass, setSysRoot, setSysRoot, setUp, tearDown |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public AbstractAuthorizationITest()
| Method Detail |
|---|
public javax.naming.directory.DirContext getContextAsAdmin()
throws javax.naming.NamingException
javax.naming.NamingException - if there are problems creating the context
public javax.naming.directory.DirContext getContextAsAdmin(java.lang.String dn)
throws javax.naming.NamingException
dn - the DN of the context to get
javax.naming.NamingException - if is a problem initializing or getting the context
public javax.naming.Name createGroup(java.lang.String cn,
java.lang.String firstMemberDn)
throws javax.naming.NamingException
cn - the common name of the group used as the RDN attributefirstMemberDn - the DN of the first member of this group
javax.naming.NamingException - if there are problems creating the new group like
it exists already
public void deleteUser(java.lang.String uid)
throws javax.naming.NamingException
uid - the RDN value for the user to delete
javax.naming.NamingException - if there are problems removing the user
i.e. user does not exist
public javax.naming.Name createUser(java.lang.String uid,
java.lang.String password)
throws javax.naming.NamingException
uid - the value of the RDN attriubte (uid), the sn and cn attributespassword - the password to use to create the user
javax.naming.NamingException - if there are problems creating the user entry
public javax.naming.Name createGroup(java.lang.String groupName)
throws javax.naming.NamingException
javax.naming.NamingException
public void addUserToGroup(java.lang.String userUid,
java.lang.String groupCn)
throws javax.naming.NamingException
userUid - the uid of the user to add to the groupgroupCn - the cn of the group to add the user to
javax.naming.NamingException - if the group does not exist
public void removeUserFromGroup(java.lang.String userUid,
java.lang.String groupCn)
throws javax.naming.NamingException
userUid - the RDN attribute value of the user to remove from the groupgroupCn - the RDN attribute value of the group to have user removed from
javax.naming.NamingException - if there are problems accessing the group
public javax.naming.directory.DirContext getContextAs(javax.naming.Name user,
java.lang.String password)
throws javax.naming.NamingException
user - the DN of the user to get the context aspassword - the password of the user
javax.naming.NamingException - if the user does not exist or authx fails
public javax.naming.directory.DirContext getContextAs(javax.naming.Name user,
java.lang.String password,
java.lang.String dn)
throws javax.naming.NamingException
user - the DN of the user to get the context aspassword - the password of the userdn - the distinguished name of the entry to get the context for
javax.naming.NamingException - if the does not exist or authx fails
public void deleteAccessControlSubentry(java.lang.String cn)
throws javax.naming.NamingException
javax.naming.NamingException
public void createAccessControlSubentry(java.lang.String cn,
java.lang.String aciItem)
throws javax.naming.NamingException
cn - the common name and rdn for the subentryaciItem - the prescriptive ACI attribute value
javax.naming.NamingException - if there is a problem creating the subentry
public void createAccessControlSubentry(java.lang.String cn,
java.lang.String subtree,
java.lang.String aciItem)
throws javax.naming.NamingException
cn - the common name and rdn for the subentrysubtree - the subtreeSpecification for the subentryaciItem - the prescriptive ACI attribute value
javax.naming.NamingException - if there is a problem creating the subentry
public void addEntryACI(javax.naming.Name rdn,
java.lang.String aciItem)
throws javax.naming.NamingException
rdn - a name relative to ou=systemaciItem - the entryACI attribute value
javax.naming.NamingException - if there is a problem adding the attribute
public void addSubentryACI(java.lang.String aciItem)
throws javax.naming.NamingException
aciItem - the subentryACI attribute value
javax.naming.NamingException - if there is a problem adding the attribute
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||