graph sharing: Avoid usage for deprecated CS3 Request attributes
The sharereference attribute in the CS3 UpdateShareRequest is deprecated. Set the shareid via the Share.ID attribute.
This commit is contained in:
committed by
Michael Barz
parent
ff0bc0e602
commit
419619041b
@@ -800,14 +800,11 @@ func (g Graph) updateUserShare(ctx context.Context, permissionID string, oldPerm
|
||||
}
|
||||
|
||||
cs3UpdateShareReq := &collaboration.UpdateShareRequest{
|
||||
Ref: &collaboration.ShareReference{
|
||||
Spec: &collaboration.ShareReference_Id{
|
||||
Id: &collaboration.ShareId{
|
||||
OpaqueId: permissionID,
|
||||
},
|
||||
Share: &collaboration.Share{
|
||||
Id: &collaboration.ShareId{
|
||||
OpaqueId: permissionID,
|
||||
},
|
||||
},
|
||||
Share: &collaboration.Share{},
|
||||
}
|
||||
fieldmask := []string{}
|
||||
if expiration, ok := newPermission.GetExpirationDateTimeOk(); ok {
|
||||
|
||||
@@ -597,7 +597,7 @@ var _ = Describe("Driveitems", func() {
|
||||
updateShareMock := gatewayClient.On("UpdateShare",
|
||||
mock.Anything,
|
||||
mock.MatchedBy(func(req *collaboration.UpdateShareRequest) bool {
|
||||
if req.GetRef().GetId().GetOpaqueId() == "permissionid" {
|
||||
if req.GetShare().GetId().GetOpaqueId() == "permissionid" {
|
||||
return expiration.Equal(utils.TSToTime(req.GetShare().GetExpiration()))
|
||||
}
|
||||
return false
|
||||
@@ -628,7 +628,7 @@ var _ = Describe("Driveitems", func() {
|
||||
updateShareMock := gatewayClient.On("UpdateShare",
|
||||
mock.Anything,
|
||||
mock.MatchedBy(func(req *collaboration.UpdateShareRequest) bool {
|
||||
if req.GetRef().GetId().GetOpaqueId() == "permissionid" {
|
||||
if req.GetShare().GetId().GetOpaqueId() == "permissionid" {
|
||||
return true
|
||||
}
|
||||
return false
|
||||
@@ -659,7 +659,7 @@ var _ = Describe("Driveitems", func() {
|
||||
updateShareMock := gatewayClient.On("UpdateShare",
|
||||
mock.Anything,
|
||||
mock.MatchedBy(func(req *collaboration.UpdateShareRequest) bool {
|
||||
return req.GetRef().GetId().GetOpaqueId() == "permissionid"
|
||||
return req.GetShare().GetId().GetOpaqueId() == "permissionid"
|
||||
}),
|
||||
)
|
||||
updateShareMock.Return(updateShareMockResponse, nil)
|
||||
@@ -687,7 +687,7 @@ var _ = Describe("Driveitems", func() {
|
||||
updateShareMock := gatewayClient.On("UpdateShare",
|
||||
mock.Anything,
|
||||
mock.MatchedBy(func(req *collaboration.UpdateShareRequest) bool {
|
||||
return req.GetRef().GetId().GetOpaqueId() == "permissionid"
|
||||
return req.GetShare().GetId().GetOpaqueId() == "permissionid"
|
||||
}),
|
||||
)
|
||||
updateShareMockResponse.Share.Permissions = &collaboration.SharePermissions{
|
||||
|
||||
Reference in New Issue
Block a user