Package pro.taskana.common.rest.ldap
Class LdapClient
java.lang.Object
pro.taskana.common.rest.ldap.LdapClient
Class for Ldap access.
-
Constructor Summary
ConstructorsConstructorDescriptionLdapClient(org.springframework.core.env.Environment env, org.springframework.ldap.core.LdapTemplate ldapTemplate, pro.taskana.TaskanaConfiguration taskanaConfiguration) -
Method Summary
Modifier and TypeMethodDescriptionintcalcMaxNumberOfReturnedAccessIds(int defaultValue) intcalcMinSearchForLength(int defaultValue) intintgetUsersByAccessId(String accessId) booleansearchDnForAccessId(String accessId) Performs a lookup to retrieve correct DN for the given access id.searchGroupsAccessIdIsMemberOf(String accessId) searchGroupsByName(String name) searchUsersAndGroups(String name) Search LDAP for matching users or groups.searchUsersByNameOrAccessIdInUserRole(String nameOrAccessId) List<pro.taskana.user.api.models.User>booleanvalidateAccessId(String name) Validates a given AccessId / name.
-
Constructor Details
-
LdapClient
@Autowired public LdapClient(org.springframework.core.env.Environment env, org.springframework.ldap.core.LdapTemplate ldapTemplate, pro.taskana.TaskanaConfiguration taskanaConfiguration)
-
-
Method Details
-
searchUsersAndGroups
public List<AccessIdRepresentationModel> searchUsersAndGroups(String name) throws pro.taskana.common.api.exceptions.InvalidArgumentException Search LDAP for matching users or groups.- Parameters:
name- lookup string for names or groups- Returns:
- a list of AccessIdResources sorted by AccessId and limited to maxNumberOfReturnedAccessIds
- Throws:
pro.taskana.common.api.exceptions.InvalidArgumentException- if input is shorter than minSearchForLength
-
searchUsersByNameOrAccessIdInUserRole
public List<AccessIdRepresentationModel> searchUsersByNameOrAccessIdInUserRole(String nameOrAccessId) throws pro.taskana.common.api.exceptions.InvalidArgumentException - Throws:
pro.taskana.common.api.exceptions.InvalidArgumentException
-
searchUsersInUserRole
-
searchUsersByNameOrAccessId
public List<AccessIdRepresentationModel> searchUsersByNameOrAccessId(String name) throws pro.taskana.common.api.exceptions.InvalidArgumentException - Throws:
pro.taskana.common.api.exceptions.InvalidArgumentException
-
getUsersByAccessId
-
searchGroupsByName
public List<AccessIdRepresentationModel> searchGroupsByName(String name) throws pro.taskana.common.api.exceptions.InvalidArgumentException - Throws:
pro.taskana.common.api.exceptions.InvalidArgumentException
-
searchAccessIdByDn
-
searchGroupsAccessIdIsMemberOf
public List<AccessIdRepresentationModel> searchGroupsAccessIdIsMemberOf(String accessId) throws pro.taskana.common.api.exceptions.InvalidArgumentException - Throws:
pro.taskana.common.api.exceptions.InvalidArgumentException
-
searchDnForAccessId
public String searchDnForAccessId(String accessId) throws pro.taskana.common.api.exceptions.InvalidArgumentException Performs a lookup to retrieve correct DN for the given access id.- Parameters:
accessId- The access id to lookup- Returns:
- the LDAP Distinguished Name for the access id
- Throws:
pro.taskana.common.api.exceptions.InvalidArgumentException- thrown if the given access id is ambiguous.
-
validateAccessId
Validates a given AccessId / name.- Parameters:
name- lookup string for names or groups- Returns:
- whether the given name is valid or not
-
getUserSearchBase
-
getUserSearchFilterName
-
getUserSearchFilterValue
-
getUserFirstnameAttribute
-
getUserLastnameAttribute
-
getUserPhoneAttribute
-
getUserMobilePhoneAttribute
-
getUserEmailAttribute
-
getUserOrgLevel1Attribute
-
getUserOrgLevel2Attribute
-
getUserOrgLevel3Attribute
-
getUserOrgLevel4Attribute
-
getUserIdAttribute
-
getUserMemberOfGroupAttribute
-
getUserPermissionsAttribute
-
getGroupSearchBase
-
getBaseDn
-
getGroupSearchFilterName
-
getGroupSearchFilterValue
-
getGroupNameAttribute
-
calcMinSearchForLength
public int calcMinSearchForLength(int defaultValue) -
getMinSearchForLength
public int getMinSearchForLength() -
calcMaxNumberOfReturnedAccessIds
public int calcMaxNumberOfReturnedAccessIds(int defaultValue) -
getMaxNumberOfReturnedAccessIds
public int getMaxNumberOfReturnedAccessIds() -
getGroupsOfUserName
-
getGroupsOfUserType
-
isUser
-