How to list users?
JorenZ opened this issue · 2 comments
JorenZ commented
Describe your request
I would like to list the Harbor users using the Harbor client.
I could not find how to do this:
- the endpoint gets scraped:
GetUsers
functions callingGET /users
exist in the code.apiv1.internal.api.client.products.Client.GetUsers
exists but you cannot access this from outside the package, I think?apiv2.internal.legacyapi.client.products.Client.GetUsers
exists but you cannot access this from outside the package, I think?
apiv2.RESTClient.ListUsers
does not exist, I think?apiv2.RESTClient.GetUser
does exist but it wrapsapiv2.internal.legacyapi.client.products.Client.GetUsers
to require a username parameter; it does not allow this parameter to be empty.
Am I missing some package functionality, or is this indeed missing from the current code?
JorenZ commented
Many thanks and much respect for the very quick response! <3
robbertvdg commented
@jkmw I see that many of the User calls do not support pagination, for instance:
func (c *RESTClient) ListUsers(ctx context.Context) ([]*modelv2.UserResp, error) {
params := user.ListUsersParams{
PageSize: &c.Options.PageSize,
Q: &c.Options.Query,
Sort: &c.Options.Sort,
Context: ctx,
}
Can we maybe specify these params ourselves and add it to the function parameters?