Repository: owncloud/ocis
Pull request #9144 (2024-05-13 11:55:09)

Added the watermark text for the Secure View mode
<!--
Thanks for submitting a change to ownCloud!

This is the bug tracker for the oCIS component. Find other components at https://github.com/owncloud/core/blob/master/.github/CONTRIBUTING.md#guidelines

For fixing potential security issues please see https://owncloud.org/security/

To make it possible for us to get your change reviewed and merged please carefully fill out the requested information below.

Please note that any kind of change needs first be submitted to the master branch which holds the next version of oCIS.

Please set the following labels:

- Set label "Status:Needs-Review" for review or "Status:In-Progress" if the PR still has open tasks.
- Assignment: assign to self
- Reviewers: pick at least one
-->

## Description
<!--- Describe your changes in detail -->
We've added the watermark text for the Secure View mode.


## Related Issue
<!--- This project only accepts pull requests related to open issues -->
<!--- If suggesting a new feature or change, please discuss it in an issue first -->
<!--- If fixing a bug, there should be an issue describing it with steps to reproduce -->
<!--- Please link to the issue here: -->
- Issue [https://github.com/owncloud/ocis/issues/9067](https://github.com/owncloud/ocis/issues/9067)

## Motivation and Context
<!--- Why is this change required? What problem does it solve? -->

## How Has This Been Tested?
<!--- Please describe in detail how you tested your changes. -->
<!--- Include details of your testing environment, and the tests you ran to -->
<!--- see how your change affects other areas of the code, etc. -->
- test environment:
- test case 1:
- test case 2:
- ...

## Screenshots (if appropriate):

## Types of changes
<!--- What types of changes does your code introduce? Put an `x` in all the boxes that apply: -->
- [ ] Bug fix (non-breaking change which fixes an issue)
- [ ] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing functionality to change)
- [ ] Technical debt
- [ ] Tests only (no source changes)

## Checklist:
<!-- Tick the checkboxes when done. -->
<!-- Raise documentation ticket in owncloud.github.io/ -->
- [ ] Code changes
- [ ] Unit tests added
- [ ] Acceptance tests added
- [ ] Documentation ticket raised: <link> 


