tests (ldap managed groups): extend tests to include ldap grps for GrantsForUser(...) (#3972)

* chore (managed groups): just a small rename to improve readability

* test (aut/ldap): add a test for user grants based on ldap grp

* tests (role grant): extend TestGrantsForUser(...) to cover ldap grps

* refact (iam.(Repository).GrantsForUser): more readable grantsQuery

Convert existing CTE to use sub-selects for readability
This commit is contained in:
Jim authored and GitHub committed 2023-11-29 16:29:36 -05:00
1 parent 2e31771be3
commit 798e86cefe
5 files changed
+365 -112

No files matched your search

@@ -606,11 +606,11 @@ 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, ldap.WithLimit(ctx, -1))
ldapUl, err := ldapRepo.ListManagedGroups(ctx, authMethodId, ldap.WithLimit(ctx, -1))
if err != nil {
return nil, errors.Wrap(ctx, err, op)
}
for _, a := range oidcl {
for _, a := range ldapUl {
outUl = append(outUl, a)
}
}