-
Notifications
You must be signed in to change notification settings - Fork 282
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Tests for roles recursive search for LDAP.
Signed-off-by: Lukasz Soszynski <[email protected]>
- Loading branch information
1 parent
7a9eac5
commit dc80aea
Showing
9 changed files
with
125 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,34 +14,40 @@ | |
|
||
class DirectoryInformationTrees { | ||
|
||
public static final String DN_PEOPLE_TEST_ORG = "ou=people,o=test.org"; | ||
public static final String DN_OPEN_SEARCH_PEOPLE_TEST_ORG = "cn=Open Search,ou=people,o=test.org"; | ||
public static final String DN_CHRISTPHER_PEOPLE_TEST_ORG = "cn=Christpher,ou=people,o=test.org"; | ||
public static final String DN_KIRK_PEOPLE_TEST_ORG = "cn=Kirk,ou=people,o=test.org"; | ||
public static final String DN_CAPTAIN_SPOCK_PEOPLE_TEST_ORG = "cn=Captain Spock,ou=people,o=test.org"; | ||
public static final String DN_LEONARD_PEOPLE_TEST_ORG = "cn=Leonard,ou=people,o=test.org"; | ||
public static final String DN_JEAN_PEOPLE_TEST_ORG = "cn=Jean,ou=people,o=test.org"; | ||
public static final String DN_GROUPS_TEST_ORG = "ou=groups,o=test.org"; | ||
public static final String DN_BRIDGE_GROUPS_TEST_ORG = "cn=bridge,ou=groups,o=test.org"; | ||
|
||
public static final String USER_KIRK = "kirk"; | ||
public static final String PASSWORD_KIRK = "kirk-secret"; | ||
|
||
public static final String USER_SPOCK = "spock"; | ||
public static final String PASSWORD_SPOCK = "spocksecret"; | ||
|
||
public static final String DN_OPEN_SEARCH_PEOPLE_TEST_ORG = "cn=Open Search,ou=people,o=test.org"; | ||
public static final String PASSWORD_OPEN_SEARCH = "open_search-secret"; | ||
public static final String USER_OPENS = "opens"; | ||
public static final String DN_PEOPLE_TEST_ORG = "ou=people,o=test.org"; | ||
|
||
public static final String USER_SEARCH = "(uid={0})"; | ||
public static final String USERNAME_ATTRIBUTE = "uid"; | ||
public static final String DN_KIRK_PEOPLE_TEST_ORG = "cn=Kirk,ou=people,o=test.org"; | ||
public static final String DN_CAPTAIN_SPOCK_PEOPLE_TEST_ORG = "cn=Captain Spock,ou=people,o=test.org"; | ||
public static final String PASSWORD_OPEN_SEARCH = "open_search-secret"; | ||
public static final String USER_JEAN = "jean"; | ||
public static final String PASSWORD_JEAN = "jeansecret"; | ||
public static final String USER_LEONARD = "leonard"; | ||
public static final String PASSWORD_LEONARD = "Leonard-secret"; | ||
public static final String PASSWORD_CHRISTPHER = "christpher_secret"; | ||
public static final String DN_CHRISTPHER_PEOPLE_TEST_ORG = "cn=Christpher,ou=people,o=test.org"; | ||
|
||
public static final String CN_GROUP_ADMIN = "admin"; | ||
public static final String DN_GROUPS_TEST_ORG = "ou=groups,o=test.org"; | ||
public static final String PASSWORD_LEONARD = "Leonard-secret"; | ||
public static final String USER_LEONARD = "leonard"; | ||
public static final String DN_LEONARD_PEOPLE_TEST_ORG = "cn=Leonard,ou=people,o=test.org"; | ||
public static final String CN_GROUP_CREW = "crew"; | ||
public static final String CN_GROUP_BRIDGE = "bridge"; | ||
|
||
public static final String USER_SEARCH = "(uid={0})"; | ||
public static final String USERNAME_ATTRIBUTE = "uid"; | ||
|
||
static final LdifData LDIF_DATA = new LdifBuilder() | ||
.root("o=test.org") | ||
.dc("TEST") | ||
.classes("top", "domain") | ||
.newRecord(DN_PEOPLE_TEST_ORG)//"ou=people,o=test.org" | ||
.newRecord(DN_PEOPLE_TEST_ORG) | ||
.ou("people") | ||
.classes("organizationalUnit", "top") | ||
.newRecord(DN_OPEN_SEARCH_PEOPLE_TEST_ORG) | ||
|
@@ -84,6 +90,14 @@ class DirectoryInformationTrees { | |
.userPassword(PASSWORD_LEONARD) | ||
.mail("[email protected]") | ||
.ou("Human Resources") | ||
.newRecord(DN_JEAN_PEOPLE_TEST_ORG) | ||
.classes("inetOrgPerson") | ||
.cn("Jean") | ||
.sn("Jean") | ||
.uid(USER_JEAN) | ||
.userPassword(PASSWORD_JEAN) | ||
.mail("[email protected]") | ||
.ou("Human Resources") | ||
.newRecord(DN_GROUPS_TEST_ORG) | ||
.ou("groups") | ||
.cn("groupsRoot") | ||
|
@@ -98,6 +112,12 @@ class DirectoryInformationTrees { | |
.cn(CN_GROUP_CREW) | ||
.uniqueMember(DN_CAPTAIN_SPOCK_PEOPLE_TEST_ORG) | ||
.uniqueMember(DN_CHRISTPHER_PEOPLE_TEST_ORG) | ||
.uniqueMember(DN_BRIDGE_GROUPS_TEST_ORG) | ||
.classes("groupofuniquenames", "top") | ||
.newRecord(DN_BRIDGE_GROUPS_TEST_ORG) | ||
.ou("groups") | ||
.cn(CN_GROUP_BRIDGE) | ||
.uniqueMember(DN_JEAN_PEOPLE_TEST_ORG) | ||
.classes("groupofuniquenames", "top") | ||
.buildRecord() | ||
.buildLdif(); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
14 changes: 14 additions & 0 deletions
14
src/integrationTest/java/org/opensearch/test/framework/LdapAuthenticationConfigBuilder.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
9 changes: 9 additions & 0 deletions
9
src/integrationTest/java/org/opensearch/test/framework/ldap/LdifBuilder.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
9 changes: 9 additions & 0 deletions
9
src/integrationTest/java/org/opensearch/test/framework/ldap/LdifData.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
9 changes: 9 additions & 0 deletions
9
src/integrationTest/java/org/opensearch/test/framework/ldap/Record.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
9 changes: 9 additions & 0 deletions
9
src/integrationTest/java/org/opensearch/test/framework/ldap/RecordBuilder.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters