Skip to content

Commit

Permalink
Merge pull request #3 from cernbox/grappa-membership
Browse files Browse the repository at this point in the history
Adapt to new Grappa urls for group memberships.
  • Loading branch information
glpatcern authored Aug 9, 2024
2 parents 487096e + 714ccfb commit 6003915
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion group/rest.go
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,7 @@ func (m *manager) GetMembers(ctx context.Context, gid *grouppb.GroupId) ([]*user
return users, nil
}

url := fmt.Sprintf("%s/api/v1.0/Group/%s/memberidentities/precomputed?limit=10&field=upn&field=primaryAccountEmail&field=displayName&field=uid&field=gid&field=type&field=source", m.conf.APIBaseURL, gid.OpaqueId)
url := fmt.Sprintf("%s/api/v1.0/Group/%s/memberidentities/recursive?limit=10&field=upn&field=primaryAccountEmail&field=displayName&field=uid&field=gid&field=type&field=source", m.conf.APIBaseURL, gid.OpaqueId)

var r user.IdentitiesResponse
members := []*userpb.UserId{}
Expand Down
2 changes: 1 addition & 1 deletion user/rest.go
Original file line number Diff line number Diff line change
Expand Up @@ -345,7 +345,7 @@ func (m *manager) GetUserGroups(ctx context.Context, uid *userpb.UserId) ([]stri
}

// TODO (gdelmont): support pagination! we may have problems with users having more than 1000 groups
url := fmt.Sprintf("%s/api/v1.0/Identity/%s/groups?field=displayName&recursive=true", m.conf.APIBaseURL, uid.OpaqueId)
url := fmt.Sprintf("%s/api/v1.0/Identity/%s/groups/recursive?field=displayName", m.conf.APIBaseURL, uid.OpaqueId)

var r GroupsResponse
if err := m.apiTokenManager.SendAPIGetRequest(ctx, url, false, &r); err != nil {
Expand Down

0 comments on commit 6003915

Please sign in to comment.