From 4c8d9b6f1cc240fb232f19ffaa25f424f3f12492 Mon Sep 17 00:00:00 2001 From: jesty Date: Fri, 11 Oct 2024 12:32:03 +0200 Subject: [PATCH 1/2] AAE-26470 get less user data from keycloak in order to speedup the response --- .../services/identity/keycloak/KeycloakUserGroupManager.java | 2 +- .../services/identity/keycloak/client/KeycloakClient.java | 3 ++- .../cloud/services/identity/keycloak/KeycloakClientIT.java | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/activiti-cloud-service-common/activiti-cloud-services-common-identity-keycloak/src/main/java/org/activiti/cloud/services/identity/keycloak/KeycloakUserGroupManager.java b/activiti-cloud-service-common/activiti-cloud-services-common-identity-keycloak/src/main/java/org/activiti/cloud/services/identity/keycloak/KeycloakUserGroupManager.java index 4eccb027162..50cc3157b8f 100644 --- a/activiti-cloud-service-common/activiti-cloud-services-common-identity-keycloak/src/main/java/org/activiti/cloud/services/identity/keycloak/KeycloakUserGroupManager.java +++ b/activiti-cloud-service-common/activiti-cloud-services-common-identity-keycloak/src/main/java/org/activiti/cloud/services/identity/keycloak/KeycloakUserGroupManager.java @@ -74,7 +74,7 @@ public List getGroups() { @Override public List getUsers() { return keycloakClient - .getAllUsers(keycloakClient.countAllUsers()) + .getAllUsers(keycloakClient.countAllUsers(), true) .stream() .map(KeycloakUser::getUsername) .collect(Collectors.toList()); diff --git a/activiti-cloud-service-common/activiti-cloud-services-common-identity-keycloak/src/main/java/org/activiti/cloud/services/identity/keycloak/client/KeycloakClient.java b/activiti-cloud-service-common/activiti-cloud-services-common-identity-keycloak/src/main/java/org/activiti/cloud/services/identity/keycloak/client/KeycloakClient.java index 53177d1b5bc..6352e5331c4 100644 --- a/activiti-cloud-service-common/activiti-cloud-services-common-identity-keycloak/src/main/java/org/activiti/cloud/services/identity/keycloak/client/KeycloakClient.java +++ b/activiti-cloud-service-common/activiti-cloud-services-common-identity-keycloak/src/main/java/org/activiti/cloud/services/identity/keycloak/client/KeycloakClient.java @@ -202,7 +202,8 @@ List getUsersByGroupId( @RequestMapping(method = RequestMethod.GET, value = "/users") @Headers("Content-Type: application/json") - List getAllUsers(@RequestParam(name = "max", required = false, defaultValue = "100") Integer max); + List getAllUsers(@RequestParam(name = "max", required = false, defaultValue = "100") Integer max, + @RequestParam(name = "briefRepresentation", required = false, defaultValue = "true") boolean briefRepresentation); @RequestMapping(method = RequestMethod.GET, value = "/users/count") @Headers("Content-Type: application/json") diff --git a/activiti-cloud-service-common/activiti-cloud-services-common-identity-keycloak/src/test/java/org/activiti/cloud/services/identity/keycloak/KeycloakClientIT.java b/activiti-cloud-service-common/activiti-cloud-services-common-identity-keycloak/src/test/java/org/activiti/cloud/services/identity/keycloak/KeycloakClientIT.java index 50e08cb6c91..c3057620287 100644 --- a/activiti-cloud-service-common/activiti-cloud-services-common-identity-keycloak/src/test/java/org/activiti/cloud/services/identity/keycloak/KeycloakClientIT.java +++ b/activiti-cloud-service-common/activiti-cloud-services-common-identity-keycloak/src/test/java/org/activiti/cloud/services/identity/keycloak/KeycloakClientIT.java @@ -486,7 +486,7 @@ public void should_getGroup_By_Path() { @Test public void should_getUsers() { Integer countAllUsers = keycloakClient.countAllUsers(); - List allUsers = keycloakClient.getAllUsers(countAllUsers); + List allUsers = keycloakClient.getAllUsers(countAllUsers, true); assertThat(allUsers).hasSizeGreaterThan(0); From 685cf3e7cd0f2dcab7289621fd6d0ad8fcebc8c7 Mon Sep 17 00:00:00 2001 From: jesty Date: Fri, 11 Oct 2024 15:41:37 +0200 Subject: [PATCH 2/2] AAE-26470 get less user data from keycloak in order to speedup the response --- .../services/identity/keycloak/client/KeycloakClient.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/activiti-cloud-service-common/activiti-cloud-services-common-identity-keycloak/src/main/java/org/activiti/cloud/services/identity/keycloak/client/KeycloakClient.java b/activiti-cloud-service-common/activiti-cloud-services-common-identity-keycloak/src/main/java/org/activiti/cloud/services/identity/keycloak/client/KeycloakClient.java index 6352e5331c4..841a1a8e3f0 100644 --- a/activiti-cloud-service-common/activiti-cloud-services-common-identity-keycloak/src/main/java/org/activiti/cloud/services/identity/keycloak/client/KeycloakClient.java +++ b/activiti-cloud-service-common/activiti-cloud-services-common-identity-keycloak/src/main/java/org/activiti/cloud/services/identity/keycloak/client/KeycloakClient.java @@ -202,8 +202,10 @@ List getUsersByGroupId( @RequestMapping(method = RequestMethod.GET, value = "/users") @Headers("Content-Type: application/json") - List getAllUsers(@RequestParam(name = "max", required = false, defaultValue = "100") Integer max, - @RequestParam(name = "briefRepresentation", required = false, defaultValue = "true") boolean briefRepresentation); + List getAllUsers( + @RequestParam(name = "max", required = false, defaultValue = "100") Integer max, + @RequestParam(name = "briefRepresentation", required = false, defaultValue = "true") boolean briefRepresentation + ); @RequestMapping(method = RequestMethod.GET, value = "/users/count") @Headers("Content-Type: application/json")