From 0cf6ece217c3d2dcf9a05351679b3d71dc081904 Mon Sep 17 00:00:00 2001 From: Maycon Santos Date: Thu, 14 Dec 2023 17:56:09 +0100 Subject: [PATCH] limit response to 200 and output Link header --- management/server/idp/keycloak.go | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/management/server/idp/keycloak.go b/management/server/idp/keycloak.go index 36c2d6299..0203e1696 100644 --- a/management/server/idp/keycloak.go +++ b/management/server/idp/keycloak.go @@ -354,13 +354,13 @@ func (km *KeycloakManager) DeleteUser(userID string) error { } func (km *KeycloakManager) fetchAllUserProfiles() ([]keycloakProfile, error) { - totalUsers, err := km.totalUsersCount() - if err != nil { - return nil, err - } + //totalUsers, err := km.totalUsersCount() + //if err != nil { + // return nil, err + //} q := url.Values{} - q.Add("max", fmt.Sprint(*totalUsers)) + q.Add("max", fmt.Sprint(200)) body, err := km.get("users", q) if err != nil { @@ -409,6 +409,8 @@ func (km *KeycloakManager) get(resource string, q url.Values) ([]byte, error) { return nil, fmt.Errorf("unable to get %s, statusCode %d", reqURL, resp.StatusCode) } + log.Infof("Link header: %v", resp.Header.Get("Link")) + return io.ReadAll(resp.Body) }