Skip to content
This repository has been archived by the owner on Jul 16, 2024. It is now read-only.

Commit

Permalink
Skip computing groups when fetching all groups from grappa (cs3org#3719)
Browse files Browse the repository at this point in the history
* skip computing groups

* add changelog

* fix

* use 804d1777051c3583dfeebae467466f1316fa3583 commit
  • Loading branch information
gmgigi96 authored Mar 10, 2023
1 parent 8f0d1d7 commit af4c4c8
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
3 changes: 3 additions & 0 deletions changelog/unreleased/filter-computing-groups-grappa.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
Enhancement: Skip computing groups when fetching all groups from grappa

https://github.com/cs3org/reva/pull/3719
7 changes: 6 additions & 1 deletion pkg/cbox/group/rest/rest.go
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ func (m *manager) fetchAllGroups() {

func (m *manager) fetchAllGroupAccounts() error {
ctx := context.Background()
url := fmt.Sprintf("%s/api/v1.0/Group?field=groupIdentifier&field=displayName&field=gid", m.conf.APIBaseURL)
url := fmt.Sprintf("%s/api/v1.0/Group?field=groupIdentifier&field=displayName&field=gid&field=isComputingGroup", m.conf.APIBaseURL)

for url != "" {
result, err := m.apiTokenManager.SendAPIGetRequest(ctx, url, false)
Expand All @@ -166,6 +166,11 @@ func (m *manager) fetchAllGroupAccounts() error {
continue
}

// filter computing groups
if is, ok := groupData["isComputingGroup"].(bool); ok && is {
continue
}

_, err = m.parseAndCacheGroup(ctx, groupData)
if err != nil {
continue
Expand Down

0 comments on commit af4c4c8

Please sign in to comment.