Search in sources :

Example 16 with Entry

use of org.opends.server.types.Entry in project midpoint by Evolveum.

the class TestLdapHierarchical method getAndAssertUser.

@Override
protected PrismObject<UserType> getAndAssertUser(String username, String directOrgGroupname, String... indirectGroupNames) throws SchemaException, CommonException, SecurityViolationException, CommunicationException, ConfigurationException, DirectoryException {
    PrismObject<UserType> user = super.getAndAssertUser(username, directOrgGroupname, indirectGroupNames);
    Entry accountEntry = openDJController.searchSingle("uid=" + username);
    Entry groupEntry = openDJController.searchSingle("cn=" + directOrgGroupname);
    assertNotNull("No group LDAP entry for " + directOrgGroupname, groupEntry);
    openDJController.assertUniqueMember(groupEntry, accountEntry.getDN().toString());
    return user;
}
Also used : Entry(org.opends.server.types.Entry) UserType(com.evolveum.midpoint.xml.ns._public.common.common_3.UserType)

Example 17 with Entry

use of org.opends.server.types.Entry in project midpoint by Evolveum.

the class TestLdapNested method getAndAssertUser.

@Override
protected PrismObject<UserType> getAndAssertUser(String username, String directOrgGroupname, String... indirectGroupNames) throws SchemaException, CommonException, SecurityViolationException, CommunicationException, ConfigurationException, DirectoryException {
    PrismObject<UserType> user = super.getAndAssertUser(username, directOrgGroupname, indirectGroupNames);
    Entry accountEntry = openDJController.searchSingle("uid=" + username);
    Entry groupEntry = openDJController.searchSingle("cn=" + directOrgGroupname);
    assertNotNull("No group LDAP entry for " + directOrgGroupname, groupEntry);
    openDJController.assertUniqueMember(groupEntry, accountEntry.getDN().toString());
    return user;
}
Also used : Entry(org.opends.server.types.Entry) UserType(com.evolveum.midpoint.xml.ns._public.common.common_3.UserType)

Example 18 with Entry

use of org.opends.server.types.Entry in project midpoint by Evolveum.

the class AbstractLdapHierarchyTest method getAndAssertUser.

protected PrismObject<UserType> getAndAssertUser(String username, String directOrgGroupname, String... indirectGroupNames) throws SchemaException, CommonException, SecurityViolationException, CommunicationException, ConfigurationException, DirectoryException {
    PrismObject<UserType> user = findUserByUsername(username);
    display("user", user);
    String shadowOid = getLinkRefOid(user, RESOURCE_OPENDJ_OID, ShadowKindType.ACCOUNT, SchemaConstants.INTENT_DEFAULT);
    PrismObject<ShadowType> accountShadow = getShadowModel(shadowOid);
    display("Account " + username + " shadow", accountShadow);
    // TODO assert shadow content
    Entry accountEntry = openDJController.searchSingle("uid=" + username);
    assertNotNull("No account LDAP entry for " + username, accountEntry);
    display("account entry", openDJController.toHumanReadableLdifoid(accountEntry));
    openDJController.assertObjectClass(accountEntry, "inetOrgPerson");
    return user;
}
Also used : Entry(org.opends.server.types.Entry) ShadowType(com.evolveum.midpoint.xml.ns._public.common.common_3.ShadowType) PolyString(com.evolveum.midpoint.prism.polystring.PolyString) UserType(com.evolveum.midpoint.xml.ns._public.common.common_3.UserType)

Example 19 with Entry

use of org.opends.server.types.Entry in project midpoint by Evolveum.

the class AbstractLdapHierarchyTest method getAndAssertFunctionalOrg.

