8000 task: using a beanparam for client listing options by shawkins · Pull Request #49074 · keycloak/keycloak · GitHub
[go: up one dir, main page]

Skip to content

task: using a beanparam for client listing options - #49074

Merged
vmuzikar merged 2 commits into
keycloak:mainfrom
shawkins:iss48650
May 22, 2026
Merged

vmuzikar merged 2 commits into
keycloak:mainfrom
shawkins:iss48650

Conversation

@shawkins
Copy link
Copy Markdown
Contributor

closes: #48650

Uses a beanparam with a builder, rather than adding more direct parameters to the getClients end point. Ideally this will be reused across all of our resource types for projection, querying, offset, and ordering. I'm not sure about limit as we may need a different default or hard maximum per resource type and may want that metadata to on the parameters, not the method.

If we try to more kube or scim like, the ClientApi, and ClientsApi would similarly be abstracted and parameterized around the type. However that also implications for generating the metadata or providing discovery services which are not currently in scope for admin api v2.

@shawkins
shawkins requested review from a team as code owners May 18, 2026 16:40
@shawkins
shawkins requested review from Pepo48 and vmuzikar May 18, 2026 17:04
@Pepo48 Pepo48 left a comment
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks Steve! I think this is a step in the right direction as more and more parameters are being added.

I may be missing something, thus the suggestion below is just a comment (and not a request change) to help myself to explain things better. Two questions:

  • Builder extends ListOptions meaning the Builder is a ListOptions. The build() method then returns this (the Builder), not a new immutable ListOptions instance. Doesn't this defeats the purpose?
  • a caller can do builder.build() and then still call builder.withFields(...). Doesn't this mutates the same object? (it's the same instance, right?)

@shawkins
shawkins commented May 20, 2026 •
Copy link
Copy Markdown
Contributor Author

I may be missing something, thus the suggestion below is just a comment (and not a request change) to help myself to explain things better. Two questions:

It got lost in the shuffle somewhere, but I thought I had already made a comment on the issue or the pr that this was just a "dummy" builder, and that I'd like to see if we could just use lombok, FreeBuilder, or even sundrio instead of crafting one.

As for the convention for the static method and the usage of the with prefix, I have no strong opions. I mostly wanted to have us get something in, before we started down the path of adding a bunch of default methods or null arguments.

@vmuzikar and others, we are already relying on sundrio for the operator (but it does use the with convention - I am a maintainer, so I could change that if desired). Alternatively lombok would be fine, but we're not using it anywhere in keycloak that I'm aware of.

Edit: sorry for the stream of consciousness here - I'm making things more complicated that it needs to be. I don't think we need to ensure that ListOptions are immutable and a full blown source generating annotation while nice isn't entirely needed. How about just adding fluent methods, which align with @Pepo48's suggestions?

Also I had forgotten just much boilerplate sundrio brings in, so that is a non-starter.

@shawkins
shawkins marked this pull request as draft May 20, 2026 18:03
closes: keycloak#48650

Signed-off-by: Steve Hawkins <shawkins@redhat.com>
Signed-off-by: Steve Hawkins <shawkins@redhat.com>
@shawkins
shawkins marked this pull request as ready for review May 20, 2026 19:02
@shawkins
shawkins requested a review from a team as a code owner May 20, 2026 19:02
@stianst stianst removed the team/ui label May 21, 2026
@vmuzikar vmuzikar left a comment
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM ,thanks.

@vmuzikar
vmuzikar merged commit 26ef6d1 into keycloak:main May 22, 2026
95 of 97 checks passed
@stianst stianst mentioned this pull request Jun 1, 2026
sashyo pushed a commit to tide-foundation/keycloak-IGA that referenced this pull request Jul 20, 2026
* task: using a beanparam for client listing options

closes: keycloak#48650

Signed-off-by: Steve Hawkins <shawkins@redhat.com>

* just adding fluent methods

Signed-off-by: Steve Hawkins <shawkins@redhat.com>

---------

Signed-off-by: Steve Hawkins <shawkins@redhat.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Use BeanParam instead of direct parameters

4 participants

0