p2-inc / keycloak-orgs

Single realm, multi-tenancy for SaaS apps
https://phasetwo.io
Other
406 stars 72 forks source link

Organization API improvement #94

Closed grinay closed 1 year ago

grinay commented 1 year ago

Hi Guys. I have just updated the organization plugin. A while ago I reported about an issue with pagination. Thanks for fixing it. Now it works. Wanted to ask you about some improvements there. There are two fields Name and Display name. As we have a case when names are not uniq for some reasons, we are using GUID instated of name and Put real organisation name into Display name. The search functionality seems only looking into Name filed. If it possible to add search on DisplayName field too. Thanks in advance.

xgp commented 1 year ago

we have a case when names are not uniq

name has a unique contstraint. This should not be possible. How are you doing that @grinay ?

add search on DisplayName field too

Should be easy. Just need to change these two queries:

grinay commented 1 year ago

@xgp , yes you're right, this is not possible as Name field has uniq constraint. And because of that we are using uniq guid on this field from our app db, and real company name put into DisplayName.

xgp commented 1 year ago

This PR https://github.com/p2-inc/keycloak-orgs/pull/93 just added a criteria on name and attributes. Should be fairly straightforward to make the criteria for the search either name or displayName.

xgp commented 1 year ago

This was added in #95