Add support for explicit user search by username and email in Admin UI#13185
Conversation
|
really useful feature |
a4d3baf to
5103ecc
Compare
5103ecc to
663fc69
Compare
adaef08 to
94e101f
Compare
|
The tests work fine on my side. It seems as if the keycloak-documentation build have some issues at the moment. |
488ecce to
34fc484
Compare
|
@thomasdarimont We already added user attribute searches to the UI. I take it that you are saying these searches are too inefficient? |
|
@ssilvert thanks for having a look. I think you are referring to this regarding attribute search: https://github.com/keycloak/keycloak/blob/main/rest/admin-ui-ext/src/main/java/org/keycloak/admin/ui/rest/BruteForceUsersResource.java#L97C24-L97C37 Therefore I think the proposed shortcuts for very common search operations are still because they speed-up user search via admin-ui and rest API significantly. |
75cd8fd to
2a7183c
Compare
2a7183c to
e9f7662
Compare
|
I rebased my branch on current main and reimplemented the support for explicit user and email lookups via |
e9f7662 to
2a7183c
Compare
pedroigor
left a comment
There was a problem hiding this comment.
Thanks, @thomasdarimont.
Can you please update the PR:
- Add
emailtogetCount - Add tests to cover
countwithin the test methods you are adding
Once we have that, LGTM.
2a7183c to
0d1bd94
Compare
|
Just pushed a rebased version |
…loak#26602) - Introduce UserSearchPrefix enum in SearchQueryUtils pairing each prefix (id:, username:, email:) with its UserProvider lookup, plus a splitTerms helper backed by a precompiled "\\s+" pattern - Collapse duplicate prefix branches in UsersResource#getUsers, UsersResource#getUsersCount and BruteForceUsersResource#searchUser - BruteForceUsersResource: support multi-term lookups (e.g. "username:foo bar"), aligning with UsersResource - Tests: add searchByUsernameSearch / searchByEmailSearch covering single-term, multi-term and whitespace-tolerant variants - Docs: add "Search by fields" section to proc-searching-user.adoc Fixes keycloak#26602 Signed-off-by: Thomas Darimont <[email protected]>
0d1bd94 to
dcaf4c1
Compare
|
@pedroigor I think searches for prefixes like id:, email: and username: are covered now. I added some additional checks for count(..) as you requested. |
This adds support for the
username:$USERNAMEemail:$EMAILin the vein ofid:$USERID.Add support for user lookup by username
Fixes #26602
Discussion: #13184
Signed-off-by: Thomas Darimont [email protected]