keycloak/keycloak-nodejs-admin-client

kcClient.clients.listPolicies only returns 100 records max

Closed this issue · 3 comments

haymh commented

Describe the bug
kcClient.clients.listPolicies method only returns maximum 100 records.
I haven't tested findPermissions method yet, but I would expect it behaves the same since it is using same underlying API.

To Reproduce
Steps to reproduce the behavior:

  1. create more than 100 policies
  2. call kcClient.clients.listPolicies without passing search team and note the length of response is 100

Expected behavior
Expect that method to return all policies.
If there is API limitation, there should be method for getting paginated results.

Screenshots
If applicable, add screenshots to help explain your problem.

Enviroment (please complete the following information):

  • OS: MacOS
  • Keycloak 11.2
  • Library Version 1.14.5

right it should support the other params:

@QueryParam("policyId") String id,
@QueryParam("name") String name,
@QueryParam("type") String type,
@QueryParam("resource") String resource,
@QueryParam("scope") String scope,
@QueryParam("permission") Boolean permission,
@QueryParam("owner") String owner,
@QueryParam("fields") String fields,
@QueryParam("first") Integer firstResult,
@QueryParam("max") Integer maxResult

If this is being fixed, this problem seems widespread. It's the same for kcClient.users.find and kcClient.realms.findEvents.

@jewanisw yes it's limited to 100, but you can set it to something else for users and find events by setting the max for listPolicies it's missing this in the types.