forked from quarkusio/quarkus
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
added searchRecursive property in ldap config
- Loading branch information
Matthias Harter
committed
Oct 31, 2020
1 parent
d3fb2be
commit c9b7140
Showing
6 changed files
with
86 additions
and
4 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
33 changes: 33 additions & 0 deletions
33
...y-ldap/deployment/src/test/java/io/quarkus/elytron/security/ldap/SearchRecursiveTest.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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
package io.quarkus.elytron.security.ldap; | ||
|
||
import org.jboss.shrinkwrap.api.ShrinkWrap; | ||
import org.jboss.shrinkwrap.api.spec.JavaArchive; | ||
import org.junit.jupiter.api.Test; | ||
import org.junit.jupiter.api.extension.RegisterExtension; | ||
|
||
import io.quarkus.elytron.security.ldap.rest.SingleRoleSecuredServlet; | ||
import io.quarkus.test.QuarkusUnitTest; | ||
import io.quarkus.test.common.QuarkusTestResource; | ||
import io.quarkus.test.ldap.LdapServerTestResource; | ||
import io.restassured.RestAssured; | ||
|
||
@QuarkusTestResource(LdapServerTestResource.class) | ||
public class SearchRecursiveTest { | ||
|
||
protected static Class[] testClasses = { | ||
SingleRoleSecuredServlet.class | ||
}; | ||
|
||
@RegisterExtension | ||
static final QuarkusUnitTest config = new QuarkusUnitTest() | ||
.setArchiveProducer(() -> ShrinkWrap.create(JavaArchive.class) | ||
.addClasses(testClasses) | ||
.addAsResource("search-recursive/application.properties", "application.properties")); | ||
|
||
@Test() | ||
public void testNotSearchingRecursiveFailure() { | ||
RestAssured.given().auth().preemptive().basic("subUser", "subUserPassword") | ||
.when().get("/servlet-secured").then() | ||
.statusCode(200); | ||
} | ||
} |
12 changes: 12 additions & 0 deletions
12
...ytron-security-ldap/deployment/src/test/resources/search-recursive/application.properties
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 |
---|---|---|
@@ -0,0 +1,12 @@ | ||
quarkus.security.ldap.enabled=true | ||
|
||
quarkus.security.ldap.dir-context.principal=uid=admin,ou=system | ||
quarkus.security.ldap.dir-context.url=ldap://127.0.0.1:10389 | ||
quarkus.security.ldap.dir-context.password=secret | ||
|
||
quarkus.security.ldap.identity-mapping.search-recursive=true | ||
quarkus.security.ldap.identity-mapping.search-base-dn=ou=Users,dc=quarkus,dc=io | ||
|
||
quarkus.security.ldap.identity-mapping.attribute-mappings."0".from=cn | ||
quarkus.security.ldap.identity-mapping.attribute-mappings."0".filter=(member=uid={0},ou=SubUsers,ou=Users,dc=quarkus,dc=io) | ||
quarkus.security.ldap.identity-mapping.attribute-mappings."0".filter-base-dn=ou=Roles,dc=quarkus,dc=io |
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
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