sonarcloud[bot]: ## [![Quality Gate Passed](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/QualityGateBadge/qg-passed-20px.png 'Quality Gate Passed')](https://sonarcloud.io/dashboard?id=owncloud_ocis&pullRequest=9144) **Quality Gate passed**  
Issues  
![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/passed-16px.png '') [7 New issues](https://sonarcloud.io/project/issues?id=owncloud_ocis&pullRequest=9144&resolved=false&sinceLeakPeriod=true)  
![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/accepted-16px.png '') [0 Accepted issues](https://sonarcloud.io/component_measures?id=owncloud_ocis&pullRequest=9144&metric=new_accepted_issues&view=list)

Measures  
![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/passed-16px.png '') [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=owncloud_ocis&pullRequest=9144&resolved=false&sinceLeakPeriod=true)  
![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/passed-16px.png '') [0.0% Coverage on New Code](https://sonarcloud.io/component_measures?id=owncloud_ocis&pullRequest=9144&metric=new_coverage&view=list)  
![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/passed-16px.png '') [0.0% Duplication on New Code](https://sonarcloud.io/component_measures?id=owncloud_ocis&pullRequest=9144&metric=new_duplicated_lines_density&view=list)  
  
[See analysis details on SonarCloud](https://sonarcloud.io/dashboard?id=owncloud_ocis&pullRequest=9144)


sonarcloud[bot]: ## [![Quality Gate Passed](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/QualityGateBadge/qg-passed-20px.png 'Quality Gate Passed')](https://sonarcloud.io/dashboard?id=owncloud_ocis&pullRequest=9144) **Quality Gate passed**  
Issues  
![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/passed-16px.png '') [0 New issues](https://sonarcloud.io/project/issues?id=owncloud_ocis&pullRequest=9144&resolved=false&sinceLeakPeriod=true)  
![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/accepted-16px.png '') [0 Accepted issues](https://sonarcloud.io/component_measures?id=owncloud_ocis&pullRequest=9144&metric=new_accepted_issues&view=list)

Measures  
![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/passed-16px.png '') [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=owncloud_ocis&pullRequest=9144&resolved=false&sinceLeakPeriod=true)  
![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/passed-16px.png '') [90.0% Coverage on New Code](https://sonarcloud.io/component_measures?id=owncloud_ocis&pullRequest=9144&metric=new_coverage&view=list)  
![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/passed-16px.png '') [0.0% Duplication on New Code](https://sonarcloud.io/component_measures?id=owncloud_ocis&pullRequest=9144&metric=new_duplicated_lines_density&view=list)  
  
[See analysis details on SonarCloud](https://sonarcloud.io/dashboard?id=owncloud_ocis&pullRequest=9144)


jvillafanez: I think we should add some unit tests to cover the code. It should be easy just by copying any existing test and adjusting it.
sonarcloud[bot]: ## [![Quality Gate Passed](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/QualityGateBadge/qg-passed-20px.png 'Quality Gate Passed')](https://sonarcloud.io/dashboard?id=owncloud_ocis&pullRequest=9144) **Quality Gate passed**  
Issues  
![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/passed-16px.png '') [0 New issues](https://sonarcloud.io/project/issues?id=owncloud_ocis&pullRequest=9144&resolved=false&sinceLeakPeriod=true)  
![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/accepted-16px.png '') [0 Accepted issues](https://sonarcloud.io/component_measures?id=owncloud_ocis&pullRequest=9144&metric=new_accepted_issues&view=list)

Measures  
![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/passed-16px.png '') [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=owncloud_ocis&pullRequest=9144&resolved=false&sinceLeakPeriod=true)  
![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/passed-16px.png '') [93.3% Coverage on New Code](https://sonarcloud.io/component_measures?id=owncloud_ocis&pullRequest=9144&metric=new_coverage&view=list)  
![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/passed-16px.png '') [0.0% Duplication on New Code](https://sonarcloud.io/component_measures?id=owncloud_ocis&pullRequest=9144&metric=new_duplicated_lines_density&view=list)  
  
[See analysis details on SonarCloud](https://sonarcloud.io/dashboard?id=owncloud_ocis&pullRequest=9144)


sonarcloud[bot]: ## [![Quality Gate Passed](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/QualityGateBadge/qg-passed-20px.png 'Quality Gate Passed')](https://sonarcloud.io/dashboard?id=owncloud_ocis&pullRequest=9144) **Quality Gate passed**  
Issues  
![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/passed-16px.png '') [0 New issues](https://sonarcloud.io/project/issues?id=owncloud_ocis&pullRequest=9144&resolved=false&sinceLeakPeriod=true)  
![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/accepted-16px.png '') [0 Accepted issues](https://sonarcloud.io/component_measures?id=owncloud_ocis&pullRequest=9144&metric=new_accepted_issues&view=list)

Measures  
![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/passed-16px.png '') [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=owncloud_ocis&pullRequest=9144&resolved=false&sinceLeakPeriod=true)  
![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/passed-16px.png '') [93.3% Coverage on New Code](https://sonarcloud.io/component_measures?id=owncloud_ocis&pullRequest=9144&metric=new_coverage&view=list)  
![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/passed-16px.png '') [0.0% Duplication on New Code](https://sonarcloud.io/component_measures?id=owncloud_ocis&pullRequest=9144&metric=new_duplicated_lines_density&view=list)  
  
[See analysis details on SonarCloud](https://sonarcloud.io/dashboard?id=owncloud_ocis&pullRequest=9144)


sonarcloud[bot]: ## [![Quality Gate Passed](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/QualityGateBadge/qg-passed-20px.png 'Quality Gate Passed')](https://sonarcloud.io/dashboard?id=owncloud_ocis&pullRequest=9144) **Quality Gate passed**  
Issues  
![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/passed-16px.png '') [0 New issues](https://sonarcloud.io/project/issues?id=owncloud_ocis&pullRequest=9144&resolved=false&sinceLeakPeriod=true)  
![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/accepted-16px.png '') [0 Accepted issues](https://sonarcloud.io/component_measures?id=owncloud_ocis&pullRequest=9144&metric=new_accepted_issues&view=list)

Measures  
![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/passed-16px.png '') [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=owncloud_ocis&pullRequest=9144&resolved=false&sinceLeakPeriod=true)  
![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/passed-16px.png '') [92.3% Coverage on New Code](https://sonarcloud.io/component_measures?id=owncloud_ocis&pullRequest=9144&metric=new_coverage&view=list)  
![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/passed-16px.png '') [0.0% Duplication on New Code](https://sonarcloud.io/component_measures?id=owncloud_ocis&pullRequest=9144&metric=new_duplicated_lines_density&view=list)  
  
[See analysis details on SonarCloud](https://sonarcloud.io/dashboard?id=owncloud_ocis&pullRequest=9144)



Patch:
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 18d04551aae..38e936e73d7 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -104,7 +104,6 @@ The following sections list the changes for unreleased.
 * Enhancement - Add Link SSEs: [#8908](https://github.com/owncloud/ocis/pull/8908)
 * Enhancement - ShareeIDs in SSEs: [#8915](https://github.com/owncloud/ocis/pull/8915)
 * Enhancement - Initiator-IDs: [#8936](https://github.com/owncloud/ocis/pull/8936)
-* Enhancement - Add endpoint for getting drive items: [#8939](https://github.com/owncloud/ocis/pull/8939)
 * Enhancement - Improve infected file handling: [#8947](https://github.com/owncloud/ocis/pull/8947)
 * Enhancement - Configurable claims for auto-provisioning user accounts: [#8952](https://github.com/owncloud/ocis/pull/8952)
 * Enhancement - Bump nats-js-kv pkg: [#8953](https://github.com/owncloud/ocis/pull/8953)
@@ -601,13 +600,6 @@ The following sections list the changes for unreleased.
    https://github.com/owncloud/ocis/pull/8936
    https://github.com/owncloud/ocis/pull/8701
 
-* Enhancement - Add endpoint for getting drive items: [#8939](https://github.com/owncloud/ocis/pull/8939)
-
-   An endpoint for getting drive items via ID has been added.
-
-   https://github.com/owncloud/ocis/issues/8915
-   https://github.com/owncloud/ocis/pull/8939
-
 * Enhancement - Improve infected file handling: [#8947](https://github.com/owncloud/ocis/pull/8947)
 
    Reworks virus handling.Shows scandate and outcome on ocis storage-users uploads
diff --git a/changelog/unreleased/add-get-drive-item-endpoint.md b/changelog/unreleased/add-get-drive-item-endpoint.md
deleted file mode 100644
index c7d7d9afef3..00000000000
--- a/changelog/unreleased/add-get-drive-item-endpoint.md
+++ /dev/null
@@ -1,6 +0,0 @@
-Enhancement: Add endpoint for getting drive items
-
-An endpoint for getting drive items via ID has been added.
-
-https://github.com/owncloud/ocis/pull/8939
-https://github.com/owncloud/ocis/issues/8915
diff --git a/changelog/unreleased/enhancement-add-watermark-text.md b/changelog/unreleased/enhancement-add-watermark-text.md
new file mode 100644
index 00000000000..3ad623dd442
--- /dev/null
+++ b/changelog/unreleased/enhancement-add-watermark-text.md
@@ -0,0 +1,5 @@
+Enhancement: Add watermark text
+
+We've added the watermark text for the Secure View mode.
+
+https://github.com/owncloud/ocis/pull/9144
diff --git a/services/collaboration/pkg/connector/fileconnector.go b/services/collaboration/pkg/connector/fileconnector.go
index f8fe28d2c16..a498bc3e21c 100644
--- a/services/collaboration/pkg/connector/fileconnector.go
+++ b/services/collaboration/pkg/connector/fileconnector.go
@@ -5,6 +5,7 @@ import (
 	"encoding/hex"
 	"path"
 	"strconv"
+	"strings"
 	"time"
 
 	appproviderv1beta1 "github.com/cs3org/go-cs3apis/cs3/app/provider/v1beta1"
@@ -13,6 +14,7 @@ import (
 	rpcv1beta1 "github.com/cs3org/go-cs3apis/cs3/rpc/v1beta1"
 	providerv1beta1 "github.com/cs3org/go-cs3apis/cs3/storage/provider/v1beta1"
 	typesv1beta1 "github.com/cs3org/go-cs3apis/cs3/types/v1beta1"
+	"github.com/cs3org/reva/v2/pkg/utils"
 	"github.com/google/uuid"
 	"github.com/owncloud/ocis/v2/services/collaboration/pkg/config"
 	"github.com/owncloud/ocis/v2/services/collaboration/pkg/middleware"
@@ -521,20 +523,6 @@ func (f *FileConnector) CheckFileInfo(ctx context.Context) (FileInfo, error) {
 		SupportsLocks:   true,
 	}
 
-	switch wopiContext.ViewMode {
-	case appproviderv1beta1.ViewMode_VIEW_MODE_READ_WRITE:
-		fileInfo.SupportsUpdate = true
-		fileInfo.UserCanWrite = true
-
-	case appproviderv1beta1.ViewMode_VIEW_MODE_READ_ONLY:
-		// nothing special to do here for now
-
-	case appproviderv1beta1.ViewMode_VIEW_MODE_VIEW_ONLY:
-		fileInfo.DisableExport = true
-		fileInfo.DisableCopy = true
-		fileInfo.DisablePrint = true
-	}
-
 	// user logic from reva wopi driver #TODO: refactor
 	var isPublicShare bool = false
 	if wopiContext.User != nil {
@@ -545,13 +533,9 @@ func (f *FileConnector) CheckFileInfo(ctx context.Context) (FileInfo, error) {
 			fileInfo.UserId = hex.EncodeToString([]byte(wopiContext.User.GetId().GetOpaqueId() + "@" + wopiContext.User.GetId().GetIdp()))
 		}
 
-		if wopiContext.User.GetOpaque() != nil {
-			if _, ok := wopiContext.User.GetOpaque().GetMap()["public-share-role"]; ok {
-				isPublicShare = true
-			}
-		}
+		isPublicShare = utils.ExistsInOpaque(wopiContext.User.GetOpaque(), "public-share-role")
 		if !isPublicShare {
-			fileInfo.UserFriendlyName = wopiContext.User.GetUsername()
+			fileInfo.UserFriendlyName = wopiContext.User.GetDisplayName()
 			fileInfo.UserId = hex.EncodeToString([]byte(wopiContext.User.GetId().GetOpaqueId() + "@" + wopiContext.User.GetId().GetIdp()))
 		}
 	}
@@ -562,6 +546,31 @@ func (f *FileConnector) CheckFileInfo(ctx context.Context) (FileInfo, error) {
 		fileInfo.IsAnonymousUser = true
 	}
 
+	switch wopiContext.ViewMode {
+	case appproviderv1beta1.ViewMode_VIEW_MODE_READ_WRITE:
+		fileInfo.SupportsUpdate = true
+		fileInfo.UserCanWrite = true
+
+	case appproviderv1beta1.ViewMode_VIEW_MODE_READ_ONLY:
+		// nothing special to do here for now
+
+	case appproviderv1beta1.ViewMode_VIEW_MODE_VIEW_ONLY:
+		fileInfo.DisableExport = true
+		fileInfo.DisableCopy = true
+		fileInfo.DisablePrint = true
+		if !isPublicShare {
+			// the fileInfo.WatermarkText supported by Collabora only
+			fileInfo.WatermarkText = f.watermarkText(wopiContext.User)
+		}
+	}
+
 	logger.Debug().Msg("CheckFileInfo: success")
 	return fileInfo, nil
 }
+
+func (f *FileConnector) watermarkText(user *userv1beta1.User) string {
+	if user != nil {
+		return strings.TrimSpace(user.GetDisplayName() + " " + user.GetMail())
+	}
+	return "Watermark"
+}
diff --git a/services/graph/mocks/drives_drive_item_provider.go b/services/graph/mocks/drives_drive_item_provider.go
index 6e8d4c9d619..62c3bb7106f 100644
--- a/services/graph/mocks/drives_drive_item_provider.go
+++ b/services/graph/mocks/drives_drive_item_provider.go
@@ -27,88 +27,29 @@ func (_m *DrivesDriveItemProvider) EXPECT() *DrivesDriveItemProvider_Expecter {
 	return &DrivesDriveItemProvider_Expecter{mock: &_m.Mock}
 }
 
-// GetShare provides a mock function with given fields: ctx, shareID
-func (_m *DrivesDriveItemProvider) GetShare(ctx context.Context, shareID *collaborationv1beta1.ShareId) (*collaborationv1beta1.ReceivedShare, error) {
-	ret := _m.Called(ctx, shareID)
+// GetShareAndSiblings provides a mock function with given fields: ctx, shareID, filters
+func (_m *DrivesDriveItemProvider) GetShareAndSiblings(ctx context.Context, shareID *collaborationv1beta1.ShareId, filters []*collaborationv1beta1.Filter) ([]*collaborationv1beta1.ReceivedShare, error) {
+	ret := _m.Called(ctx, shareID, filters)
 
 	if len(ret) == 0 {
-		panic("no return value specified for GetShare")
-	}
-
-	var r0 *collaborationv1beta1.ReceivedShare
-	var r1 error
-	if rf, ok := ret.Get(0).(func(context.Context, *collaborationv1beta1.ShareId) (*collaborationv1beta1.ReceivedShare, error)); ok {
-		return rf(ctx, shareID)
-	}
-	if rf, ok := ret.Get(0).(func(context.Context, *collaborationv1beta1.ShareId) *collaborationv1beta1.ReceivedShare); ok {
-		r0 = rf(ctx, shareID)
-	} else {
-		if ret.Get(0) != nil {
-			r0 = ret.Get(0).(*collaborationv1beta1.ReceivedShare)
-		}
-	}
-
-	if rf, ok := ret.Get(1).(func(context.Context, *collaborationv1beta1.ShareId) error); ok {
-		r1 = rf(ctx, shareID)
-	} else {
-		r1 = ret.Error(1)
-	}
-
-	return r0, r1
-}
-
-// DrivesDriveItemProvider_GetShare_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetShare'
-type DrivesDriveItemProvider_GetShare_Call struct {
-	*mock.Call
-}
-
-// GetShare is a helper method to define mock.On call
-//   - ctx context.Context
-//   - shareID *collaborationv1beta1.ShareId
-func (_e *DrivesDriveItemProvider_Expecter) GetShare(ctx interface{}, shareID interface{}) *DrivesDriveItemProvider_GetShare_Call {
-	return &DrivesDriveItemProvider_GetShare_Call{Call: _e.mock.On("GetShare", ctx, shareID)}
-}
-
-func (_c *DrivesDriveItemProvider_GetShare_Call) Run(run func(ctx context.Context, shareID *collaborationv1beta1.ShareId)) *DrivesDriveItemProvider_GetShare_Call {
-	_c.Call.Run(func(args mock.Arguments) {
-		run(args[0].(context.Context), args[1].(*collaborationv1beta1.ShareId))
-	})
-	return _c
-}
-
-func (_c *DrivesDriveItemProvider_GetShare_Call) Return(_a0 *collaborationv1beta1.ReceivedShare, _a1 error) *DrivesDriveItemProvider_GetShare_Call {
-	_c.Call.Return(_a0, _a1)
-	return _c
-}
-
-func (_c *DrivesDriveItemProvider_GetShare_Call) RunAndReturn(run func(context.Context, *collaborationv1beta1.ShareId) (*collaborationv1beta1.ReceivedShare, error)) *DrivesDriveItemProvider_GetShare_Call {
-	_c.Call.Return(run)
-	return _c
-}
-
-// GetSharesForResource provides a mock function with given fields: ctx, resourceID, filters
-func (_m *DrivesDriveItemProvider) GetSharesForResource(ctx context.Context, resourceID *providerv1beta1.ResourceId, filters []*collaborationv1beta1.Filter) ([]*collaborationv1beta1.ReceivedShare, error) {
-	ret := _m.Called(ctx, resourceID, filters)
-
-	if len(ret) == 0 {
-		panic("no return value specified for GetSharesForResource")
+		panic("no return value specified for GetShareAndSiblings")
 	}
 
 	var r0 []*collaborationv1beta1.ReceivedShare
 	var r1 error
-	if rf, ok := ret.Get(0).(func(context.Context, *providerv1beta1.ResourceId, []*collaborationv1beta1.Filter) ([]*collaborationv1beta1.ReceivedShare, error)); ok {
-		return rf(ctx, resourceID, filters)
+	if rf, ok := ret.Get(0).(func(context.Context, *collaborationv1beta1.ShareId, []*collaborationv1beta1.Filter) ([]*collaborationv1beta1.ReceivedShare, error)); ok {
+		return rf(ctx, shareID, filters)
 	}
-	if rf, ok := ret.Get(0).(func(context.Context, *providerv1beta1.ResourceId, []*collaborationv1beta1.Filter) []*collaborationv1beta1.ReceivedShare); ok {
-		r0 = rf(ctx, resourceID, filters)
+	if rf, ok := ret.Get(0).(func(context.Context, *collaborationv1beta1.ShareId, []*collaborationv1beta1.Filter) []*collaborationv1beta1.ReceivedShare); ok {
+		r0 = rf(ctx, shareID, filters)
 	} else {
 		if ret.Get(0) != nil {
 			r0 = ret.Get(0).([]*collaborationv1beta1.ReceivedShare)
 		}
 	}
 
-	if rf, ok := ret.Get(1).(func(context.Context, *providerv1beta1.ResourceId, []*collaborationv1beta1.Filter) error); ok {
-		r1 = rf(ctx, resourceID, filters)
+	if rf, ok := ret.Get(1).(func(context.Context, *collaborationv1beta1.ShareId, []*collaborationv1beta1.Filter) error); ok {
+		r1 = rf(ctx, shareID, filters)
 	} else {
 		r1 = ret.Error(1)
 	}
@@ -116,32 +57,32 @@ func (_m *DrivesDriveItemProvider) GetSharesForResource(ctx context.Context, res
 	return r0, r1
 }
 
-// DrivesDriveItemProvider_GetSharesForResource_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetSharesForResource'
-type DrivesDriveItemProvider_GetSharesForResource_Call struct {
+// DrivesDriveItemProvider_GetShareAndSiblings_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetShareAndSiblings'
+type DrivesDriveItemProvider_GetShareAndSiblings_Call struct {
 	*mock.Call
 }
 
-// GetSharesForResource is a helper method to define mock.On call
+// GetShareAndSiblings is a helper method to define mock.On call
 //   - ctx context.Context
-//   - resourceID *providerv1beta1.ResourceId
+//   - shareID *collaborationv1beta1.ShareId
 //   - filters []*collaborationv1beta1.Filter
-func (_e *DrivesDriveItemProvider_Expecter) GetSharesForResource(ctx interface{}, resourceID interface{}, filters interface{}) *DrivesDriveItemProvider_GetSharesForResource_Call {
-	return &DrivesDriveItemProvider_GetSharesForResource_Call{Call: _e.mock.On("GetSharesForResource", ctx, resourceID, filters)}
+func (_e *DrivesDriveItemProvider_Expecter) GetShareAndSiblings(ctx interface{}, shareID interface{}, filters interface{}) *DrivesDriveItemProvider_GetShareAndSiblings_Call {
+	return &DrivesDriveItemProvider_GetShareAndSiblings_Call{Call: _e.mock.On("GetShareAndSiblings", ctx, shareID, filters)}
 }
 
-func (_c *DrivesDriveItemProvider_GetSharesForResource_Call) Run(run func(ctx context.Context, resourceID *providerv1beta1.ResourceId, filters []*collaborationv1beta1.Filter)) *DrivesDriveItemProvider_GetSharesForResource_Call {
+func (_c *DrivesDriveItemProvider_GetShareAndSiblings_Call) Run(run func(ctx context.Context, shareID *collaborationv1beta1.ShareId, filters []*collaborationv1beta1.Filter)) *DrivesDriveItemProvider_GetShareAndSiblings_Call {
 	_c.Call.Run(func(args mock.Arguments) {
-		run(args[0].(context.Context), args[1].(*providerv1beta1.ResourceId), args[2].([]*collaborationv1beta1.Filter))
+		run(args[0].(context.Context), args[1].(*collaborationv1beta1.ShareId), args[2].([]*collaborationv1beta1.Filter))
 	})
 	return _c
 }
 
-func (_c *DrivesDriveItemProvider_GetSharesForResource_Call) Return(_a0 []*collaborationv1beta1.ReceivedShare, _a1 error) *DrivesDriveItemProvider_GetSharesForResource_Call {
+func (_c *DrivesDriveItemProvider_GetShareAndSiblings_Call) Return(_a0 []*collaborationv1beta1.ReceivedShare, _a1 error) *DrivesDriveItemProvider_GetShareAndSiblings_Call {
 	_c.Call.Return(_a0, _a1)
 	return _c
 }
 
-func (_c *DrivesDriveItemProvider_GetSharesForResource_Call) RunAndReturn(run func(context.Context, *providerv1beta1.ResourceId, []*collaborationv1beta1.Filter) ([]*collaborationv1beta1.ReceivedShare, error)) *DrivesDriveItemProvider_GetSharesForResource_Call {
+func (_c *DrivesDriveItemProvider_GetShareAndSiblings_Call) RunAndReturn(run func(context.Context, *collaborationv1beta1.ShareId, []*collaborationv1beta1.Filter) ([]*collaborationv1beta1.ReceivedShare, error)) *DrivesDriveItemProvider_GetShareAndSiblings_Call {
 	_c.Call.Return(run)
 	return _c
 }
diff --git a/services/graph/pkg/identity/ldap.go b/services/graph/pkg/identity/ldap.go
index dea9f3a6d7e..efa2fd793f5 100644
--- a/services/graph/pkg/identity/ldap.go
+++ b/services/graph/pkg/identity/ldap.go
@@ -21,9 +21,8 @@ import (
 )
 
 const (
-	_givenNameAttribute  = "givenname"
-	_surNameAttribute    = "sn"
-	_identitiesAttribute = "oCExternalIdentity"
+	_givenNameAttribute = "givenname"
+	_surNameAttribute   = "sn"
 )
 
 // DisableUserMechanismType is used instead of directly using the string values from the configuration.
@@ -82,7 +81,6 @@ type userAttributeMap struct {
 	surname        string
 	accountEnabled string
 	userType       string
-	identities     string
 }
 
 type ldapAttributeValues map[string][]string
@@ -116,7 +114,6 @@ func NewLDAPBackend(lc ldap.Client, config config.LDAP, logger *log.Logger) (*LD
 		givenName:      _givenNameAttribute,
 		surname:        _surNameAttribute,
 		userType:       config.UserTypeAttribute,
-		identities:     _identitiesAttribute,
 	}
 
 	if config.GroupNameAttribute == "" || config.GroupIDAttribute == "" {
@@ -341,19 +338,6 @@ func (i *LDAP) UpdateUser(ctx context.Context, nameOrID string, user libregraph.
 		}
 	}
 
-	if identities, ok := user.GetIdentitiesOk(); ok {
-		attrValues := make([]string, 0, len(identities))
-		for _, identity := range identities {
-			identityStr, err := i.identityToLDAPAttrValue(identity)
-			if err != nil {
-				return nil, err
-			}
-			attrValues = append(attrValues, identityStr)
-		}
-		mr.Replace(i.userAttributeMap.identities, attrValues)
-		updateNeeded = true
-	}
-
 	// Behavior of enabling/disabling of users depends on the "disableUserMechanism" config option:
 	//
 	// "attribute": For the upstream user management service which modifies accountEnabled on the user entry
@@ -411,7 +395,6 @@ func (i *LDAP) getUserByDN(dn string) (*ldap.Entry, error) {
 		i.userAttributeMap.givenName,
 		i.userAttributeMap.accountEnabled,
 		i.userAttributeMap.userType,
-		i.userAttributeMap.identities,
 	}
 
 	filter := fmt.Sprintf("(objectClass=%s)", i.userObjectClass)
@@ -536,9 +519,9 @@ func (i *LDAP) getLDAPUserByFilter(filter string) (*ldap.Entry, error) {
 		i.userAttributeMap.userName,
 		i.userAttributeMap.surname,
 		i.userAttributeMap.givenName,
+
 		i.userAttributeMap.accountEnabled,
 		i.userAttributeMap.userType,
-		i.userAttributeMap.identities,
 	}
 	return i.searchLDAPEntryByFilter(i.userBaseDN, attrs, filter)
 }
@@ -618,7 +601,6 @@ func (i *LDAP) GetUsers(ctx context.Context, oreq *godata.GoDataRequest) ([]*lib
 			i.userAttributeMap.givenName,
 			i.userAttributeMap.accountEnabled,
 			i.userAttributeMap.userType,
-			i.userAttributeMap.identities,
 		},
 		nil,
 	)
@@ -803,7 +785,7 @@ func (i *LDAP) createUserModelFromLDAP(e *ldap.Entry) *libregraph.User {
 	surname := e.GetEqualFoldAttributeValue(i.userAttributeMap.surname)
 
 	if id != "" && opsan != "" {
-		user := &libregraph.User{
+		return &libregraph.User{
 			DisplayName:              pointerOrNil(e.GetEqualFoldAttributeValue(i.userAttributeMap.displayName)),
 			Mail:                     pointerOrNil(e.GetEqualFoldAttributeValue(i.userAttributeMap.mail)),
 			OnPremisesSamAccountName: &opsan,
@@ -813,18 +795,6 @@ func (i *LDAP) createUserModelFromLDAP(e *ldap.Entry) *libregraph.User {
 			UserType:                 pointerOrNil(e.GetEqualFoldAttributeValue(i.userAttributeMap.userType)),
 			AccountEnabled:           booleanOrNil(e.GetEqualFoldAttributeValue(i.userAttributeMap.accountEnabled)),
 		}
-		var identities []libregraph.ObjectIdentity
-		for _, identityStr := range e.GetEqualFoldAttributeValues(i.userAttributeMap.identities) {
-			parts := strings.SplitN(identityStr, "$", 3)
-			identity := libregraph.NewObjectIdentity()
-			identity.SetIssuer(strings.TrimSpace(parts[1]))
-			identity.SetIssuerAssignedId(strings.TrimSpace(parts[2]))
-			identities = append(identities, *identity)
-		}
-		if len(identities) > 0 {
-			user.SetIdentities(identities)
-		}
-		return user
 	}
 	i.logger.Warn().Str("dn", e.DN).Msg("Invalid User. Missing username or id attribute")
 	return nil
@@ -840,19 +810,6 @@ func (i *LDAP) userToLDAPAttrValues(user libregraph.User) (map[string][]string,
 		i.userAttributeMap.userType:    {user.GetUserType()},
 	}
 
-	if identities, ok := user.GetIdentitiesOk(); ok {
-		for _, identity := range identities {
-			identityStr, err := i.identityToLDAPAttrValue(identity)
-			if err != nil {
-				return nil, err
-			}
-			attrs[i.userAttributeMap.identities] = append(
-				attrs[i.userAttributeMap.identities],
-				identityStr,
-			)
-		}
-	}
-
 	if !i.useServerUUID {
 		attrs["owncloudUUID"] = []string{uuid.New().String()}
 	}
@@ -887,15 +844,6 @@ func (i *LDAP) userToLDAPAttrValues(user libregraph.User) (map[string][]string,
 	return attrs, nil
 }
 
-func (i *LDAP) identityToLDAPAttrValue(identity libregraph.ObjectIdentity) (string, error) {
-	// TODO add support for the "signInType" of objectIdentity
-	if identity.GetIssuer() == "" || identity.GetIssuerAssignedId() == "" {
-		return "", fmt.Errorf("missing Attribute for objectIdentity")
-	}
-	identityStr := fmt.Sprintf(" $ %s $ %s", identity.GetIssuer(), identity.GetIssuerAssignedId())
-	return identityStr, nil
-}
-
 func (i *LDAP) getUserAttrTypes() []string {
 	return []string{
 		i.userAttributeMap.displayName,
@@ -909,7 +857,6 @@ func (i *LDAP) getUserAttrTypes() []string {
 		"userPassword",
 		i.userAttributeMap.accountEnabled,
 		i.userAttributeMap.userType,
-		i.userAttributeMap.identities,
 	}
 }
 
diff --git a/services/graph/pkg/identity/ldap_education_user.go b/services/graph/pkg/identity/ldap_education_user.go
index 02814a1c089..1ea76ca4e7a 100644
--- a/services/graph/pkg/identity/ldap_education_user.go
+++ b/services/graph/pkg/identity/ldap_education_user.go
@@ -4,6 +4,7 @@ import (
 	"context"
 	"errors"
 	"fmt"
+	"strings"
 
 	"github.com/go-ldap/ldap/v3"
 	libregraph "github.com/owncloud/libre-graph-api-go"
@@ -11,11 +12,13 @@ import (
 )
 
 type educationUserAttributeMap struct {
+	identities  string
 	primaryRole string
 }
 
 func newEducationUserAttributeMap() educationUserAttributeMap {
 	return educationUserAttributeMap{
+		identities:  "oCExternalIdentity",
 		primaryRole: "userClass",
 	}
 }
@@ -161,7 +164,7 @@ func (i *LDAP) UpdateEducationUser(ctx context.Context, nameOrID string, user li
 			}
 			attrValues = append(attrValues, identityStr)
 		}
-		mr.Replace(i.userAttributeMap.identities, attrValues)
+		mr.Replace(i.educationConfig.userAttributeMap.identities, attrValues)
 		updateNeeded = true
 	}
 
@@ -258,7 +261,6 @@ func (i *LDAP) educationUserToUser(eduUser libregraph.EducationUser) *libregraph
 	user.DisplayName = eduUser.DisplayName
 	user.Mail = eduUser.Mail
 	user.UserType = eduUser.UserType
-	user.Identities = eduUser.Identities
 
 	return user
 }
@@ -279,6 +281,17 @@ func (i *LDAP) userToEducationUser(user libregraph.User, e *ldap.Entry) *libregr
 		if primaryRole := e.GetEqualFoldAttributeValue(i.educationConfig.userAttributeMap.primaryRole); primaryRole != "" {
 			eduUser.SetPrimaryRole(primaryRole)
 		}
+		var identities []libregraph.ObjectIdentity
+		for _, identityStr := range e.GetEqualFoldAttributeValues(i.educationConfig.userAttributeMap.identities) {
+			parts := strings.SplitN(identityStr, "$", 3)
+			identity := libregraph.NewObjectIdentity()
+			identity.SetIssuer(strings.TrimSpace(parts[1]))
+			identity.SetIssuerAssignedId(strings.TrimSpace(parts[2]))
+			identities = append(identities, *identity)
+		}
+		if len(identities) > 0 {
+			eduUser.SetIdentities(identities)
+		}
 	}
 
 	return eduUser
@@ -288,9 +301,29 @@ func (i *LDAP) educationUserToLDAPAttrValues(user libregraph.EducationUser, attr
 	if role, ok := user.GetPrimaryRoleOk(); ok {
 		attrs[i.educationConfig.userAttributeMap.primaryRole] = []string{*role}
 	}
+	if identities, ok := user.GetIdentitiesOk(); ok {
+		for _, identity := range identities {
+			identityStr, err := i.identityToLDAPAttrValue(identity)
+			if err != nil {
+				return nil, err
+			}
+			attrs[i.educationConfig.userAttributeMap.identities] = append(
+				attrs[i.educationConfig.userAttributeMap.identities],
+				identityStr,
+			)
+		}
+	}
 	attrs["objectClass"] = append(attrs["objectClass"], i.educationConfig.userObjectClass)
 	return attrs, nil
 }
+func (i *LDAP) identityToLDAPAttrValue(identity libregraph.ObjectIdentity) (string, error) {
+	// TODO add support for the "signInType" of objectIdentity
+	if identity.GetIssuer() == "" || identity.GetIssuerAssignedId() == "" {
+		return "", fmt.Errorf("missing Attribute for objectIdentity")
+	}
+	identityStr := fmt.Sprintf(" $ %s $ %s", identity.GetIssuer(), identity.GetIssuerAssignedId())
+	return identityStr, nil
+}
 
 func (i *LDAP) educationUserToAddRequest(user libregraph.EducationUser) (*ldap.AddRequest, error) {
 	plainUser := i.educationUserToUser(user)
@@ -326,7 +359,7 @@ func (i *LDAP) getEducationUserAttrTypes() []string {
 		i.userAttributeMap.givenName,
 		i.userAttributeMap.accountEnabled,
 		i.userAttributeMap.userType,
-		i.userAttributeMap.identities,
+		i.educationConfig.userAttributeMap.identities,
 		i.educationConfig.userAttributeMap.primaryRole,
 		i.educationConfig.memberOfSchoolAttribute,
 	}
diff --git a/services/graph/pkg/service/v0/api_drives_drive_item.go b/services/graph/pkg/service/v0/api_drives_drive_item.go
index 04d0af046fc..f49786cd543 100644
--- a/services/graph/pkg/service/v0/api_drives_drive_item.go
+++ b/services/graph/pkg/service/v0/api_drives_drive_item.go
@@ -33,37 +33,38 @@ var (
 	// ErrNoUpdater is returned when no updater is provided
 	ErrNoUpdater = errors.New("no updater")
 
+	// ErrNoShares is returned when no shares are found
+	ErrNoShares = errors.New("no shares found")
+
 	// ErrAbsoluteNamePath is returned when the name is an absolute path
 	ErrAbsoluteNamePath = errors.New("name cannot be an absolute path")
 
-	// ErrCode errors
-
 	// ErrNotAShareJail is returned when the driveID does not belong to a share jail
-	ErrNotAShareJail = errorcode.New(errorcode.InvalidRequest, "id does not belong to a share jail")
+	ErrNotAShareJail = errors.New("id does not belong to a share jail")
 
 	// ErrInvalidDriveIDOrItemID is returned when the driveID or itemID is invalid
-	ErrInvalidDriveIDOrItemID = errorcode.New(errorcode.InvalidRequest, "invalid driveID or itemID")
+	ErrInvalidDriveIDOrItemID = errors.New("invalid driveID or itemID")
 
 	// ErrInvalidRequestBody is returned when the request body is invalid
-	ErrInvalidRequestBody = errorcode.New(errorcode.InvalidRequest, "invalid request body")
+	ErrInvalidRequestBody = errors.New("invalid request body")
 
 	// ErrUnmountShare is returned when unmounting a share fails
-	ErrUnmountShare = errorcode.New(errorcode.InvalidRequest, "unmounting share failed")
+	ErrUnmountShare = errors.New("unmounting share failed")
 
 	// ErrMountShare is returned when mounting a share fails
-	ErrMountShare = errorcode.New(errorcode.InvalidRequest, "mounting share failed")
+	ErrMountShare = errors.New("mounting share failed")
+
+	// ErrGetShareAndSiblings is returned when getting the share and siblings fails
+	ErrGetShareAndSiblings = errors.New("failed to get share and siblings")
 
 	// ErrUpdateShares is returned when updating shares fails
-	ErrUpdateShares = errorcode.New(errorcode.InvalidRequest, "failed to update share")
+	ErrUpdateShares = errors.New("failed to update share")
 
 	// ErrInvalidID is returned when the id is invalid
-	ErrInvalidID = errorcode.New(errorcode.InvalidRequest, "invalid id")
+	ErrInvalidID = errors.New("invalid id")
 
 	// ErrDriveItemConversion is returned when converting to drive items fails
-	ErrDriveItemConversion = errorcode.New(errorcode.InvalidRequest, "converting to drive items failed")
-
-	// ErrNoShares is returned when no shares are found
-	ErrNoShares = errorcode.New(errorcode.ItemNotFound, "no shares found")
+	ErrDriveItemConversion = errors.New("converting to drive items failed")
 )
 
 type (
@@ -81,11 +82,8 @@ type (
 		// UpdateShares updates multiple shares
 		UpdateShares(ctx context.Context, shares []*collaboration.ReceivedShare, updater UpdateShareClosure) ([]*collaboration.ReceivedShare, error)
 
-		// GetShare returns the share
-		GetShare(ctx context.Context, shareID *collaboration.ShareId) (*collaboration.ReceivedShare, error)
-
-		// GetSharesForResource returns all shares for a given resourceID
-		GetSharesForResource(ctx context.Context, resourceID *storageprovider.ResourceId, filters []*collaboration.Filter) ([]*collaboration.ReceivedShare, error)
+		// GetShareAndSiblings returns the share and all its siblings
+		GetShareAndSiblings(ctx context.Context, shareID *collaboration.ShareId, filters []*collaboration.Filter) ([]*collaboration.ReceivedShare, error)
 	}
 )
 
@@ -103,7 +101,8 @@ func NewDrivesDriveItemService(logger log.Logger, gatewaySelector pool.Selectabl
 	}, nil
 }
 
-func (s DrivesDriveItemService) GetShare(ctx context.Context, shareID *collaboration.ShareId) (*collaboration.ReceivedShare, error) {
+// GetShareAndSiblings returns the share and all its siblings
+func (s DrivesDriveItemService) GetShareAndSiblings(ctx context.Context, shareID *collaboration.ShareId, filters []*collaboration.Filter) ([]*collaboration.ReceivedShare, error) {
 	gatewayClient, err := s.gatewaySelector.Next()
 	if err != nil {
 		return nil, err
@@ -119,12 +118,15 @@ func (s DrivesDriveItemService) GetShare(ctx context.Context, shareID *collabora
 			},
 		},
 	)
+	if err := errorcode.FromCS3Status(getReceivedShareResponse.GetStatus(), err); err != nil {
+		return nil, err
+	}
 
-	return getReceivedShareResponse.GetShare(), errorcode.FromCS3Status(getReceivedShareResponse.GetStatus(), err)
+	return s.GetSharesByResourceID(ctx, getReceivedShareResponse.GetShare().GetShare().GetResourceId(), filters)
 }
 
-// GetSharesForResource returns all shares for a given resourceID
-func (s DrivesDriveItemService) GetSharesForResource(ctx context.Context, resourceID *storageprovider.ResourceId, filters []*collaboration.Filter) ([]*collaboration.ReceivedShare, error) {
+// GetSharesByResourceID returns all shares for a given resourceID
+func (s DrivesDriveItemService) GetSharesByResourceID(ctx context.Context, resourceID *storageprovider.ResourceId, filters []*collaboration.Filter) ([]*collaboration.ReceivedShare, error) {
 	// Find all accepted shares for this resource
 	gatewayClient, err := s.gatewaySelector.Next()
 	if err != nil {
@@ -209,12 +211,7 @@ func (s DrivesDriveItemService) UpdateShare(ctx context.Context, share *collabor
 
 // UnmountShare unmounts a share
 func (s DrivesDriveItemService) UnmountShare(ctx context.Context, shareID *collaboration.ShareId) error {
-	share, err := s.GetShare(ctx, shareID)
-	if err != nil {
-		return err
-	}
-
-	availableShares, err := s.GetSharesForResource(ctx, share.GetShare().GetResourceId(), []*collaboration.Filter{
+	availableShares, err := s.GetShareAndSiblings(ctx, shareID, []*collaboration.Filter{
 		{
 			Type: collaboration.Filter_TYPE_STATE,
 			Term: &collaboration.Filter_State{
@@ -246,7 +243,7 @@ func (s DrivesDriveItemService) MountShare(ctx context.Context, resourceID *stor
 		name = filepath.Clean(name)
 	}
 
-	availableShares, err := s.GetSharesForResource(ctx, resourceID, []*collaboration.Filter{
+	availableShares, err := s.GetSharesByResourceID(ctx, resourceID, []*collaboration.Filter{
 		{
 			Type: collaboration.Filter_TYPE_STATE,
 			Term: &collaboration.Filter_State{
@@ -316,20 +313,20 @@ func (api DrivesDriveItemApi) DeleteDriveItem(w http.ResponseWriter, r *http.Req
 	driveID, itemID, err := GetDriveAndItemIDParam(r, &api.logger)
 	if err != nil {
 		api.logger.Debug().Err(err).Msg(ErrInvalidDriveIDOrItemID.Error())
-		ErrInvalidDriveIDOrItemID.Render(w, r)
+		errorcode.InvalidRequest.Render(w, r, http.StatusUnprocessableEntity, ErrInvalidDriveIDOrItemID.Error())
 		return
 	}
 
 	if !IsShareJail(driveID) {
 		api.logger.Debug().Interface("driveID", driveID).Msg(ErrNotAShareJail.Error())
-		ErrNotAShareJail.Render(w, r)
+		errorcode.InvalidRequest.Render(w, r, http.StatusUnprocessableEntity, ErrNotAShareJail.Error())
 		return
 	}
 
 	shareID := ExtractShareIdFromResourceId(itemID)
 	if err := api.drivesDriveItemService.UnmountShare(ctx, shareID); err != nil {
 		api.logger.Debug().Err(err).Msg(ErrUnmountShare.Error())
-		ErrUnmountShare.Render(w, r)
+		errorcode.InvalidRequest.Render(w, r, http.StatusFailedDependency, ErrUnmountShare.Error())
 		return
 	}
 
@@ -337,65 +334,18 @@ func (api DrivesDriveItemApi) DeleteDriveItem(w http.ResponseWriter, r *http.Req
 	render.NoContent(w, r)
 }
 
-// GetDriveItem get a drive item
-func (api DrivesDriveItemApi) GetDriveItem(w http.ResponseWriter, r *http.Request) {
-	driveID, itemID, err := GetDriveAndItemIDParam(r, &api.logger)
-	if err != nil {
-		api.logger.Debug().Err(err).Msg(ErrInvalidDriveIDOrItemID.Error())
-		ErrInvalidDriveIDOrItemID.Render(w, r)
-		return
-	}
-
-	if !IsShareJail(driveID) {
-		api.logger.Debug().Interface("driveID", driveID).Msg(ErrNotAShareJail.Error())
-		ErrNotAShareJail.Render(w, r)
-		return
-	}
-
-	shareID := ExtractShareIdFromResourceId(itemID)
-	share, err := api.drivesDriveItemService.GetShare(r.Context(), shareID)
-	if err != nil {
-		api.logger.Debug().Err(err).Msg(ErrNoShares.Error())
-		ErrNoShares.Render(w, r)
-		return
-	}
-
-	availableShares, err := api.drivesDriveItemService.GetSharesForResource(r.Context(), share.GetShare().GetResourceId(), nil)
-	if err != nil {
-		api.logger.Debug().Err(err).Msg(ErrNoShares.Error())
-		ErrNoShares.Render(w, r)
-		return
-	}
-
-	driveItems, err := api.baseGraphService.CS3ReceivedSharesToDriveItems(r.Context(), availableShares)
-	switch {
-	case err != nil:
-		break
-	case len(driveItems) != 1:
-		err = ErrDriveItemConversion
-	}
-	if err != nil {
-		api.logger.Debug().Err(err).Msg(ErrDriveItemConversion.Error())
-		ErrDriveItemConversion.Render(w, r)
-		return
-	}
-
-	render.Status(r, http.StatusOK)
-	render.JSON(w, r, driveItems[0])
-}
-
 // UpdateDriveItem updates a drive item, currently only the visibility of the share is updated
 func (api DrivesDriveItemApi) UpdateDriveItem(w http.ResponseWriter, r *http.Request) {
 	driveID, itemID, err := GetDriveAndItemIDParam(r, &api.logger)
 	if err != nil {
 		api.logger.Debug().Err(err).Msg(ErrInvalidDriveIDOrItemID.Error())
-		ErrInvalidDriveIDOrItemID.Render(w, r)
+		errorcode.InvalidRequest.Render(w, r, http.StatusUnprocessableEntity, ErrInvalidDriveIDOrItemID.Error())
 		return
 	}
 
 	if !IsShareJail(driveID) {
 		api.logger.Debug().Interface("driveID", driveID).Msg(ErrNotAShareJail.Error())
-		ErrNotAShareJail.Render(w, r)
+		errorcode.InvalidRequest.Render(w, r, http.StatusUnprocessableEntity, ErrNotAShareJail.Error())
 		return
 	}
 
@@ -403,21 +353,14 @@ func (api DrivesDriveItemApi) UpdateDriveItem(w http.ResponseWriter, r *http.Req
 	requestDriveItem := libregraph.DriveItem{}
 	if err := StrictJSONUnmarshal(r.Body, &requestDriveItem); err != nil {
 		api.logger.Debug().Err(err).Msg(ErrInvalidRequestBody.Error())
-		ErrInvalidRequestBody.Render(w, r)
+		errorcode.InvalidRequest.Render(w, r, http.StatusUnprocessableEntity, ErrInvalidRequestBody.Error())
 		return
 	}
 
-	share, err := api.drivesDriveItemService.GetShare(r.Context(), shareID)
+	availableShares, err := api.drivesDriveItemService.GetShareAndSiblings(r.Context(), shareID, nil)
 	if err != nil {
-		api.logger.Debug().Err(err).Msg(ErrNoShares.Error())
-		ErrNoShares.Render(w, r)
-		return
-	}
-
-	availableShares, err := api.drivesDriveItemService.GetSharesForResource(r.Context(), share.GetShare().GetResourceId(), nil)
-	if err != nil {
-		api.logger.Debug().Err(err).Msg(ErrNoShares.Error())
-		ErrNoShares.Render(w, r)
+		api.logger.Debug().Err(err).Msg(ErrGetShareAndSiblings.Error())
+		errorcode.InvalidRequest.Render(w, r, http.StatusFailedDependency, ErrGetShareAndSiblings.Error())
 		return
 	}
 
@@ -429,27 +372,20 @@ func (api DrivesDriveItemApi) UpdateDriveItem(w http.ResponseWriter, r *http.Req
 			request.UpdateMask.Paths = append(request.UpdateMask.Paths, _fieldMaskPathHidden)
 		},
 	)
-	if err != nil {
-		api.logger.Debug().Err(err).Msg(ErrUpdateShares.Error())
-		ErrUpdateShares.Render(w, r)
-		return
-	}
-
-	driveItems, err := api.baseGraphService.CS3ReceivedSharesToDriveItems(r.Context(), updatedShares)
 	switch {
 	case err != nil:
 		break
-	case len(driveItems) != 1:
-		err = ErrDriveItemConversion
+	case len(updatedShares) == 0:
+		err = ErrNoShares
 	}
 	if err != nil {
-		api.logger.Debug().Err(err).Msg(ErrDriveItemConversion.Error())
-		ErrDriveItemConversion.Render(w, r)
+		api.logger.Debug().Err(err).Msg(ErrUpdateShares.Error())
+		errorcode.InvalidRequest.Render(w, r, http.StatusFailedDependency, ErrUpdateShares.Error())
 		return
 	}
 
 	render.Status(r, http.StatusOK)
-	render.JSON(w, r, driveItems[0])
+	render.JSON(w, r, updatedShares[0])
 }
 
 // CreateDriveItem creates a drive item
@@ -458,29 +394,28 @@ func (api DrivesDriveItemApi) CreateDriveItem(w http.ResponseWriter, r *http.Req
 	driveID, err := parseIDParam(r, "driveID")
 	if err != nil {
 		api.logger.Debug().Err(err).Msg(ErrInvalidDriveIDOrItemID.Error())
-		ErrInvalidDriveIDOrItemID.Render(w, r)
+		errorcode.InvalidRequest.Render(w, r, http.StatusUnprocessableEntity, ErrInvalidDriveIDOrItemID.Error())
 		return
 	}
 
 	if !IsShareJail(driveID) {
 		api.logger.Debug().Interface("driveID", driveID).Msg(ErrNotAShareJail.Error())
-		ErrNotAShareJail.Render(w, r)
+		errorcode.InvalidRequest.Render(w, r, http.StatusUnprocessableEntity, ErrNotAShareJail.Error())
 		return
 	}
 
 	requestDriveItem := libregraph.DriveItem{}
 	if err := StrictJSONUnmarshal(r.Body, &requestDriveItem); err != nil {
 		api.logger.Debug().Err(err).Msg(ErrInvalidRequestBody.Error())
-		ErrInvalidRequestBody.Render(w, r)
+		errorcode.InvalidRequest.Render(w, r, http.StatusUnprocessableEntity, ErrInvalidRequestBody.Error())
 		return
-
 	}
 
 	remoteItem := requestDriveItem.GetRemoteItem()
 	resourceId, err := storagespace.ParseID(remoteItem.GetId())
 	if err != nil {
 		api.logger.Debug().Err(err).Msg(ErrInvalidID.Error())
-		ErrInvalidID.Render(w, r)
+		errorcode.InvalidRequest.Render(w, r, http.StatusBadRequest, ErrInvalidID.Error())
 		return
 	}
 
@@ -488,7 +423,7 @@ func (api DrivesDriveItemApi) CreateDriveItem(w http.ResponseWriter, r *http.Req
 		MountShare(ctx, &resourceId, requestDriveItem.GetName())
 	if err != nil {
 		api.logger.Debug().Err(err).Msg(ErrMountShare.Error())
-		ErrMountShare.Render(w, r)
+		errorcode.InvalidRequest.Render(w, r, http.StatusBadRequest, ErrMountShare.Error())
 		return
 	}
 
@@ -501,7 +436,7 @@ func (api DrivesDriveItemApi) CreateDriveItem(w http.ResponseWriter, r *http.Req
 	}
 	if err != nil {
 		api.logger.Debug().Err(err).Msg(ErrDriveItemConversion.Error())
-		ErrDriveItemConversion.Render(w, r)
+		errorcode.InvalidRequest.Render(w, r, http.StatusFailedDependency, ErrDriveItemConversion.Error())
 		return
 	}
 
diff --git a/services/graph/pkg/service/v0/service.go b/services/graph/pkg/service/v0/service.go
index 57db3b0d866..d2f61018403 100644
--- a/services/graph/pkg/service/v0/service.go
+++ b/services/graph/pkg/service/v0/service.go
@@ -247,7 +247,6 @@ func NewService(opts ...Option) (Graph, error) { //nolint:maintidx
 						})
 					})
 					r.Route("/items/{itemID}", func(r chi.Router) {
-						r.Get("/", drivesDriveItemApi.GetDriveItem)
 						r.Patch("/", drivesDriveItemApi.UpdateDriveItem)
 						r.Delete("/", drivesDriveItemApi.DeleteDriveItem)
 						r.Post("/invite", driveItemPermissionsApi.Invite)
diff --git a/services/proxy/pkg/user/backend/cs3.go b/services/proxy/pkg/user/backend/cs3.go
index 2646c7d3550..5750cd2ee70 100644
--- a/services/proxy/pkg/user/backend/cs3.go
+++ b/services/proxy/pkg/user/backend/cs3.go
@@ -16,7 +16,6 @@ import (
 	"go-micro.dev/v4/selector"
 
 	"github.com/owncloud/ocis/v2/ocis-pkg/log"
-	"github.com/owncloud/ocis/v2/ocis-pkg/oidc"
 	"github.com/owncloud/ocis/v2/ocis-pkg/registry"
 	"github.com/owncloud/ocis/v2/services/graph/pkg/errorcode"
 	"github.com/owncloud/ocis/v2/services/proxy/pkg/config"
@@ -177,7 +176,7 @@ func (c *cs3backend) CreateUserFromClaims(ctx context.Context, claims map[string
 		return nil, err
 	}
 
-	newUser, err := c.libregraphUserFromClaims(claims)
+	newUser, err := c.libregraphUserFromClaims(newctx, claims)
 	if err != nil {
 		c.logger.Error().Err(err).Interface("claims", claims).Msg("Error creating user from claims")
 		return nil, fmt.Errorf("Error creating user from claims: %w", err)
@@ -268,7 +267,7 @@ func (c cs3backend) isAlreadyExists(resp *http.Response) (bool, error) {
 	return false, nil
 }
 
-func (c cs3backend) libregraphUserFromClaims(claims map[string]interface{}) (libregraph.User, error) {
+func (c cs3backend) libregraphUserFromClaims(ctx context.Context, claims map[string]interface{}) (libregraph.User, error) {
 	user := libregraph.User{}
 	if dn, ok := claims[c.autoProvisionClaims.DisplayName].(string); ok {
 		user.SetDisplayName(dn)
@@ -284,17 +283,6 @@ func (c cs3backend) libregraphUserFromClaims(claims map[string]interface{}) (lib
 	if mail, ok := claims[c.autoProvisionClaims.Email].(string); ok {
 		user.SetMail(mail)
 	}
-
-	sub, subExists := claims[oidc.Sub].(string)
-	iss, issExists := claims[oidc.Iss].(string)
-
-	if subExists && issExists {
-		var objectIdentity libregraph.ObjectIdentity
-		objectIdentity.SetIssuer(iss)
-		objectIdentity.SetIssuerAssignedId(sub)
-		user.Identities = append(user.Identities, objectIdentity)
-	}
-
 	return user, nil
 }
 


Test patch:
diff --git a/services/collaboration/pkg/connector/fileconnector_test.go b/services/collaboration/pkg/connector/fileconnector_test.go
index 4ed54e2da11..bc4253067dc 100644
--- a/services/collaboration/pkg/connector/fileconnector_test.go
+++ b/services/collaboration/pkg/connector/fileconnector_test.go
@@ -52,7 +52,9 @@ var _ = Describe("FileConnector", func() {
 					OpaqueId: "opaqueId",
 					Type:     userv1beta1.UserType_USER_TYPE_PRIMARY,
 				},
-				Username: "Pet Shaft",
+				Username:    "Shaft",
+				DisplayName: "Pet Shaft",
+				Mail:        "shaft@example.com",
 				// Opaque is here for reference, not used by default but might be needed for some tests
 				//Opaque: &typesv1beta1.Opaque{
 				//	Map: map[string]*typesv1beta1.OpaqueEntry{
@@ -871,5 +873,56 @@ var _ = Describe("FileConnector", func() {
 			Expect(err).To(Succeed())
 			Expect(newFileInfo).To(Equal(expectedFileInfo))
 		})
+
+		It("Stat success authenticated user", func() {
+			// change view mode to view only
+			wopiCtx.ViewMode = appproviderv1beta1.ViewMode_VIEW_MODE_VIEW_ONLY
+
+			ctx := middleware.WopiContextToCtx(context.Background(), wopiCtx)
+
+			gatewayClient.On("Stat", mock.Anything, mock.Anything).Times(1).Return(&providerv1beta1.StatResponse{
+				Status: status.NewOK(ctx),
+				Info: &providerv1beta1.ResourceInfo{
+					Owner: &userv1beta1.UserId{
+						Idp:      "customIdp",
+						OpaqueId: "aabbcc",
+						Type:     userv1beta1.UserType_USER_TYPE_PRIMARY,
+					},
+					Size: uint64(998877),
+					Mtime: &typesv1beta1.Timestamp{
+						Seconds: uint64(16273849),
+					},
+					Path: "/path/to/test.txt",
+					// Other properties aren't used for now.
+				},
+			}, nil)
+
+			expectedFileInfo := connector.FileInfo{
+				OwnerId:                    "61616262636340637573746f6d496470", // hex of aabbcc@customIdp
+				Size:                       int64(998877),
+				Version:                    "16273849.0",
+				BaseFileName:               "test.txt",
+				BreadcrumbDocName:          "test.txt",
+				UserCanNotWriteRelative:    true,
+				HostViewUrl:                "http://test.ex.prv/view",
+				HostEditUrl:                "http://test.ex.prv/edit",
+				EnableOwnerTermination:     false,
+				SupportsExtendedLockLength: true,
+				SupportsGetLock:            true,
+				SupportsLocks:              true,
+				DisableExport:              true,
+				DisableCopy:                true,
+				DisablePrint:               true,
+				IsAnonymousUser:            false,
+				UserId:                     hex.EncodeToString([]byte("opaqueId@inmemory")),
+				UserFriendlyName:           "Pet Shaft",
+				WatermarkText:              "Pet Shaft shaft@example.com",
+			}
+
+			newFileInfo, err := fc.CheckFileInfo(ctx)
+
+			Expect(err).To(Succeed())
+			Expect(newFileInfo).To(Equal(expectedFileInfo))
+		})
 	})
 })
diff --git a/services/graph/pkg/identity/ldap_education_class_test.go b/services/graph/pkg/identity/ldap_education_class_test.go
index 1d5bf77e9f2..2b9cc199a2d 100644
--- a/services/graph/pkg/identity/ldap_education_class_test.go
+++ b/services/graph/pkg/identity/ldap_education_class_test.go
@@ -273,7 +273,7 @@ func TestGetEducationClassMembers(t *testing.T) {
 			Scope:      0,
 			SizeLimit:  1,
 			Filter:     "(objectClass=inetOrgPerson)",
-			Attributes: ldapUserAttributes,
+			Attributes: []string{"displayname", "entryUUID", "mail", "uid", "sn", "givenname", "userEnabledAttribute", "userTypeAttribute"},
 			Controls:   []ldap.Control(nil),
 		}
 		lm.On("Search", userSr).Return(&ldap.SearchResult{Entries: []*ldap.Entry{userEntry}}, nil)
diff --git a/services/graph/pkg/identity/ldap_education_user_test.go b/services/graph/pkg/identity/ldap_education_user_test.go
index a84a1df28b6..3662f8919b8 100644
--- a/services/graph/pkg/identity/ldap_education_user_test.go
+++ b/services/graph/pkg/identity/ldap_education_user_test.go
@@ -194,7 +194,7 @@ func TestUpdateEducationUser(t *testing.T) {
 		Scope:      0,
 		SizeLimit:  1,
 		Filter:     "(objectClass=inetOrgPerson)",
-		Attributes: ldapUserAttributes,
+		Attributes: []string{"displayname", "entryUUID", "mail", "uid", "sn", "givenname", "userEnabledAttribute", "userTypeAttribute"},
 	}
 	eduUserLookupReq := &ldap.SearchRequest{
 		BaseDN:     "uid=newtestuser,ou=people,dc=test",
diff --git a/services/graph/pkg/identity/ldap_group_test.go b/services/graph/pkg/identity/ldap_group_test.go
index a7efaf95581..b228a16bb61 100644
--- a/services/graph/pkg/identity/ldap_group_test.go
+++ b/services/graph/pkg/identity/ldap_group_test.go
@@ -83,11 +83,11 @@ func TestGetGroup(t *testing.T) {
 		Entries: []*ldap.Entry{invalidGroupEntry},
 	}, nil)
 	b, _ = getMockedBackend(lm, lconfig, &logger)
-	_, err = b.GetGroup(context.Background(), "group", nil)
+	g, err := b.GetGroup(context.Background(), "group", nil)
 	assert.ErrorContains(t, err, "itemNotFound:")
-	_, err = b.GetGroup(context.Background(), "group", queryParamExpand)
+	g, err = b.GetGroup(context.Background(), "group", queryParamExpand)
 	assert.ErrorContains(t, err, "itemNotFound:")
-	_, err = b.GetGroup(context.Background(), "group", queryParamSelect)
+	g, err = b.GetGroup(context.Background(), "group", queryParamSelect)
 	assert.ErrorContains(t, err, "itemNotFound:")
 
 	// Mock a valid	Search Result
@@ -96,14 +96,14 @@ func TestGetGroup(t *testing.T) {
 		BaseDN:     "uid=user,ou=people,dc=test",
 		SizeLimit:  1,
 		Filter:     "(objectClass=inetOrgPerson)",
-		Attributes: ldapUserAttributes,
+		Attributes: []string{"displayname", "entryUUID", "mail", "uid", "sn", "givenname", "userEnabledAttribute", "userTypeAttribute"},
 		Controls:   []ldap.Control(nil),
 	}
 	sr3 := &ldap.SearchRequest{
 		BaseDN:     "uid=invalid,ou=people,dc=test",
 		SizeLimit:  1,
 		Filter:     "(objectClass=inetOrgPerson)",
-		Attributes: ldapUserAttributes,
+		Attributes: []string{"displayname", "entryUUID", "mail", "uid", "sn", "givenname", "userEnabledAttribute", "userTypeAttribute"},
 		Controls:   []ldap.Control(nil),
 	}
 
@@ -111,7 +111,7 @@ func TestGetGroup(t *testing.T) {
 	lm.On("Search", sr2).Return(&ldap.SearchResult{Entries: []*ldap.Entry{userEntry}}, nil)
 	lm.On("Search", sr3).Return(&ldap.SearchResult{Entries: []*ldap.Entry{invalidUserEntry}}, nil)
 	b, _ = getMockedBackend(lm, lconfig, &logger)
-	g, err := b.GetGroup(context.Background(), "group", nil)
+	g, err = b.GetGroup(context.Background(), "group", nil)
 	if err != nil {
 		t.Errorf("Expected GetGroup to succeed. Got %s", err.Error())
 	} else if *g.Id != groupEntry.GetEqualFoldAttributeValue(b.groupAttributeMap.id) {
@@ -257,14 +257,14 @@ func TestGetGroups(t *testing.T) {
 		BaseDN:     "uid=user,ou=people,dc=test",
 		SizeLimit:  1,
 		Filter:     "(objectClass=inetOrgPerson)",
-		Attributes: ldapUserAttributes,
+		Attributes: []string{"displayname", "entryUUID", "mail", "uid", "sn", "givenname", "userEnabledAttribute", "userTypeAttribute"},
 		Controls:   []ldap.Control(nil),
 	}
 	sr3 := &ldap.SearchRequest{
 		BaseDN:     "uid=invalid,ou=people,dc=test",
 		SizeLimit:  1,
 		Filter:     "(objectClass=inetOrgPerson)",
-		Attributes: ldapUserAttributes,
+		Attributes: []string{"displayname", "entryUUID", "mail", "uid", "sn", "givenname", "userEnabledAttribute", "userTypeAttribute"},
 		Controls:   []ldap.Control(nil),
 	}
 
diff --git a/services/graph/pkg/identity/ldap_test.go b/services/graph/pkg/identity/ldap_test.go
index 36630cbf759..71431c674c6 100644
--- a/services/graph/pkg/identity/ldap_test.go
+++ b/services/graph/pkg/identity/ldap_test.go
@@ -72,8 +72,6 @@ var invalidUserEntry = ldap.NewEntry("uid=user",
 
 var logger = log.NewLogger(log.Level("debug"))
 
-var ldapUserAttributes = []string{"displayname", "entryUUID", "mail", "uid", "sn", "givenname", "userEnabledAttribute", "userTypeAttribute", "oCExternalIdentity"}
-
 func TestNewLDAPBackend(t *testing.T) {
 	l := &mocks.Client{}
 
@@ -366,7 +364,7 @@ func TestUpdateUser(t *testing.T) {
 							ldap.ScopeWholeSubtree,
 							ldap.NeverDerefAliases, 1, 0, false,
 							"(&(objectClass=inetOrgPerson)(|(uid=testUser)(entryUUID=testUser)))",
-							ldapUserAttributes,
+							[]string{"displayname", "entryUUID", "mail", "uid", "sn", "givenname", "userEnabledAttribute", "userTypeAttribute"},
 							nil,
 						),
 					},
@@ -410,7 +408,7 @@ func TestUpdateUser(t *testing.T) {
 							ldap.ScopeWholeSubtree,
 							ldap.NeverDerefAliases, 1, 0, false,
 							"(&(objectClass=inetOrgPerson)(|(uid=testUser)(entryUUID=testUser)))",
-							ldapUserAttributes,
+							[]string{"displayname", "entryUUID", "mail", "uid", "sn", "givenname", "userEnabledAttribute", "userTypeAttribute"},
 							nil,
 						),
 					},
@@ -454,7 +452,7 @@ func TestUpdateUser(t *testing.T) {
 							TimeLimit:    0,
 							TypesOnly:    false,
 							Filter:       "(objectClass=inetOrgPerson)",
-							Attributes:   ldapUserAttributes,
+							Attributes:   []string{"displayname", "entryUUID", "mail", "uid", "sn", "givenname", "userEnabledAttribute", "userTypeAttribute"},
 							Controls:     []ldap.Control(nil),
 						},
 					},
@@ -539,7 +537,7 @@ func TestUpdateUser(t *testing.T) {
 							ldap.ScopeWholeSubtree,
 							ldap.NeverDerefAliases, 1, 0, false,
 							"(&(objectClass=inetOrgPerson)(|(uid=testUser)(entryUUID=testUser)))",
-							ldapUserAttributes,
+							[]string{"displayname", "entryUUID", "mail", "uid", "sn", "givenname", "userEnabledAttribute", "userTypeAttribute"},
 							nil,
 						),
 					},
@@ -583,7 +581,7 @@ func TestUpdateUser(t *testing.T) {
 							TimeLimit:    0,
 							TypesOnly:    false,
 							Filter:       "(objectClass=inetOrgPerson)",
-							Attributes:   ldapUserAttributes,
+							Attributes:   []string{"displayname", "entryUUID", "mail", "uid", "sn", "givenname", "userEnabledAttribute", "userTypeAttribute"},
 							Controls:     []ldap.Control(nil),
 						},
 					},
@@ -668,7 +666,7 @@ func TestUpdateUser(t *testing.T) {
 							ldap.ScopeWholeSubtree,
 							ldap.NeverDerefAliases, 1, 0, false,
 							"(&(objectClass=inetOrgPerson)(|(uid=testUser)(entryUUID=testUser)))",
-							ldapUserAttributes,
+							[]string{"displayname", "entryUUID", "mail", "uid", "sn", "givenname", "userEnabledAttribute", "userTypeAttribute"},
 							nil,
 						),
 					},
@@ -764,7 +762,7 @@ func TestUpdateUser(t *testing.T) {
 							TimeLimit:    0,
 							TypesOnly:    false,
 							Filter:       "(objectClass=inetOrgPerson)",
-							Attributes:   ldapUserAttributes,
+							Attributes:   []string{"displayname", "entryUUID", "mail", "uid", "sn", "givenname", "userEnabledAttribute", "userTypeAttribute"},
 							Controls:     []ldap.Control(nil),
 						},
 					},
@@ -857,7 +855,7 @@ func TestUpdateUser(t *testing.T) {
 							ldap.ScopeWholeSubtree,
 							ldap.NeverDerefAliases, 1, 0, false,
 							"(&(objectClass=inetOrgPerson)(|(uid=testUser)(entryUUID=testUser)))",
-							ldapUserAttributes,
+							[]string{"displayname", "entryUUID", "mail", "uid", "sn", "givenname", "userEnabledAttribute", "userTypeAttribute"},
 							nil,
 						),
 					},
@@ -901,7 +899,7 @@ func TestUpdateUser(t *testing.T) {
 							TimeLimit:    0,
 							TypesOnly:    false,
 							Filter:       "(objectClass=inetOrgPerson)",
-							Attributes:   ldapUserAttributes,
+							Attributes:   []string{"displayname", "entryUUID", "mail", "uid", "sn", "givenname", "userEnabledAttribute", "userTypeAttribute"},
 							Controls:     []ldap.Control(nil),
 						},
 					},
@@ -987,7 +985,7 @@ func TestUpdateUser(t *testing.T) {
 							ldap.ScopeWholeSubtree,
 							ldap.NeverDerefAliases, 1, 0, false,
 							"(&(objectClass=inetOrgPerson)(|(uid=testUser)(entryUUID=testUser)))",
-							ldapUserAttributes,
+							[]string{"displayname", "entryUUID", "mail", "uid", "sn", "givenname", "userEnabledAttribute", "userTypeAttribute"},
 							nil,
 						),
 					},
@@ -1090,7 +1088,7 @@ func TestUpdateUser(t *testing.T) {
 							ldap.ScopeBaseObject,
 							ldap.NeverDerefAliases, 1, 0, false,
 							"(objectClass=inetOrgPerson)",
-							ldapUserAttributes,
+							[]string{"displayname", "entryUUID", "mail", "uid", "sn", "givenname", "userEnabledAttribute", "userTypeAttribute"},
 							[]ldap.Control(nil),
 						),
 					},
@@ -1153,7 +1151,7 @@ func TestUpdateUser(t *testing.T) {
 							ldap.ScopeWholeSubtree,
 							ldap.NeverDerefAliases, 1, 0, false,
 							"(&(objectClass=inetOrgPerson)(|(uid=testUser)(entryUUID=testUser)))",
-							ldapUserAttributes,
+							[]string{"displayname", "entryUUID", "mail", "uid", "sn", "givenname", "userEnabledAttribute", "userTypeAttribute"},
 							nil,
 						),
 					},
@@ -1256,7 +1254,7 @@ func TestUpdateUser(t *testing.T) {
 							ldap.ScopeBaseObject,
 							ldap.NeverDerefAliases, 1, 0, false,
 							"(objectClass=inetOrgPerson)",
-							ldapUserAttributes,
+							[]string{"displayname", "entryUUID", "mail", "uid", "sn", "givenname", "userEnabledAttribute", "userTypeAttribute"},
 							[]ldap.Control(nil),
 						),
 					},
@@ -1319,7 +1317,7 @@ func TestUpdateUser(t *testing.T) {
 							ldap.ScopeWholeSubtree,
 							ldap.NeverDerefAliases, 1, 0, false,
 							"(&(objectClass=inetOrgPerson)(|(uid=testUser)(entryUUID=testUser)))",
-							ldapUserAttributes,
+							[]string{"displayname", "entryUUID", "mail", "uid", "sn", "givenname", "userEnabledAttribute", "userTypeAttribute"},
 							nil,
 						),
 					},
@@ -1390,7 +1388,7 @@ func TestUpdateUser(t *testing.T) {
 							ldap.ScopeBaseObject,
 							ldap.NeverDerefAliases, 1, 0, false,
 							"(objectClass=inetOrgPerson)",
-							ldapUserAttributes,
+							[]string{"displayname", "entryUUID", "mail", "uid", "sn", "givenname", "userEnabledAttribute", "userTypeAttribute"},
 							[]ldap.Control(nil),
 						),
 					},
diff --git a/services/graph/pkg/service/v0/api_drives_drive_item_test.go b/services/graph/pkg/service/v0/api_drives_drive_item_test.go
index e0542a19857..7d7dc21529b 100644
--- a/services/graph/pkg/service/v0/api_drives_drive_item_test.go
+++ b/services/graph/pkg/service/v0/api_drives_drive_item_test.go
@@ -22,7 +22,6 @@ import (
 
 	"github.com/cs3org/reva/v2/pkg/rgrpc/status"
 	cs3mocks "github.com/cs3org/reva/v2/tests/cs3mocks/mocks"
-
 	"github.com/owncloud/ocis/v2/ocis-pkg/conversions"
 	"github.com/owncloud/ocis/v2/ocis-pkg/log"
 	"github.com/owncloud/ocis/v2/services/graph/mocks"
@@ -42,28 +41,14 @@ var _ = Describe("DrivesDriveItemService", func() {
 		gatewayClient = cs3mocks.NewGatewayAPIClient(GinkgoT())
 
 		gatewaySelector = mocks.NewSelectable[gateway.GatewayAPIClient](GinkgoT())
-		gatewaySelector.EXPECT().Next().Return(gatewayClient, nil)
+		gatewaySelector.On("Next").Return(gatewayClient, nil)
 
 		service, err := svc.NewDrivesDriveItemService(logger, gatewaySelector)
 		Expect(err).ToNot(HaveOccurred())
 		drivesDriveItemService = service
 	})
 
-	failOnFailingGatewayClientRotation := func(f func() error) {
-		It("fails if obtaining the next gateway client fails", func() {
-			someErr := errors.New("some error")
-			gatewaySelector.EXPECT().Next().Unset()
-			gatewaySelector.EXPECT().Next().Return(gatewayClient, someErr).Times(1)
-			Expect(f()).To(MatchError(someErr))
-		})
-	}
-
-	var _ = Describe("GetSharesForResource", func() {
-		failOnFailingGatewayClientRotation(func() error {
-			_, err := drivesDriveItemService.GetSharesForResource(context.Background(), nil, nil)
-			return err
-		})
-
+	var _ = Describe("GetSharesByResourceID", func() {
 		It("uses the correct filters to list received shares", func() {
 			resourceID := &storageprovider.ResourceId{
 				StorageId: "1",
@@ -83,7 +68,7 @@ var _ = Describe("DrivesDriveItemService", func() {
 				}).
 				Once()
 
-			_, _ = drivesDriveItemService.GetSharesForResource(context.Background(), resourceID, []*collaborationv1beta1.Filter{
+			_, _ = drivesDriveItemService.GetSharesByResourceID(context.Background(), resourceID, []*collaborationv1beta1.Filter{
 				{
 					Type: collaborationv1beta1.Filter_TYPE_STATE,
 					Term: &collaborationv1beta1.Filter_State{
@@ -101,7 +86,7 @@ var _ = Describe("DrivesDriveItemService", func() {
 				Return(nil, someErr).
 				Once()
 
-			_, err := drivesDriveItemService.GetSharesForResource(context.Background(), &storageprovider.ResourceId{}, []*collaborationv1beta1.Filter{})
+			_, err := drivesDriveItemService.GetSharesByResourceID(context.Background(), &storageprovider.ResourceId{}, []*collaborationv1beta1.Filter{})
 			Expect(err).To(MatchError(someErr))
 		})
 
@@ -112,7 +97,7 @@ var _ = Describe("DrivesDriveItemService", func() {
 				Return(nil, nil).
 				Once()
 
-			_, err := drivesDriveItemService.GetSharesForResource(context.Background(), &storageprovider.ResourceId{}, []*collaborationv1beta1.Filter{})
+			_, err := drivesDriveItemService.GetSharesByResourceID(context.Background(), &storageprovider.ResourceId{}, []*collaborationv1beta1.Filter{})
 			Expect(err).To(MatchError(svc.ErrNoShares))
 		})
 
@@ -131,18 +116,13 @@ var _ = Describe("DrivesDriveItemService", func() {
 				}, nil).
 				Once()
 
-			shares, err := drivesDriveItemService.GetSharesForResource(context.Background(), &storageprovider.ResourceId{}, []*collaborationv1beta1.Filter{})
+			shares, err := drivesDriveItemService.GetSharesByResourceID(context.Background(), &storageprovider.ResourceId{}, []*collaborationv1beta1.Filter{})
 			Expect(err).To(BeNil())
 			Expect(shares).To(Equal(givenShares))
 		})
 	})
 
-	var _ = Describe("GetShare", func() {
-		failOnFailingGatewayClientRotation(func() error {
-			_, err := drivesDriveItemService.GetShare(context.Background(), nil)
-			return err
-		})
-
+	var _ = Describe("GetShareAndSiblings", func() {
 		It("fails if share lookup reports an error", func() {
 			someErr := errors.New("some error")
 			gatewayClient.
@@ -151,7 +131,7 @@ var _ = Describe("DrivesDriveItemService", func() {
 				Return(nil, someErr).
 				Once()
 
-			_, err := drivesDriveItemService.GetShare(context.Background(), &collaborationv1beta1.ShareId{})
+			_, err := drivesDriveItemService.GetShareAndSiblings(context.Background(), &collaborationv1beta1.ShareId{}, nil)
 			Expect(err).To(MatchError(errorcode.New(errorcode.GeneralException, someErr.Error())))
 		})
 
@@ -165,38 +145,35 @@ var _ = Describe("DrivesDriveItemService", func() {
 				}, nil).
 				Once()
 
-			_, err := drivesDriveItemService.GetShare(context.Background(), &collaborationv1beta1.ShareId{})
+			_, err := drivesDriveItemService.GetShareAndSiblings(context.Background(), &collaborationv1beta1.ShareId{}, nil)
 			Expect(err).To(MatchError(errorcode.New(errorcode.ItemNotFound, someErr.Error())))
 		})
 
-		It("successfully returns a share", func() {
+		It("successfully returns shares", func() {
 			gatewayClient.
 				EXPECT().
 				GetReceivedShare(context.Background(), mock.Anything, mock.Anything).
 				Return(&collaborationv1beta1.GetReceivedShareResponse{
 					Status: status.NewOK(context.Background()),
-					Share: &collaborationv1beta1.ReceivedShare{
-						Share: &collaborationv1beta1.Share{
-							Id: &collaborationv1beta1.ShareId{
-								OpaqueId: "123",
-							},
-						},
-					},
 				}, nil).
 				Once()
 
-			share, err := drivesDriveItemService.GetShare(context.Background(), &collaborationv1beta1.ShareId{})
+			gatewayClient.
+				EXPECT().
+				ListReceivedShares(context.Background(), mock.Anything, mock.Anything, mock.Anything).
+				Return(&collaborationv1beta1.ListReceivedSharesResponse{
+					Status: status.NewOK(context.Background()),
+					Shares: make([]*collaborationv1beta1.ReceivedShare, 3),
+				}, nil).
+				Once()
+
+			shares, err := drivesDriveItemService.GetShareAndSiblings(context.Background(), &collaborationv1beta1.ShareId{}, nil)
 			Expect(err).To(BeNil())
-			Expect(share.GetShare().GetId().GetOpaqueId()).To(Equal("123"))
+			Expect(shares).To(HaveLen(3))
 		})
 	})
 
 	var _ = Describe("UpdateShare", func() {
-		failOnFailingGatewayClientRotation(func() error {
-			_, err := drivesDriveItemService.UpdateShare(context.Background(), nil, nil)
-			return err
-		})
-
 		It("fails without an updater", func() {
 			_, err := drivesDriveItemService.UpdateShare(context.Background(), &collaborationv1beta1.ReceivedShare{}, nil)
 			Expect(err).To(MatchError(svc.ErrNoUpdater))
@@ -471,10 +448,10 @@ var _ = Describe("DrivesDriveItemApi", func() {
 					context.WithValue(context.Background(), chi.RouteCtxKey, rCTX),
 				)
 			handler(w, r)
-			Expect(w.Code).To(Equal(http.StatusBadRequest))
+			Expect(w.Code).To(Equal(http.StatusUnprocessableEntity))
 
 			jsonData := gjson.Get(w.Body.String(), "error")
-			Expect(jsonData.Get("code").String() + ": " + jsonData.Get("message").String()).To(Equal(svc.ErrInvalidDriveIDOrItemID.Error()))
+			Expect(jsonData.Get("message").String()).To(Equal(svc.ErrInvalidDriveIDOrItemID.Error()))
 		})
 	}
 
@@ -489,10 +466,10 @@ var _ = Describe("DrivesDriveItemApi", func() {
 					context.WithValue(context.Background(), chi.RouteCtxKey, rCTX),
 				)
 			handler(w, r)
-			Expect(w.Code).To(Equal(http.StatusBadRequest))
+			Expect(w.Code).To(Equal(http.StatusUnprocessableEntity))
 
 			jsonData := gjson.Get(w.Body.String(), "error")
-			Expect(jsonData.Get("code").String() + ": " + jsonData.Get("message").String()).To(Equal(svc.ErrInvalidRequestBody.Error()))
+			Expect(jsonData.Get("message").String()).To(Equal(svc.ErrInvalidRequestBody.Error()))
 		})
 	}
 
@@ -506,10 +483,10 @@ var _ = Describe("DrivesDriveItemApi", func() {
 					context.WithValue(context.Background(), chi.RouteCtxKey, rCTX),
 				)
 			handler(w, r)
-			Expect(w.Code).To(Equal(http.StatusBadRequest))
+			Expect(w.Code).To(Equal(http.StatusUnprocessableEntity))
 
 			jsonData := gjson.Get(w.Body.String(), "error")
-			Expect(jsonData.Get("code").String() + ": " + jsonData.Get("message").String()).To(Equal(svc.ErrNotAShareJail.Error()))
+			Expect(jsonData.Get("message").String()).To(Equal(svc.ErrNotAShareJail.Error()))
 		})
 	}
 
@@ -534,10 +511,10 @@ var _ = Describe("DrivesDriveItemApi", func() {
 				Once()
 
 			drivesDriveItemApi.DeleteDriveItem(w, r)
-			Expect(w.Code).To(Equal(http.StatusBadRequest))
+			Expect(w.Code).To(Equal(http.StatusFailedDependency))
 
 			jsonData := gjson.Get(w.Body.String(), "error")
-			Expect(jsonData.Get("code").String() + ": " + jsonData.Get("message").String()).To(Equal(svc.ErrUnmountShare.Error()))
+			Expect(jsonData.Get("message").String()).To(Equal(svc.ErrUnmountShare.Error()))
 		})
 
 		It("successfully unmounts the share", func() {
@@ -567,7 +544,7 @@ var _ = Describe("DrivesDriveItemApi", func() {
 
 		failOninvalidDriveItemBody(drivesDriveItemApi.UpdateDriveItem)
 
-		It("fails if retrieving the share fails", func() {
+		It("fails if retrieving the share ans siblings fails", func() {
 			rCTX.URLParams.Add("driveID", "a0ca6a90-a365-4782-871e-d44447bbc668$a0ca6a90-a365-4782-871e-d44447bbc668")
 			rCTX.URLParams.Add("itemID", "a0ca6a90-a365-4782-871e-d44447bbc668$a0ca6a90-a365-4782-871e-d44447bbc668!1")
 
@@ -583,18 +560,18 @@ var _ = Describe("DrivesDriveItemApi", func() {
 
 			drivesDriveItemProvider.
 				EXPECT().
-				GetShare(mock.Anything, mock.Anything).
+				GetShareAndSiblings(mock.Anything, mock.Anything, mock.Anything).
 				Return(nil, errors.New("some error")).
 				Once()
 
 			drivesDriveItemApi.UpdateDriveItem(w, r)
-			Expect(w.Code).To(Equal(http.StatusNotFound))
+			Expect(w.Code).To(Equal(http.StatusFailedDependency))
 
 			jsonData := gjson.Get(w.Body.String(), "error")
-			Expect(jsonData.Get("code").String() + ": " + jsonData.Get("message").String()).To(Equal(svc.ErrNoShares.Error()))
+			Expect(jsonData.Get("message").String()).To(Equal(svc.ErrGetShareAndSiblings.Error()))
 		})
 
-		It("fails if retrieving the shares fail", func() {
+		It("fails if updating the share fails", func() {
 			rCTX.URLParams.Add("driveID", "a0ca6a90-a365-4782-871e-d44447bbc668$a0ca6a90-a365-4782-871e-d44447bbc668")
 			rCTX.URLParams.Add("itemID", "a0ca6a90-a365-4782-871e-d44447bbc668$a0ca6a90-a365-4782-871e-d44447bbc668!1")
 
@@ -610,30 +587,32 @@ var _ = Describe("DrivesDriveItemApi", func() {
 
 			drivesDriveItemProvider.
 				EXPECT().
-				GetShare(mock.Anything, mock.Anything).
+				GetShareAndSiblings(mock.Anything, mock.Anything, mock.Anything).
 				Return(nil, nil).
 				Once()
 
 			drivesDriveItemProvider.
 				EXPECT().
-				GetSharesForResource(mock.Anything, mock.Anything, mock.Anything).
+				UpdateShares(mock.Anything, mock.Anything, mock.Anything).
 				Return(nil, errors.New("some error")).
 				Once()
 
 			drivesDriveItemApi.UpdateDriveItem(w, r)
-			Expect(w.Code).To(Equal(http.StatusNotFound))
+			Expect(w.Code).To(Equal(http.StatusFailedDependency))
 
 			jsonData := gjson.Get(w.Body.String(), "error")
-			Expect(jsonData.Get("code").String() + ": " + jsonData.Get("message").String()).To(Equal(svc.ErrNoShares.Error()))
+			Expect(jsonData.Get("message").String()).To(Equal(svc.ErrUpdateShares.Error()))
 		})
 
-		It("fails if updating the share fails", func() {
+		It("fails if no shares are updated", func() {
 			rCTX.URLParams.Add("driveID", "a0ca6a90-a365-4782-871e-d44447bbc668$a0ca6a90-a365-4782-871e-d44447bbc668")
 			rCTX.URLParams.Add("itemID", "a0ca6a90-a365-4782-871e-d44447bbc668$a0ca6a90-a365-4782-871e-d44447bbc668!1")
 
 			w := httptest.NewRecorder()
 
-			driveItemJson, err := json.Marshal(libregraph.DriveItem{})
+			driveItemJson, err := json.Marshal(libregraph.DriveItem{
+				UIHidden: conversions.ToPointer(true),
+			})
 			Expect(err).ToNot(HaveOccurred())
 
 			r := httptest.NewRequest(http.MethodPost, "/", bytes.NewBuffer(driveItemJson)).
@@ -643,103 +622,21 @@ var _ = Describe("DrivesDriveItemApi", func() {
 
 			drivesDriveItemProvider.
 				EXPECT().
-				GetShare(mock.Anything, mock.Anything).
-				Return(nil, nil).
-				Once()
-
-			drivesDriveItemProvider.
-				EXPECT().
-				GetSharesForResource(mock.Anything, mock.Anything, mock.Anything).
-				Return(nil, nil).
+				GetShareAndSiblings(mock.Anything, mock.Anything, mock.Anything).
+				Return([]*collaborationv1beta1.ReceivedShare{}, nil).
 				Once()
 
 			drivesDriveItemProvider.
 				EXPECT().
 				UpdateShares(mock.Anything, mock.Anything, mock.Anything).
-				Return(nil, errors.New("some error")).
+				Return([]*collaborationv1beta1.ReceivedShare{}, nil).
 				Once()
 
 			drivesDriveItemApi.UpdateDriveItem(w, r)
-			Expect(w.Code).To(Equal(http.StatusBadRequest))
+			Expect(w.Code).To(Equal(http.StatusFailedDependency))
 
 			jsonData := gjson.Get(w.Body.String(), "error")
-			Expect(jsonData.Get("code").String() + ": " + jsonData.Get("message").String()).To(Equal(svc.ErrUpdateShares.Error()))
-		})
-
-		var _ = Describe("UpdateDriveItem", func() {
-			var (
-				driveItemJson []byte
-				w             *httptest.ResponseRecorder
-			)
-
-			BeforeEach(func() {
-				rCTX.URLParams.Add("driveID", "a0ca6a90-a365-4782-871e-d44447bbc668$a0ca6a90-a365-4782-871e-d44447bbc668")
-				rCTX.URLParams.Add("itemID", "a0ca6a90-a365-4782-871e-d44447bbc668$a0ca6a90-a365-4782-871e-d44447bbc668!1")
-
-				w = httptest.NewRecorder()
-
-				dJson, err := json.Marshal(libregraph.DriveItem{
-					UIHidden: conversions.ToPointer(true),
-				})
-				Expect(err).ToNot(HaveOccurred())
-
-				driveItemJson = dJson
-
-				drivesDriveItemProvider.
-					EXPECT().
-					GetShare(mock.Anything, mock.Anything).
-					Return(nil, nil).
-					Once()
-
-				drivesDriveItemProvider.
-					EXPECT().
-					GetSharesForResource(mock.Anything, mock.Anything, mock.Anything).
-					Return([]*collaborationv1beta1.ReceivedShare{}, nil).
-					Once()
-
-				drivesDriveItemProvider.
-					EXPECT().
-					UpdateShares(mock.Anything, mock.Anything, mock.Anything).
-					Return([]*collaborationv1beta1.ReceivedShare{}, nil).
-					Once()
-			})
-
-			It("fails if share to drive conversion reports an error", func() {
-				baseGraphProvider.
-					EXPECT().
-					CS3ReceivedSharesToDriveItems(mock.Anything, mock.Anything).
-					Return(nil, errors.New("some error")).
-					Once()
-
-				r := httptest.NewRequest(http.MethodPost, "/", bytes.NewBuffer(driveItemJson)).
-					WithContext(
-						context.WithValue(context.Background(), chi.RouteCtxKey, rCTX),
-					)
-
-				drivesDriveItemApi.UpdateDriveItem(w, r)
-				Expect(w.Code).To(Equal(http.StatusBadRequest))
-
-				jsonData := gjson.Get(w.Body.String(), "error")
-				Expect(jsonData.Get("code").String() + ": " + jsonData.Get("message").String()).To(Equal(svc.ErrDriveItemConversion.Error()))
-			})
-			It("fails if share to drive conversion returns more or less than 1 drive item", func() {
-				baseGraphProvider.
-					EXPECT().
-					CS3ReceivedSharesToDriveItems(mock.Anything, mock.Anything).
-					Return(nil, nil).
-					Once()
-
-				r := httptest.NewRequest(http.MethodPost, "/", bytes.NewBuffer(driveItemJson)).
-					WithContext(
-						context.WithValue(context.Background(), chi.RouteCtxKey, rCTX),
-					)
-
-				drivesDriveItemApi.UpdateDriveItem(w, r)
-				Expect(w.Code).To(Equal(http.StatusBadRequest))
-
-				jsonData := gjson.Get(w.Body.String(), "error")
-				Expect(jsonData.Get("code").String() + ": " + jsonData.Get("message").String()).To(Equal(svc.ErrDriveItemConversion.Error()))
-			})
+			Expect(jsonData.Get("message").String()).To(Equal(svc.ErrUpdateShares.Error()))
 		})
 
 		It("successfully updates the share", func() {
@@ -766,13 +663,7 @@ var _ = Describe("DrivesDriveItemApi", func() {
 
 			drivesDriveItemProvider.
 				EXPECT().
-				GetShare(mock.Anything, mock.Anything).
-				Return(nil, nil).
-				Once()
-
-			drivesDriveItemProvider.
-				EXPECT().
-				GetSharesForResource(mock.Anything, mock.Anything, mock.Anything).
+				GetShareAndSiblings(mock.Anything, mock.Anything, mock.Anything).
 				Return([]*collaborationv1beta1.ReceivedShare{share}, nil).
 				Once()
 
@@ -780,6 +671,7 @@ var _ = Describe("DrivesDriveItemApi", func() {
 				EXPECT().
 				UpdateShares(mock.Anything, mock.Anything, mock.Anything).
 				RunAndReturn(func(ctx context.Context, shares []*collaborationv1beta1.ReceivedShare, closure svc.UpdateShareClosure) ([]*collaborationv1beta1.ReceivedShare, error) {
+
 					updateReceivedShareRequest := &collaborationv1beta1.UpdateReceivedShareRequest{
 						Share: &collaborationv1beta1.ReceivedShare{
 							Share: &collaborationv1beta1.Share{
@@ -800,188 +692,11 @@ var _ = Describe("DrivesDriveItemApi", func() {
 				}).
 				Once()
 
-			baseGraphProvider.
-				EXPECT().
-				CS3ReceivedSharesToDriveItems(mock.Anything, mock.Anything).
-				Return([]libregraph.DriveItem{{}}, nil).
-				Once()
-
 			drivesDriveItemApi.UpdateDriveItem(w, r)
 			Expect(w.Code).To(Equal(http.StatusOK))
 		})
 	})
 
-	Describe("GetDriveItem", func() {
-		BeforeEach(func() {
-			rCTX.URLParams.Add("driveID", "a0ca6a90-a365-4782-871e-d44447bbc668$a0ca6a90-a365-4782-871e-d44447bbc668")
-			rCTX.URLParams.Add("itemID", "a0ca6a90-a365-4782-871e-d44447bbc668$a0ca6a90-a365-4782-871e-d44447bbc668!1")
-		})
-
-		failOnInvalidDriveIDOrItemID(drivesDriveItemApi.GetDriveItem)
-
-		failOnNonShareJailDriveID(drivesDriveItemApi.GetDriveItem)
-
-		It("fails if retrieving the share fails", func() {
-			w := httptest.NewRecorder()
-
-			driveItemJson, err := json.Marshal(libregraph.DriveItem{})
-			Expect(err).ToNot(HaveOccurred())
-
-			r := httptest.NewRequest(http.MethodGet, "/", bytes.NewBuffer(driveItemJson)).
-				WithContext(
-					context.WithValue(context.Background(), chi.RouteCtxKey, rCTX),
-				)
-
-			drivesDriveItemProvider.
-				EXPECT().
-				GetShare(mock.Anything, mock.Anything).
-				Return(nil, errors.New("some error")).
-				Once()
-
-			drivesDriveItemApi.GetDriveItem(w, r)
-			Expect(w.Code).To(Equal(http.StatusNotFound))
-
-			jsonData := gjson.Get(w.Body.String(), "error")
-			Expect(jsonData.Get("code").String() + ": " + jsonData.Get("message").String()).To(Equal(svc.ErrNoShares.Error()))
-		})
-
-		It("fails if retrieving the shares fail", func() {
-			w := httptest.NewRecorder()
-
-			driveItemJson, err := json.Marshal(libregraph.DriveItem{})
-			Expect(err).ToNot(HaveOccurred())
-
-			r := httptest.NewRequest(http.MethodGet, "/", bytes.NewBuffer(driveItemJson)).
-				WithContext(
-					context.WithValue(context.Background(), chi.RouteCtxKey, rCTX),
-				)
-
-			drivesDriveItemProvider.
-				EXPECT().
-				GetShare(mock.Anything, mock.Anything).
-				Return(nil, nil).
-				Once()
-
-			drivesDriveItemProvider.
-				EXPECT().
-				GetSharesForResource(mock.Anything, mock.Anything, mock.Anything).
-				Return(nil, errors.New("some error")).
-				Once()
-
-			drivesDriveItemApi.GetDriveItem(w, r)
-			Expect(w.Code).To(Equal(http.StatusNotFound))
-
-			jsonData := gjson.Get(w.Body.String(), "error")
-			Expect(jsonData.Get("code").String() + ": " + jsonData.Get("message").String()).To(Equal(svc.ErrNoShares.Error()))
-		})
-
-		Describe("returning the share", func() {
-			var (
-				w *httptest.ResponseRecorder
-				r *http.Request
-			)
-
-			BeforeEach(func() {
-				w = httptest.NewRecorder()
-
-				driveItemJson, _ := json.Marshal(libregraph.DriveItem{
-					UIHidden: conversions.ToPointer(true),
-				})
-
-				r = httptest.NewRequest(http.MethodGet, "/", bytes.NewBuffer(driveItemJson)).
-					WithContext(
-						context.WithValue(context.Background(), chi.RouteCtxKey, rCTX),
-					)
-
-				share := &collaborationv1beta1.ReceivedShare{
-					Share: &collaborationv1beta1.Share{Id: &collaborationv1beta1.ShareId{
-						OpaqueId: "123",
-					}},
-				}
-
-				drivesDriveItemProvider.
-					EXPECT().
-					GetShare(mock.Anything, mock.Anything).
-					Return(nil, nil).
-					Once()
-
-				drivesDriveItemProvider.
-					EXPECT().
-					GetSharesForResource(mock.Anything, mock.Anything, mock.Anything).
-					Return([]*collaborationv1beta1.ReceivedShare{share}, nil).
-					Once()
-			})
-
-			It("fails if more that one share found", func() {
-				baseGraphProvider.
-					EXPECT().
-					CS3ReceivedSharesToDriveItems(mock.Anything, mock.Anything).
-					Return([]libregraph.DriveItem{{}, {}}, nil).
-					Once()
-
-				drivesDriveItemApi.GetDriveItem(w, r)
-				Expect(w.Code).To(Equal(http.StatusBadRequest))
-
-				jsonData := gjson.Get(w.Body.String(), "error")
-				Expect(jsonData.Get("code").String() + ": " + jsonData.Get("message").String()).To(Equal(svc.ErrDriveItemConversion.Error()))
-			})
-
-			It("fails if no shares are found", func() {
-				baseGraphProvider.
-					EXPECT().
-					CS3ReceivedSharesToDriveItems(mock.Anything, mock.Anything).
-					Return(nil, errors.New("some error")).
-					Once()
-
-				drivesDriveItemApi.GetDriveItem(w, r)
-				Expect(w.Code).To(Equal(http.StatusBadRequest))
-
-				jsonData := gjson.Get(w.Body.String(), "error")
-				Expect(jsonData.Get("code").String() + ": " + jsonData.Get("message").String()).To(Equal(svc.ErrDriveItemConversion.Error()))
-			})
-		})
-
-		It("successfully returns the share", func() {
-			w := httptest.NewRecorder()
-
-			driveItemJson, _ := json.Marshal(libregraph.DriveItem{
-				UIHidden: conversions.ToPointer(true),
-			})
-
-			r := httptest.NewRequest(http.MethodGet, "/", bytes.NewBuffer(driveItemJson)).
-				WithContext(
-					context.WithValue(context.Background(), chi.RouteCtxKey, rCTX),
-				)
-
-			share := &collaborationv1beta1.ReceivedShare{
-				Share: &collaborationv1beta1.Share{Id: &collaborationv1beta1.ShareId{
-					OpaqueId: "123",
-				}},
-			}
-
-			drivesDriveItemProvider.
-				EXPECT().
-				GetShare(mock.Anything, mock.Anything).
-				Return(nil, nil).
-				Once()
-
-			drivesDriveItemProvider.
-				EXPECT().
-				GetSharesForResource(mock.Anything, mock.Anything, mock.Anything).
-				Return([]*collaborationv1beta1.ReceivedShare{share}, nil).
-				Once()
-
-			baseGraphProvider.
-				EXPECT().
-				CS3ReceivedSharesToDriveItems(mock.Anything, mock.Anything).
-				Return([]libregraph.DriveItem{{}}, nil).
-				Once()
-
-			drivesDriveItemApi.GetDriveItem(w, r)
-			Expect(w.Code).To(Equal(http.StatusOK))
-		})
-	})
-
 	Describe("CreateDriveItem", func() {
 		It("fails without a driveID", func() {
 			w := httptest.NewRecorder()
@@ -990,10 +705,10 @@ var _ = Describe("DrivesDriveItemApi", func() {
 					context.WithValue(context.Background(), chi.RouteCtxKey, rCTX),
 				)
 			drivesDriveItemApi.CreateDriveItem(w, r)
-			Expect(w.Code).To(Equal(http.StatusBadRequest))
+			Expect(w.Code).To(Equal(http.StatusUnprocessableEntity))
 
 			jsonData := gjson.Get(w.Body.String(), "error")
-			Expect(jsonData.Get("code").String() + ": " + jsonData.Get("message").String()).To(Equal(svc.ErrInvalidDriveIDOrItemID.Error()))
+			Expect(jsonData.Get("message").String()).To(Equal(svc.ErrInvalidDriveIDOrItemID.Error()))
 		})
 
 		failOnNonShareJailDriveID(drivesDriveItemApi.CreateDriveItem)
@@ -1018,7 +733,7 @@ var _ = Describe("DrivesDriveItemApi", func() {
 			Expect(w.Code).To(Equal(http.StatusBadRequest))
 
 			jsonData := gjson.Get(w.Body.String(), "error")
-			Expect(jsonData.Get("code").String() + ": " + jsonData.Get("message").String()).To(Equal(svc.ErrInvalidID.Error()))
+			Expect(jsonData.Get("message").String()).To(Equal(svc.ErrInvalidID.Error()))
 		})
 
 		It("fails if mounting the share fails", func() {
@@ -1049,7 +764,7 @@ var _ = Describe("DrivesDriveItemApi", func() {
 			Expect(w.Code).To(Equal(http.StatusBadRequest))
 
 			jsonData := gjson.Get(w.Body.String(), "error")
-			Expect(jsonData.Get("code").String() + ": " + jsonData.Get("message").String()).To(Equal(svc.ErrMountShare.Error()))
+			Expect(jsonData.Get("message").String()).To(Equal(svc.ErrMountShare.Error()))
 		})
 
 		It("fails if drive item conversion fails", func() {
@@ -1082,10 +797,10 @@ var _ = Describe("DrivesDriveItemApi", func() {
 				)
 
 			drivesDriveItemApi.CreateDriveItem(w, r)
-			Expect(w.Code).To(Equal(http.StatusBadRequest))
+			Expect(w.Code).To(Equal(http.StatusFailedDependency))
 
 			jsonData := gjson.Get(w.Body.String(), "error")
-			Expect(jsonData.Get("code").String() + ": " + jsonData.Get("message").String()).To(Equal(svc.ErrDriveItemConversion.Error()))
+			Expect(jsonData.Get("message").String()).To(Equal(svc.ErrDriveItemConversion.Error()))
 
 			//
 			baseGraphProvider.
@@ -1100,10 +815,10 @@ var _ = Describe("DrivesDriveItemApi", func() {
 				)
 
 			drivesDriveItemApi.CreateDriveItem(w, r)
-			Expect(w.Code).To(Equal(http.StatusBadRequest))
+			Expect(w.Code).To(Equal(http.StatusFailedDependency))
 
 			jsonData = gjson.Get(w.Body.String(), "error")
-			Expect(jsonData.Get("code").String() + ": " + jsonData.Get("message").String()).To(Equal(svc.ErrDriveItemConversion.Error()))
+			Expect(jsonData.Get("message").String()).To(Equal(svc.ErrDriveItemConversion.Error()))
 		})
 
 		It("successfully creates the drive item", func() {
diff --git a/tests/acceptance/config/behat-core.yml b/tests/acceptance/config/behat-core.yml
index f4f6a1d076e..b0071b5466e 100644
--- a/tests/acceptance/config/behat-core.yml
+++ b/tests/acceptance/config/behat-core.yml
@@ -50,7 +50,6 @@ default:
         - FeatureContext: *common_feature_context_params
         - FavoritesContext:
         - WebDavPropertiesContext:
-        - SharingNgContext:
 
     coreApiShareCreateSpecialToShares1:
       paths:
diff --git a/tests/acceptance/expected-failures-API-on-OCIS-storage.md b/tests/acceptance/expected-failures-API-on-OCIS-storage.md
index 541a1451eaa..3306a9fa4fb 100644
--- a/tests/acceptance/expected-failures-API-on-OCIS-storage.md
+++ b/tests/acceptance/expected-failures-API-on-OCIS-storage.md
@@ -238,8 +238,8 @@ And other missing implementation of favorites
 - [coreApiFavorites/favorites.feature:202](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/coreApiFavorites/favorites.feature#L202)
 - [coreApiFavorites/favorites.feature:203](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/coreApiFavorites/favorites.feature#L203)
 - [coreApiFavorites/favorites.feature:208](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/coreApiFavorites/favorites.feature#L208)
-- [coreApiFavorites/favoritesSharingToShares.feature:84](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/coreApiFavorites/favoritesSharingToShares.feature#L84)
-- [coreApiFavorites/favoritesSharingToShares.feature:85](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/coreApiFavorites/favoritesSharingToShares.feature#L85)
+- [coreApiFavorites/favoritesSharingToShares.feature:64](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/coreApiFavorites/favoritesSharingToShares.feature#L64)
+- [coreApiFavorites/favoritesSharingToShares.feature:65](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/coreApiFavorites/favoritesSharingToShares.feature#L65)
 
 #### [WWW-Authenticate header for unauthenticated requests is not clear](https://github.com/owncloud/ocis/issues/2285)
 
diff --git a/tests/acceptance/features/apiSharingNg/sharedWithMe.feature b/tests/acceptance/features/apiSharingNg/sharedWithMe.feature
index 2a70c244dac..0190b27927c 100755
--- a/tests/acceptance/features/apiSharingNg/sharedWithMe.feature
+++ b/tests/acceptance/features/apiSharingNg/sharedWithMe.feature
@@ -4857,10 +4857,19 @@ Feature: an user gets the resources shared to them
     """
     {
       "type": "object",
-      "required": ["@UI.Hidden"],
+      "required": ["hidden", "mount_point"],
       "properties": {
-        "@UI.Hidden": {
+        "hidden": {
           "const": true
+        },
+        "mount_point": {
+          "type": "object",
+          "required": ["path"],
+          "properties": {
+            "path": {
+              "const": "<resource>"
+            }
+          }
         }
       }
     }
@@ -4889,10 +4898,19 @@ Feature: an user gets the resources shared to them
     """
     {
       "type": "object",
-      "required": ["@UI.Hidden"],
+      "required": ["hidden", "mount_point"],
       "properties": {
-        "@UI.Hidden": {
+        "hidden": {
           "const": true
+        },
+        "mount_point": {
+          "type": "object",
+          "required": ["path"],
+          "properties": {
+            "path": {
+              "const": "<resource>"
+            }
+          }
         }
       }
     }
diff --git a/tests/acceptance/features/coreApiFavorites/favoritesSharingToShares.feature b/tests/acceptance/features/coreApiFavorites/favoritesSharingToShares.feature
index d6ee3c2df25..cc433c272ef 100644
--- a/tests/acceptance/features/coreApiFavorites/favoritesSharingToShares.feature
+++ b/tests/acceptance/features/coreApiFavorites/favoritesSharingToShares.feature
@@ -13,12 +13,7 @@ Feature: favorite
   Scenario Outline: favorite a file inside of a received share
     Given using <dav-path-version> DAV path
     And user "Brian" has been created with default attributes and without skeleton files
-    And user "Alice" has sent the following resource share invitation:
-      | resource        | PARENT   |
-      | space           | Personal |
-      | sharee          | Brian    |
-      | shareType       | user     |
-      | permissionsRole | Editor   |
+    And user "Alice" has shared folder "/PARENT" with user "Brian"
     When user "Brian" favorites element "/Shares/PARENT/parent.txt" using the WebDAV API
     Then the HTTP status code should be "207"
     And as user "Brian" file "/Shares/PARENT/parent.txt" should be favorited
@@ -32,12 +27,7 @@ Feature: favorite
     Given using <dav-path-version> DAV path
     And user "Brian" has been created with default attributes and without skeleton files
     And user "Alice" has created folder "/PARENT/sub-folder"
-    And user "Alice" has sent the following resource share invitation:
-      | resource        | PARENT   |
-      | space           | Personal |
-      | sharee          | Brian    |
-      | shareType       | user     |
-      | permissionsRole | Editor   |
+    And user "Alice" has shared folder "/PARENT" with user "Brian"
     When user "Brian" favorites element "/Shares/PARENT/sub-folder" using the WebDAV API
     Then the HTTP status code should be "207"
     And as user "Brian" folder "/Shares/PARENT/sub-folder" should be favorited
@@ -50,12 +40,7 @@ Feature: favorite
   Scenario Outline: favorite a received share itself
     Given using <dav-path-version> DAV path
     And user "Brian" has been created with default attributes and without skeleton files
-    And user "Alice" has sent the following resource share invitation:
-      | resource        | PARENT   |
-      | space           | Personal |
-      | sharee          | Brian    |
-      | shareType       | user     |
-      | permissionsRole | Editor   |
+    And user "Alice" has shared folder "/PARENT" with user "Brian"
     When user "Brian" favorites element "/Shares/PARENT" using the WebDAV API
     Then the HTTP status code should be "207"
     And as user "Brian" folder "/Shares/PARENT" should be favorited
@@ -68,12 +53,7 @@ Feature: favorite
   Scenario Outline: moving a favorite file out of a share keeps favorite state
     Given using <dav-path-version> DAV path
     And user "Brian" has been created with default attributes and without skeleton files
-    And user "Alice" has sent the following resource share invitation:
-      | resource        | PARENT   |
-      | space           | Personal |
-      | sharee          | Brian    |
-      | shareType       | user     |
-      | permissionsRole | Editor   |
+    And user "Alice" has shared folder "/PARENT" with user "Brian"
     And user "Brian" has favorited element "/Shares/PARENT/parent.txt"
     When user "Brian" moves file "/Shares/PARENT/parent.txt" to "/taken_out.txt" using the WebDAV API
     Then the HTTP status code should be "201"
@@ -88,12 +68,7 @@ Feature: favorite
   Scenario Outline: sharee file favorite state should not change the favorite state of sharer
     Given using <dav-path-version> DAV path
     And user "Brian" has been created with default attributes and without skeleton files
-    And user "Alice" has sent the following resource share invitation:
-      | resource        | PARENT/parent.txt |
-      | space           | Personal          |
-      | sharee          | Brian             |
-      | shareType       | user              |
-      | permissionsRole | File Editor       |
+    And user "Alice" has shared file "/PARENT/parent.txt" with user "Brian"
     When user "Brian" favorites element "/Shares/parent.txt" using the WebDAV API
     Then the HTTP status code should be "207"
     And as user "Brian" file "/Shares/parent.txt" should be favorited