|
|
|
@ -28,8 +28,7 @@ import java.util.Map; |
|
|
|
import java.util.Set; |
|
|
|
import java.util.Set; |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* A LDAP authority populator that can recursively search static nested groups. |
|
|
|
* A LDAP authority populator that can recursively search static nested groups. <p>An example of nested groups can be |
|
|
|
* <p>An example of nested groups can be |
|
|
|
|
|
|
|
* <pre> |
|
|
|
* <pre> |
|
|
|
* #Nested groups data |
|
|
|
* #Nested groups data |
|
|
|
* |
|
|
|
* |
|
|
|
@ -128,9 +127,9 @@ public class NestedLdapAuthoritiesPopulator extends DefaultLdapAuthoritiesPopula |
|
|
|
* Maximum search depth - represents the number of recursive searches performed |
|
|
|
* Maximum search depth - represents the number of recursive searches performed |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
private int maxSearchDepth = 10; |
|
|
|
private int maxSearchDepth = 10; |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* Constructor for group search scenarios. <tt>userRoleAttributes</tt> may still be |
|
|
|
* Constructor for group search scenarios. <tt>userRoleAttributes</tt> may still be set as a property. |
|
|
|
* set as a property. |
|
|
|
|
|
|
|
* |
|
|
|
* |
|
|
|
* @param contextSource supplies the contexts used to search for user roles. |
|
|
|
* @param contextSource supplies the contexts used to search for user roles. |
|
|
|
* @param groupSearchBase if this is an empty string the search will be performed from the root DN of the |
|
|
|
* @param groupSearchBase if this is an empty string the search will be performed from the root DN of the |
|
|
|
@ -157,6 +156,7 @@ public class NestedLdapAuthoritiesPopulator extends DefaultLdapAuthoritiesPopula |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* Performs the nested group search |
|
|
|
* Performs the nested group search |
|
|
|
|
|
|
|
* |
|
|
|
* @param userDn - the userDN to search for, will become the group DN for subsequent searches |
|
|
|
* @param userDn - the userDN to search for, will become the group DN for subsequent searches |
|
|
|
* @param username - the username of the user |
|
|
|
* @param username - the username of the user |
|
|
|
* @param authorities - the authorities set that will be populated, must not be null |
|
|
|
* @param authorities - the authorities set that will be populated, must not be null |
|
|
|
@ -219,8 +219,9 @@ public class NestedLdapAuthoritiesPopulator extends DefaultLdapAuthoritiesPopula |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* Returns the attribute names that this populator has been configured to retrieve |
|
|
|
* Returns the attribute names that this populator has been configured to retrieve Value can be null, represents |
|
|
|
* Value can be null, represents fetch all attributes |
|
|
|
* fetch all attributes |
|
|
|
|
|
|
|
* |
|
|
|
* @return the attribute names or null for all |
|
|
|
* @return the attribute names or null for all |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
public Set<String> getAttributeNames() { |
|
|
|
public Set<String> getAttributeNames() { |
|
|
|
@ -229,6 +230,7 @@ public class NestedLdapAuthoritiesPopulator extends DefaultLdapAuthoritiesPopula |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* Sets the attribute names to retrieve for each ldap groups. Null means retrieve all |
|
|
|
* Sets the attribute names to retrieve for each ldap groups. Null means retrieve all |
|
|
|
|
|
|
|
* |
|
|
|
* @param attributeNames - the names of the LDAP attributes to retrieve |
|
|
|
* @param attributeNames - the names of the LDAP attributes to retrieve |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
public void setAttributeNames(Set<String> attributeNames) { |
|
|
|
public void setAttributeNames(Set<String> attributeNames) { |
|
|
|
@ -236,8 +238,8 @@ public class NestedLdapAuthoritiesPopulator extends DefaultLdapAuthoritiesPopula |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* How far should a nested search go. Depth is calculated in the number of levels we search up for |
|
|
|
* How far should a nested search go. Depth is calculated in the number of levels we search up for parent groups. |
|
|
|
* parent groups. |
|
|
|
* |
|
|
|
* @return the max search depth, default is 10 |
|
|
|
* @return the max search depth, default is 10 |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
public int getMaxSearchDepth() { |
|
|
|
public int getMaxSearchDepth() { |
|
|
|
@ -245,8 +247,8 @@ public class NestedLdapAuthoritiesPopulator extends DefaultLdapAuthoritiesPopula |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* How far should a nested search go. Depth is calculated in the number of levels we search up for |
|
|
|
* How far should a nested search go. Depth is calculated in the number of levels we search up for parent groups. |
|
|
|
* parent groups. |
|
|
|
* |
|
|
|
* @param maxSearchDepth the max search depth |
|
|
|
* @param maxSearchDepth the max search depth |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
public void setMaxSearchDepth(int maxSearchDepth) { |
|
|
|
public void setMaxSearchDepth(int maxSearchDepth) { |
|
|
|
@ -254,5 +256,4 @@ public class NestedLdapAuthoritiesPopulator extends DefaultLdapAuthoritiesPopula |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|