-
Notifications
You must be signed in to change notification settings - Fork 6.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Initial pagination in the admin REST API for identity providers #22003
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@rmartinc Thanks!
It looks good to me. Added only queestion regarding "count" endpoint and also one minor inline comment/suggestion.
@Operation( summary = "Get identity providers") | ||
public Response getIdentityProviders(@Parameter(description = "Provider id") @PathParam("provider_id") String providerId) { | ||
@Operation( summary = "Get the identity provider factory for that provider id") | ||
public IdentityProviderFactory getIdentityProviders(@Parameter(description = "The provider id to get the factory") @PathParam("provider_id") String providerId) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Minor: Thanks for updating the outdated javadoc and description. But method name is still slightly outdated. This minor change to update it.
public IdentityProviderFactory getIdentityProviders(@Parameter(description = "The provider id to get the factory") @PathParam("provider_id") String providerId) { | |
public IdentityProviderFactory getIdentityProviderFactory(@Parameter(description = "The provider id to get the factory") @PathParam("provider_id") String providerId) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done!
@Produces(MediaType.APPLICATION_JSON) | ||
@Tag(name = KeycloakOpenAPI.Admin.Tags.IDENTITY_PROVIDERS) | ||
@Operation( summary = "Count identity providers") | ||
public Integer countIdentityProviders( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry I did not spot it before, but do we really need count endpoint?
I know that we have "count" for some objects, but for instance, I've checked clients (which already support pagination). And the ClientsResource
does not have any "count" endpoint for clients. It seems that admin console doesn't need it as it does not display the count of search results and count of pages for clients. It just display arrow for next page (if exists).
IMO if admin console doesn't need "count" endpoint, then my vote would be to skip "count" endpoint. I would just go for necessary minimum to have admin console working (Especially since we may migrate to "Admin REST API v2" and hence adding more unnecessary mess to admin REST API doesn't help...)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah! Okis, the I will remove the count
endpoint. I just added it because I cloned the behavior in the users endpoints.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, we're not using this at the moment. Perhaps we should, but pagination is just kinda borked in general atm. That won't change until we start working on a proper V2 API.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removed the count endpoint!
@GET | ||
@Path("instances/count") | ||
@Produces(MediaType.APPLICATION_JSON) | ||
Integer count(@QueryParam("search") String search); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See my other comment for "count" endpoint
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removed the count endpoint!
@mposolda No problem, we're always happy to review work from the community. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@rmartinc Thanks for the updates!
Do we have an issue logged somewhere to implement this in the UI as well? |
Closes #21073
Initial pagination to start working in identity providers. As you can see it's (for the moment) just a wrapper that iterates on the current complete list of identity providers. Once merged the UI team can start working on using the new endpoint and we can also start working on modifying the model API. When UI team finishes moving to the endpoint we can also start not returning the list of providers in realm endpoints. Changes from #21487:
@mposolda @jonkoops @cgeorgilakis FYI