Repository navigation
feat(keycloak): search accounts by email or username - #678
Merged
dadiorchen merged 1 commit intoOct 7, 2026
Merged
Conversation
Binding a legacy wallet to a keycloak account needs the admin to find that account. The browser cannot hold admin credentials, so the lookup goes through the service account this API already authenticates with. Guarded by wallet-admin, the same role that gates the wallet pages in the admin panel.
dadiorchen
approved these changes
Oct 7, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Part of Greenstand/treetracker-admin-client#1241
Problem
Binding a legacy wallet to a keycloak account means the admin has to identify that account. Dadiorchen asked on the issue that we define this before coding, and we settled on search rather than pasting a uuid: a pasted id is unverifiable, and the acceptance criteria already ask the wallet detail page to show the keycloak user's name or email, which needs a lookup either way.
The browser cannot hold admin credentials, so the lookup has to be proxied. This API already authenticates to Keycloak with a service account for the organization apply flow, so no new secret is needed.
Change
Both behind
requireRole(Role.WALLET_ADMIN), the same role that gates the wallet pages in the admin panel. An empty search returns[]without calling Keycloak. Onlyid,username,email,firstNameandlastNameare returned.Verification
5 new tests in
src/controllers/keycloakUser.controller.test.ts. Full suite 79 passing,tsc --noEmitclean, eslint and prettier clean.Related