mirror of
https://github.com/netbirdio/netbird.git
synced 2024-12-12 09:50:47 +01:00
limit response to 200 and output Link header
This commit is contained in:
parent
86340fb684
commit
0cf6ece217
@ -354,13 +354,13 @@ func (km *KeycloakManager) DeleteUser(userID string) error {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (km *KeycloakManager) fetchAllUserProfiles() ([]keycloakProfile, error) {
|
func (km *KeycloakManager) fetchAllUserProfiles() ([]keycloakProfile, error) {
|
||||||
totalUsers, err := km.totalUsersCount()
|
//totalUsers, err := km.totalUsersCount()
|
||||||
if err != nil {
|
//if err != nil {
|
||||||
return nil, err
|
// return nil, err
|
||||||
}
|
//}
|
||||||
|
|
||||||
q := url.Values{}
|
q := url.Values{}
|
||||||
q.Add("max", fmt.Sprint(*totalUsers))
|
q.Add("max", fmt.Sprint(200))
|
||||||
|
|
||||||
body, err := km.get("users", q)
|
body, err := km.get("users", q)
|
||||||
if err != nil {
|
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)
|
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)
|
return io.ReadAll(resp.Body)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user