/users/count endpoint with search field has different behavior than /users query endpoint #17620
Closed
2 tasks done
Labels
area/account/api
area/storage
Indicates an issue that touches storage (change in data layout or data manipulation)
kind/bug
Categorizes a PR related to a bug
team/rh-iam
Milestone
Before reporting an issue
Area
admin/api
Describe the bug
/users/count endpoint with search field has different behavior than /users query endpoint because of the JpaUserProvider implementation.
In the method
searchForUserStream(RealmModel realm, Map<String, String> attributes, Integer firstResult, Integer maxResults)
the search key/value attribute is trimmed to treat spaces as different search predicates:
In the methods
getUsersCount(RealmModel realm, String search, Set<String> groupIds)
and
getUsersCount(RealmModel realm, String search)
the search attribute is used as a unique predicate:
Version
Expected behavior
Having the user with representation:
calling the endpoint:
/users/count?search=jo do
I expect result to be 1.
Actual behavior
Result is 0
How to Reproduce?
Call the endpoint:
and
Anything else?
No response
The text was updated successfully, but these errors were encountered: