From 169c08fa506213cb8f174c1ff30207a91da7ec2c Mon Sep 17 00:00:00 2001 From: Ralf Haferkamp Date: Wed, 4 Dec 2024 12:08:15 +0100 Subject: [PATCH] fix(graph): Don't return OCM shares in the drives list OCM shares don't have mountpoints currently. So they're no supposed to show up in the drives list on the graph service. Fixes: #10689 --- changelog/unreleased/me_drives_ocm_shares.md | 7 +++++++ services/graph/pkg/service/v0/drives.go | 4 ++++ 2 files changed, 11 insertions(+) create mode 100644 changelog/unreleased/me_drives_ocm_shares.md diff --git a/changelog/unreleased/me_drives_ocm_shares.md b/changelog/unreleased/me_drives_ocm_shares.md new file mode 100644 index 00000000000..e5cc492309e --- /dev/null +++ b/changelog/unreleased/me_drives_ocm_shares.md @@ -0,0 +1,7 @@ +Bugfix: Fix graph drives response for federated shares + +Federated shares where erroneously showing up in the /me/drives response +on the graph API. + +https://github.com/owncloud/ocis/pull/10730 +https://github.com/owncloud/ocis/issues/10689 diff --git a/services/graph/pkg/service/v0/drives.go b/services/graph/pkg/service/v0/drives.go index 25fff8b20f8..41638dc59fe 100644 --- a/services/graph/pkg/service/v0/drives.go +++ b/services/graph/pkg/service/v0/drives.go @@ -645,6 +645,10 @@ func (g Graph) formatDrives(ctx context.Context, baseURL *url.URL, storageSpaces for i := 0; i < numWorkers; i++ { errg.Go(func() error { for storageSpace := range work { + if storageSpace.GetRoot().GetStorageId() == utils.OCMStorageProviderID { + // skip OCM shares they are no supposed to show up in the drives list + continue + } res, err := g.cs3StorageSpaceToDrive(ctx, baseURL, storageSpace, apiVersion) if err != nil { return err