protected PrismObject<OrgType> getAndAssertFunctionalOrg(String orgName, String directParentOrgOid) throws SchemaException, ObjectNotFoundException, SecurityViolationException, CommunicationException, ConfigurationException, DirectoryException, ExpressionEvaluationException {
    PrismObject<OrgType> org = getOrg(orgName);
    display("org", org);
    PrismAsserts.assertPropertyValue(org, OrgType.F_ORG_TYPE, ORG_TYPE_FUNCTIONAL);
    assertAssignedRole(org, ROLE_META_ORG_OID);
    String groupOid = getLinkRefOid(org, RESOURCE_OPENDJ_OID, ShadowKindType.ENTITLEMENT, LDAP_GROUP_INTENT);
    PrismObject<ShadowType> groupShadow = getShadowModel(groupOid);
    display("Org " + orgName + " group shadow", groupShadow);
    // TODO assert shadow content
    Entry groupEntry = openDJController.searchSingle("cn=" + orgName);
    assertNotNull("No group LDAP entry for " + orgName, groupEntry);
    display("OU GROUP entry", openDJController.toHumanReadableLdifoid(groupEntry));
    openDJController.assertObjectClass(groupEntry, "groupOfUniqueNames");
    assertHasOrg(org, directParentOrgOid);
    assertAssignedOrg(org, directParentOrgOid);
    return org;
}
Also used : Entry(org.opends.server.types.Entry) OrgType(com.evolveum.midpoint.xml.ns._public.common.common_3.OrgType) ShadowType(com.evolveum.midpoint.xml.ns._public.common.common_3.ShadowType) PolyString(com.evolveum.midpoint.prism.polystring.PolyString)

Example 20 with Entry

use of org.opends.server.types.Entry in project midpoint by Evolveum.

the class TestLdapDeeplyHierarchical method getAndAssertUser.

@Override
protected PrismObject<UserType> getAndAssertUser(String username, String directOrgGroupname, String... indirectGroupNames) throws SchemaException, CommonException, SecurityViolationException, CommunicationException, ConfigurationException, DirectoryException {
    PrismObject<UserType> user = super.getAndAssertUser(username, directOrgGroupname, indirectGroupNames);
    Entry accountEntry = openDJController.searchSingle("uid=" + username);
    String expectedDn = getAccountDn(user);
    assertEquals("Wrong account DN", expectedDn, accountEntry.getDN().toString().toLowerCase());
    Entry groupEntry = openDJController.searchSingle("cn=" + directOrgGroupname);
    assertNotNull("No group LDAP entry for " + directOrgGroupname, groupEntry);
    openDJController.assertUniqueMember(groupEntry, accountEntry.getDN().toString());
    return user;
}
Also used : Entry(org.opends.server.types.Entry) UserType(com.evolveum.midpoint.xml.ns._public.common.common_3.UserType)

Aggregations

Entry (org.opends.server.types.Entry)87 OperationResult (com.evolveum.midpoint.schema.result.OperationResult)45 Test (org.testng.annotations.Test)44 Task (com.evolveum.midpoint.task.api.Task)43 ShadowType (com.evolveum.midpoint.xml.ns._public.common.common_3.ShadowType)40 PolyString (com.evolveum.midpoint.prism.polystring.PolyString)29 UserType (com.evolveum.midpoint.xml.ns._public.common.common_3.UserType)14 QName (javax.xml.namespace.QName)11 SearchResultEntry (org.opends.server.types.SearchResultEntry)11 LDIFImportConfig (org.opends.server.types.LDIFImportConfig)10 LDIFReader (org.opends.server.util.LDIFReader)10 AbstractModelIntegrationTest (com.evolveum.midpoint.model.test.AbstractModelIntegrationTest)9 OrgType (com.evolveum.midpoint.xml.ns._public.common.common_3.OrgType)8 PrismObject (com.evolveum.midpoint.prism.PrismObject)6 JarEntry (java.util.jar.JarEntry)6 ChangeRecordEntry (org.opends.server.util.ChangeRecordEntry)6 ModifyChangeRecordEntry (org.opends.server.util.ModifyChangeRecordEntry)6 ModifyDNChangeRecordEntry (org.opends.server.util.ModifyDNChangeRecordEntry)6 ItemPath (com.evolveum.midpoint.prism.path.ItemPath)5 PrismReferenceValue (com.evolveum.midpoint.prism.PrismReferenceValue)4