Skip to content

Commit

Permalink
Added support for group filtering with cursor pagination (LDAP and JD…
Browse files Browse the repository at this point in the history
…BC(DB2, MSSQL, Oracle, Postgres, MySQL))
  • Loading branch information
BojithaPiyathilake committed Jun 17, 2022
1 parent b74cf59 commit 55f150b
Show file tree
Hide file tree
Showing 3 changed files with 144 additions and 85 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,6 @@
import java.util.Map;
import java.util.Set;
import java.util.UUID;
import java.util.Comparator;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import java.util.stream.Collectors;
Expand Down Expand Up @@ -15735,12 +15734,6 @@ public List<User> getUserListWithID(Condition condition, String domain, String p
// This method will flow down to use cursor pagination, so the offset will be null.
Integer offset = null;

//If the domain is not PRIMARY, Cursor value will look like: DOMAIN/Cursor (unless it is the initial request)
if (!UserCoreConstants.PRIMARY_DEFAULT_DOMAIN_NAME.equals(domain) && !StringUtils.EMPTY.equals(cursor)) {
String[] removeDomain = cursor.split(CarbonConstants.DOMAIN_SEPARATOR);
cursor = removeDomain[1];
}

validateCondition(condition);
if (StringUtils.isNotEmpty(sortBy) && StringUtils.isNotEmpty(sortOrder)) {
throw new UserStoreException("Sorting is not supported.");
Expand Down Expand Up @@ -16109,8 +16102,8 @@ private boolean hasIdentityClaimInitially(List<ExpressionCondition> expressionCo

for (ExpressionCondition expressionCondition : expressionConditions) {
List<org.wso2.carbon.user.api.ClaimMapping> mappedClaim =
Arrays.stream(claimMapping).filter(mapping -> mapping.getMappedAttribute() ==
expressionCondition.getAttributeName()).collect(Collectors.toList());
Arrays.stream(claimMapping).filter(mapping -> mapping.getMappedAttribute()
.equals(expressionCondition.getAttributeName())).collect(Collectors.toList());

//Obtaining relevant URI for the mapped attribute.
if (mappedClaim.size() == 1) {
Expand Down
Loading

0 comments on commit 55f150b

Please sign in to comment.