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) searchPermissionsAccessIdHas(String accessId) Search LDAP for matching users or groups or permissions.searchUsersByNameOrAccessIdInUserRole(String nameOrAccessId) List<pro.taskana.user.api.models.User>booleanbooleanvalidateAccessId(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
-
searchUsersAndGroupsAndPermissions
public List<AccessIdRepresentationModel> searchUsersAndGroupsAndPermissions(String name) throws pro.taskana.common.api.exceptions.InvalidArgumentException, InvalidNameException Search LDAP for matching users or groups or permissions.- Parameters:
name- lookup string for names or groups or permissions- Returns:
- a list of AccessIdResources sorted by AccessId and limited to maxNumberOfReturnedAccessIds
- Throws:
pro.taskana.common.api.exceptions.InvalidArgumentException- if input is shorter than minSearchForLengthInvalidNameException- thrown if name is not a valid dn
-
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
-
searchAccessIdForGroupsAndPermissionsByDn
public Map<String,List<String>> searchAccessIdForGroupsAndPermissionsByDn(List<String> dns) throws InvalidNameException - Throws:
InvalidNameException
-
searchPermissionsByName
public List<AccessIdRepresentationModel> searchPermissionsByName(String name) throws pro.taskana.common.api.exceptions.InvalidArgumentException - Throws:
pro.taskana.common.api.exceptions.InvalidArgumentException
-
searchAccessIdByDn
- Throws:
InvalidNameException
-
searchGroupsAccessIdIsMemberOf
public List<AccessIdRepresentationModel> searchGroupsAccessIdIsMemberOf(String accessId) throws pro.taskana.common.api.exceptions.InvalidArgumentException, InvalidNameException - Throws:
pro.taskana.common.api.exceptions.InvalidArgumentExceptionInvalidNameException
-
searchPermissionsAccessIdHas
public List<AccessIdRepresentationModel> searchPermissionsAccessIdHas(String accessId) throws pro.taskana.common.api.exceptions.InvalidArgumentException, InvalidNameException - Throws:
pro.taskana.common.api.exceptions.InvalidArgumentExceptionInvalidNameException
-
searchDnForAccessId
public String searchDnForAccessId(String accessId) throws pro.taskana.common.api.exceptions.InvalidArgumentException, InvalidNameException 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.InvalidNameException- thrown if name is not a valid dn
-
validateAccessId
Validates a given AccessId / name.- Parameters:
name- lookup string for names or groups- Returns:
- whether the given name is valid or not
- Throws:
InvalidNameException- thrown if name is not a valid dn
-
getUserSearchBase
-
getUserSearchFilterName
-
getUserSearchFilterValue
-
getUserFirstnameAttribute
-
getUserLastnameAttribute
-
getUserPhoneAttribute
-
getUserMobilePhoneAttribute
-
getUserEmailAttribute
-
getUserOrgLevel1Attribute
-
getUserOrgLevel2Attribute
-
getUserOrgLevel3Attribute
-
getUserOrgLevel4Attribute
-
getUserIdAttribute
-
getUserMemberOfGroupAttribute
-
getUserPermissionsAttribute
-
getPermissionSearchBase
-
getPermissionSearchFilterName
-
getPermissionSearchFilterValue
-
getPermissionNameAttribute
-
getGroupSearchBase
-
getBaseDn
-
getGroupSearchFilterName
-
getGroupSearchFilterValue
-
getGroupNameAttribute
-
calcMinSearchForLength
public int calcMinSearchForLength(int defaultValue) -
getMinSearchForLength
public int getMinSearchForLength() -
calcMaxNumberOfReturnedAccessIds
public int calcMaxNumberOfReturnedAccessIds(int defaultValue) -
useDnForGroups
public boolean useDnForGroups() -
getMaxNumberOfReturnedAccessIds
public int getMaxNumberOfReturnedAccessIds() -
getGroupsOfUserName
-
getGroupsOfUserType
-
getPermissionsOfUserName
-
getPermissionsOfUserType
-
isUser
-