fix (listing): return all resources from listing requests (#3278)

pull/3283/head
Jim 3 years ago committed by GitHub
parent 8159ddb08e
commit 2b3e50ebdd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -827,7 +827,7 @@ func (s Service) listFromRepo(ctx context.Context, authMethodId string) ([]auth.
if err != nil {
return nil, errors.Wrap(ctx, err, op)
}
pwl, err := pwRepo.ListAccounts(ctx, authMethodId)
pwl, err := pwRepo.ListAccounts(ctx, authMethodId, password.WithLimit(-1))
if err != nil {
return nil, errors.Wrap(ctx, err, op)
}
@ -839,7 +839,7 @@ func (s Service) listFromRepo(ctx context.Context, authMethodId string) ([]auth.
if err != nil {
return nil, errors.Wrap(ctx, err, op)
}
oidcl, err := oidcRepo.ListAccounts(ctx, authMethodId)
oidcl, err := oidcRepo.ListAccounts(ctx, authMethodId, oidc.WithLimit(-1))
if err != nil {
return nil, errors.Wrap(ctx, err, op)
}
@ -851,7 +851,7 @@ func (s Service) listFromRepo(ctx context.Context, authMethodId string) ([]auth.
if err != nil {
return nil, errors.Wrap(ctx, err, op)
}
ldapList, err := ldapRepo.ListAccounts(ctx, authMethodId)
ldapList, err := ldapRepo.ListAccounts(ctx, authMethodId, ldap.WithLimit(ctx, -1))
if err != nil {
return nil, errors.Wrap(ctx, err, op)
}

@ -511,7 +511,7 @@ func (s Service) listFromRepo(ctx context.Context, scopeIds []string, authResult
if err != nil {
return nil, errors.Wrap(ctx, err, op)
}
ol, err := oidcRepo.ListAuthMethods(ctx, scopeIds, oidc.WithUnauthenticatedUser(reqCtx.UserId == globals.AnonymousUserId))
ol, err := oidcRepo.ListAuthMethods(ctx, scopeIds, oidc.WithUnauthenticatedUser(reqCtx.UserId == globals.AnonymousUserId), oidc.WithLimit(-1))
if err != nil {
return nil, errors.Wrap(ctx, err, op)
}

@ -267,7 +267,7 @@ func (s Service) listFromRepo(ctx context.Context, scopeIds []string) ([]*authto
if err != nil {
return nil, err
}
ul, err := repo.ListAuthTokens(ctx, scopeIds)
ul, err := repo.ListAuthTokens(ctx, scopeIds, authtoken.WithLimit(-1))
if err != nil {
return nil, err
}

@ -307,7 +307,7 @@ func (s Service) listFromRepo(ctx context.Context, storeId string) ([]credential
if err != nil {
return nil, errors.Wrap(ctx, err, op)
}
up, err := repo.ListCredentials(ctx, storeId)
up, err := repo.ListCredentials(ctx, storeId, static.WithLimit(-1))
if err != nil {
return nil, errors.Wrap(ctx, err, op)
}

@ -363,7 +363,7 @@ func (s Service) listFromRepo(ctx context.Context, scopeIds []string) ([]credent
if err != nil {
return nil, errors.Wrap(ctx, err, op)
}
vaultCsl, err := vaultRepo.ListCredentialStores(ctx, scopeIds)
vaultCsl, err := vaultRepo.ListCredentialStores(ctx, scopeIds, vault.WithLimit(-1))
if err != nil {
return nil, errors.Wrap(ctx, err, op)
}
@ -372,7 +372,7 @@ func (s Service) listFromRepo(ctx context.Context, scopeIds []string) ([]credent
if err != nil {
return nil, errors.Wrap(ctx, err, op)
}
staticCsl, err := staticRepo.ListCredentialStores(ctx, scopeIds)
staticCsl, err := staticRepo.ListCredentialStores(ctx, scopeIds, static.WithLimit(-1))
if err != nil {
return nil, errors.Wrap(ctx, err, op)
}

@ -492,7 +492,7 @@ func (s Service) listFromRepo(ctx context.Context, scopeIds []string) ([]*iam.Gr
if err != nil {
return nil, errors.Wrap(ctx, err, op)
}
gl, err := repo.ListGroups(ctx, scopeIds)
gl, err := repo.ListGroups(ctx, scopeIds, iam.WithLimit(-1))
if err != nil {
return nil, errors.Wrap(ctx, err, op)
}

@ -444,7 +444,7 @@ func (s Service) listFromRepo(ctx context.Context, projectIds []string) ([]host.
if err != nil {
return nil, nil, err
}
ul, err := repo.ListCatalogs(ctx, projectIds)
ul, err := repo.ListCatalogs(ctx, projectIds, static.WithLimit(-1))
if err != nil {
return nil, nil, err
}
@ -456,7 +456,7 @@ func (s Service) listFromRepo(ctx context.Context, projectIds []string) ([]host.
if err != nil {
return nil, nil, err
}
pl, plgs, err := pluginRepo.ListCatalogs(ctx, projectIds)
pl, plgs, err := pluginRepo.ListCatalogs(ctx, projectIds, host.WithLimit(-1))
if err != nil {
return nil, nil, err
}

@ -633,7 +633,7 @@ func (s Service) listFromRepo(ctx context.Context, catalogId string, opt ...host
if err != nil {
return nil, nil, err
}
sl, err := repo.ListSets(ctx, catalogId)
sl, err := repo.ListSets(ctx, catalogId, static.WithLimit(-1))
if err != nil {
return nil, nil, errors.Wrap(ctx, err, op)
}
@ -645,6 +645,7 @@ func (s Service) listFromRepo(ctx context.Context, catalogId string, opt ...host
if err != nil {
return nil, nil, err
}
opt = append(opt, host.WithLimit(-1))
sl, hsplg, err := repo.ListSets(ctx, catalogId, opt...)
if err != nil {
return nil, nil, errors.Wrap(ctx, err, op)

@ -418,7 +418,7 @@ func (s Service) listFromRepo(ctx context.Context, catalogId string) ([]host.Hos
if err != nil {
return nil, nil, err
}
hl, err := repo.ListHosts(ctx, catalogId)
hl, err := repo.ListHosts(ctx, catalogId, static.WithLimit(-1))
if err != nil {
return nil, nil, err
}

@ -586,7 +586,7 @@ func (s Service) listFromRepo(ctx context.Context, authMethodId string) ([]auth.
if err != nil {
return nil, errors.Wrap(ctx, err, op)
}
oidcl, err := oidcRepo.ListManagedGroups(ctx, authMethodId)
oidcl, err := oidcRepo.ListManagedGroups(ctx, authMethodId, oidc.WithLimit(-1))
if err != nil {
return nil, errors.Wrap(ctx, err, op)
}
@ -598,7 +598,7 @@ func (s Service) listFromRepo(ctx context.Context, authMethodId string) ([]auth.
if err != nil {
return nil, errors.Wrap(ctx, err, op)
}
oidcl, err := ldapRepo.ListManagedGroups(ctx, authMethodId)
oidcl, err := ldapRepo.ListManagedGroups(ctx, authMethodId, ldap.WithLimit(ctx, -1))
if err != nil {
return nil, errors.Wrap(ctx, err, op)
}

@ -617,7 +617,7 @@ func (s Service) listFromRepo(ctx context.Context, scopeIds []string) ([]*iam.Ro
if err != nil {
return nil, err
}
rl, err := repo.ListRoles(ctx, scopeIds)
rl, err := repo.ListRoles(ctx, scopeIds, iam.WithLimit(-1))
if err != nil {
return nil, err
}

@ -666,7 +666,7 @@ func (s Service) listFromRepo(ctx context.Context, scopeIds []string) ([]*iam.Sc
if err != nil {
return nil, err
}
scps, err := repo.ListScopes(ctx, scopeIds)
scps, err := repo.ListScopes(ctx, scopeIds, iam.WithLimit(-1))
if err != nil {
return nil, handlers.ApiErrorWithCodeAndMessage(codes.Internal, "Unable to list scopes: %v", err)
}

@ -161,7 +161,7 @@ func (s Service) ListSessions(ctx context.Context, req *pbs.ListSessionsRequest)
return nil, errors.Wrap(ctx, err, op)
}
sesList, err := repo.ListSessions(ctx, session.WithTerminated(req.GetIncludeTerminated()))
sesList, err := repo.ListSessions(ctx, session.WithTerminated(req.GetIncludeTerminated()), session.WithLimit(-1))
if err != nil {
return nil, err
}

@ -492,7 +492,7 @@ func (s Service) listFromRepo(ctx context.Context, scopeIds []string) ([]*iam.Us
if err != nil {
return nil, err
}
ul, err := repo.ListUsers(ctx, scopeIds)
ul, err := repo.ListUsers(ctx, scopeIds, iam.WithLimit(-1))
if err != nil {
return nil, err
}

@ -552,7 +552,7 @@ func (s Service) listFromRepo(ctx context.Context, scopeIds []string) ([]*server
if err != nil {
return nil, err
}
wl, err := repo.ListWorkers(ctx, scopeIds, server.WithLiveness(-1))
wl, err := repo.ListWorkers(ctx, scopeIds, server.WithLiveness(-1), server.WithLimit(-1))
if err != nil {
return nil, err
}

Loading…
Cancel
Save