From 9c04e610f32937600f97686f7c30d9bafd0cb1b6 Mon Sep 17 00:00:00 2001 From: Roman Perekhod Date: Tue, 8 Oct 2024 18:57:46 +0200 Subject: [PATCH] Kept historical resource naming after renaming in activity for shares and public links. --- changelog/unreleased/fix-activity-rename.md | 6 ++ go.mod | 2 +- go.sum | 6 +- services/activitylog/pkg/service/http.go | 25 ++++-- .../apiActivities/shareActivities.feature | 78 ++----------------- .../eventsmiddleware/conversion.go | 16 ++-- .../publicshareprovider.go | 22 +++--- .../usershareprovider/usershareprovider.go | 22 ++++-- .../cs3org/reva/v2/pkg/events/sharing.go | 21 +++-- .../manager/jsoncs3/sharecache/sharecache.go | 8 +- vendor/modules.txt | 2 +- 11 files changed, 96 insertions(+), 112 deletions(-) create mode 100644 changelog/unreleased/fix-activity-rename.md diff --git a/changelog/unreleased/fix-activity-rename.md b/changelog/unreleased/fix-activity-rename.md new file mode 100644 index 00000000000..6ad23f289cf --- /dev/null +++ b/changelog/unreleased/fix-activity-rename.md @@ -0,0 +1,6 @@ +Bugfix: Kept historical resource naming in activity + +Kept historical resource naming after renaming in activity for shares and public links. + +https://github.com/owncloud/ocis/pull/10266 +https://github.com/owncloud/ocis/issues/10210 diff --git a/go.mod b/go.mod index 843bfc1761a..cf08b4b9ad3 100644 --- a/go.mod +++ b/go.mod @@ -15,7 +15,7 @@ require ( github.com/cenkalti/backoff v2.2.1+incompatible github.com/coreos/go-oidc/v3 v3.11.0 github.com/cs3org/go-cs3apis v0.0.0-20240724121416-062c4e3046cb - github.com/cs3org/reva/v2 v2.25.1-0.20241015142909-99548fe690bd + github.com/cs3org/reva/v2 v2.25.1-0.20241016095128-a322d4ae17f8 github.com/dhowden/tag v0.0.0-20230630033851-978a0926ee25 github.com/dutchcoders/go-clamd v0.0.0-20170520113014-b970184f4d9e github.com/egirna/icap-client v0.1.1 diff --git a/go.sum b/go.sum index 71045d11f83..bfa13245153 100644 --- a/go.sum +++ b/go.sum @@ -255,10 +255,8 @@ github.com/crewjam/saml v0.4.14 h1:g9FBNx62osKusnFzs3QTN5L9CVA/Egfgm+stJShzw/c= github.com/crewjam/saml v0.4.14/go.mod h1:UVSZCf18jJkk6GpWNVqcyQJMD5HsRugBPf4I1nl2mME= github.com/cs3org/go-cs3apis v0.0.0-20240724121416-062c4e3046cb h1:KmYZDReplv/yfwc1LNYpDcVhVujC3Pasv6WjXx1haSU= github.com/cs3org/go-cs3apis v0.0.0-20240724121416-062c4e3046cb/go.mod h1:yyP8PRo0EZou3nSH7H4qjlzQwaydPeIRNgX50npQHpE= -github.com/cs3org/reva/v2 v2.25.1-0.20241004072335-2a6fdbed139d h1:ETrSkU/XK50QzsxCAHQrr0b7klOHb9TVmJjmOsjMhr8= -github.com/cs3org/reva/v2 v2.25.1-0.20241004072335-2a6fdbed139d/go.mod h1:p7CHBXcg6sSqB+0JMNDfC1S7TSh9FghXkw1kTV3KcJI= -github.com/cs3org/reva/v2 v2.25.1-0.20241015142909-99548fe690bd h1:+cV0mcJR2v4Fidrs1ckM7c0+dSINTLsmECO76AbW8No= -github.com/cs3org/reva/v2 v2.25.1-0.20241015142909-99548fe690bd/go.mod h1:p7CHBXcg6sSqB+0JMNDfC1S7TSh9FghXkw1kTV3KcJI= +github.com/cs3org/reva/v2 v2.25.1-0.20241016095128-a322d4ae17f8 h1:MdW7vda/bf41NL1f6uZE5QQvIKNd4Zky18vm7LLIFI0= +github.com/cs3org/reva/v2 v2.25.1-0.20241016095128-a322d4ae17f8/go.mod h1:p7CHBXcg6sSqB+0JMNDfC1S7TSh9FghXkw1kTV3KcJI= github.com/cyberdelia/templates v0.0.0-20141128023046-ca7fffd4298c/go.mod h1:GyV+0YP4qX0UQ7r2MoYZ+AvYDp12OF5yg4q8rGnyNh4= github.com/cyphar/filepath-securejoin v0.2.4 h1:Ugdm7cg7i6ZK6x3xDF1oEu1nfkyfH53EtKeQYTC3kyg= github.com/cyphar/filepath-securejoin v0.2.4/go.mod h1:aPGpWjXOXUn2NCNjFvBE6aRxGGx79pTxQpKOJNYHHl4= diff --git a/services/activitylog/pkg/service/http.go b/services/activitylog/pkg/service/http.go index 349f8787a53..7afe8b745fc 100644 --- a/services/activitylog/pkg/service/http.go +++ b/services/activitylog/pkg/service/http.go @@ -160,22 +160,37 @@ func (s *ActivitylogService) HandleGetItemActivities(w http.ResponseWriter, r *h case events.ShareCreated: message = MessageShareCreated ts = utils.TSToTime(ev.CTime) - vars, err = s.GetVars(ctx, WithResource(toRef(ev.ItemID), false), WithUser(ev.Executant, nil, nil), WithSharee(ev.GranteeUserID, ev.GranteeGroupID)) + vars, err = s.GetVars(ctx, + WithResource(toRef(ev.ItemID), false), + WithVar("resource", storagespace.FormatResourceID(ev.ItemID), ev.ResourceName), + WithUser(ev.Executant, nil, nil), + WithSharee(ev.GranteeUserID, ev.GranteeGroupID)) case events.ShareUpdated: if ev.Sharer != nil && ev.ItemID != nil && ev.Sharer.GetOpaqueId() == ev.ItemID.GetSpaceId() { continue } message = MessageShareUpdated ts = utils.TSToTime(ev.MTime) - vars, err = s.GetVars(ctx, WithResource(toRef(ev.ItemID), false), WithUser(ev.Executant, nil, nil), WithTranslation(&t, loc, "field", ev.UpdateMask)) + vars, err = s.GetVars(ctx, + WithResource(toRef(ev.ItemID), false), + WithVar("resource", storagespace.FormatResourceID(ev.ItemID), ev.ResourceName), + WithUser(ev.Executant, nil, nil), + WithTranslation(&t, loc, "field", ev.UpdateMask)) case events.ShareRemoved: message = MessageShareDeleted ts = ev.Timestamp - vars, err = s.GetVars(ctx, WithResource(toRef(ev.ItemID), false), WithUser(ev.Executant, nil, nil), WithSharee(ev.GranteeUserID, ev.GranteeGroupID)) + vars, err = s.GetVars(ctx, + WithResource(toRef(ev.ItemID), false), + WithVar("resource", storagespace.FormatResourceID(ev.ItemID), ev.ResourceName), + WithUser(ev.Executant, nil, nil), + WithSharee(ev.GranteeUserID, ev.GranteeGroupID)) case events.LinkCreated: message = MessageLinkCreated ts = utils.TSToTime(ev.CTime) - vars, err = s.GetVars(ctx, WithResource(toRef(ev.ItemID), false), WithUser(ev.Executant, nil, nil)) + vars, err = s.GetVars(ctx, + WithResource(toRef(ev.ItemID), false), + WithVar("resource", storagespace.FormatResourceID(ev.ItemID), ev.ResourceName), + WithUser(ev.Executant, nil, nil)) case events.LinkUpdated: if ev.Sharer != nil && ev.ItemID != nil && ev.Sharer.GetOpaqueId() == ev.ItemID.GetSpaceId() { continue @@ -183,7 +198,7 @@ func (s *ActivitylogService) HandleGetItemActivities(w http.ResponseWriter, r *h message = MessageLinkUpdated ts = utils.TSToTime(ev.MTime) vars, err = s.GetVars(ctx, - WithResource(toRef(ev.ItemID), false), + WithVar("resource", storagespace.FormatResourceID(ev.ItemID), ev.ResourceName), WithUser(ev.Executant, nil, nil), WithTranslation(&t, loc, "field", []string{ev.FieldUpdated}), WithVar("token", ev.ItemID.GetOpaqueId(), ev.Token)) diff --git a/tests/acceptance/features/apiActivities/shareActivities.feature b/tests/acceptance/features/apiActivities/shareActivities.feature index 0b419afdd55..e89a345d27c 100644 --- a/tests/acceptance/features/apiActivities/shareActivities.feature +++ b/tests/acceptance/features/apiActivities/shareActivities.feature @@ -1128,7 +1128,7 @@ Feature: check share activity }, "variables": { "type": "object", - "required": ["field","folder","resource","token","user"], + "required": ["field","resource","token","user"], "properties": { "field": { "type": "object", @@ -1139,15 +1139,6 @@ Feature: check share activity } } }, - "folder": { - "type": "object", - "required": ["id","name"], - "properties": { - "name": { - "const": "new-space" - } - } - }, "resource": { "type": "object", "required": ["id","name"], @@ -1211,7 +1202,7 @@ Feature: check share activity }, "variables": { "type": "object", - "required": ["field","folder","resource","token","user"], + "required": ["field","resource","token","user"], "properties": { "field": { "type": "object", @@ -1222,15 +1213,6 @@ Feature: check share activity } } }, - "folder": { - "type": "object", - "required": ["id","name"], - "properties": { - "name": { - "const": "new-space" - } - } - }, "resource": { "type": "object", "required": ["id","name"], @@ -1294,7 +1276,7 @@ Feature: check share activity }, "variables": { "type": "object", - "required": ["field","folder","resource","token","user"], + "required": ["field","resource","token","user"], "properties": { "field": { "type": "object", @@ -1305,15 +1287,6 @@ Feature: check share activity } } }, - "folder": { - "type": "object", - "required": ["id","name"], - "properties": { - "name": { - "const": "new-space" - } - } - }, "resource": { "type": "object", "required": ["id","name"], @@ -1467,7 +1440,7 @@ Feature: check share activity }, "variables": { "type": "object", - "required": ["field","folder","resource","token","user"], + "required": ["field","resource","token","user"], "properties": { "field": { "type": "object", @@ -1478,15 +1451,6 @@ Feature: check share activity } } }, - "folder": { - "type": "object", - "required": ["id","name"], - "properties": { - "name": { - "const": "new-space" - } - } - }, "resource": { "type": "object", "required": ["id","name"], @@ -1550,7 +1514,7 @@ Feature: check share activity }, "variables": { "type": "object", - "required": ["field","folder","resource","token","user"], + "required": ["field","resource","token","user"], "properties": { "field": { "type": "object", @@ -1561,15 +1525,6 @@ Feature: check share activity } } }, - "folder": { - "type": "object", - "required": ["id","name"], - "properties": { - "name": { - "const": "new-space" - } - } - }, "resource": { "type": "object", "required": ["id","name"], @@ -1633,7 +1588,7 @@ Feature: check share activity }, "variables": { "type": "object", - "required": ["field","folder","resource","token","user"], + "required": ["field","resource","token","user"], "properties": { "field": { "type": "object", @@ -1644,15 +1599,6 @@ Feature: check share activity } } }, - "folder": { - "type": "object", - "required": ["id","name"], - "properties": { - "name": { - "const": "new-space" - } - } - }, "resource": { "type": "object", "required": ["id","name"], @@ -2064,17 +2010,8 @@ Feature: check share activity }, "variables": { "type": "object", - "required": ["folder","resource","user"], + "required": ["resource","user"], "properties": { - "folder": { - "type": "object", - "required": ["id","name"], - "properties": { - "name": { - "const": "Alice Hansen" - } - } - }, "resource": { "type": "object", "required": ["id","name"], @@ -2287,4 +2224,3 @@ Feature: check share activity } } """ - diff --git a/vendor/github.com/cs3org/reva/v2/internal/grpc/interceptors/eventsmiddleware/conversion.go b/vendor/github.com/cs3org/reva/v2/internal/grpc/interceptors/eventsmiddleware/conversion.go index 0bdedfe4ce6..1ed9ac92999 100644 --- a/vendor/github.com/cs3org/reva/v2/internal/grpc/interceptors/eventsmiddleware/conversion.go +++ b/vendor/github.com/cs3org/reva/v2/internal/grpc/interceptors/eventsmiddleware/conversion.go @@ -51,6 +51,7 @@ func ShareCreated(r *collaboration.CreateShareResponse, executant *user.User) ev GranteeUserID: r.Share.GetGrantee().GetUserId(), GranteeGroupID: r.Share.GetGrantee().GetGroupId(), ItemID: r.Share.ResourceId, + ResourceName: utils.ReadPlainFromOpaque(r.Opaque, "resourcename"), CTime: r.Share.Ctime, Permissions: r.Share.Permissions, } @@ -73,6 +74,7 @@ func ShareRemoved(r *collaboration.RemoveShareResponse, req *collaboration.Remov GranteeUserID: userid, GranteeGroupID: groupid, ItemID: rid, + ResourceName: utils.ReadPlainFromOpaque(r.Opaque, "resourcename"), Timestamp: time.Now(), } } @@ -83,6 +85,7 @@ func ShareUpdated(r *collaboration.UpdateShareResponse, req *collaboration.Updat Executant: executant.GetId(), ShareID: r.Share.Id, ItemID: r.Share.ResourceId, + ResourceName: utils.ReadPlainFromOpaque(r.Opaque, "resourcename"), Permissions: r.Share.Permissions, GranteeUserID: r.Share.GetGrantee().GetUserId(), GranteeGroupID: r.Share.GetGrantee().GetGroupId(), @@ -114,6 +117,7 @@ func LinkCreated(r *link.CreatePublicShareResponse, executant *user.User) events ShareID: r.Share.Id, Sharer: r.Share.Creator, ItemID: r.Share.ResourceId, + ResourceName: utils.ReadPlainFromOpaque(r.Opaque, "resourcename"), Permissions: r.Share.Permissions, DisplayName: r.Share.DisplayName, Expiration: r.Share.Expiration, @@ -130,6 +134,7 @@ func LinkUpdated(r *link.UpdatePublicShareResponse, req *link.UpdatePublicShareR ShareID: r.Share.Id, Sharer: r.Share.Creator, ItemID: r.Share.ResourceId, + ResourceName: utils.ReadPlainFromOpaque(r.Opaque, "resourcename"), Permissions: r.Share.Permissions, DisplayName: r.Share.DisplayName, Expiration: r.Share.Expiration, @@ -177,11 +182,12 @@ func LinkRemoved(r *link.RemovePublicShareResponse, req *link.RemovePublicShareR var rid *provider.ResourceId _ = utils.ReadJSONFromOpaque(r.Opaque, "resourceid", &rid) return events.LinkRemoved{ - Executant: executant.GetId(), - ShareID: req.Ref.GetId(), - ShareToken: req.Ref.GetToken(), - Timestamp: utils.TSNow(), - ItemID: rid, + Executant: executant.GetId(), + ShareID: req.Ref.GetId(), + ShareToken: req.Ref.GetToken(), + Timestamp: utils.TSNow(), + ItemID: rid, + ResourceName: utils.ReadPlainFromOpaque(r.Opaque, "resourcename"), } } diff --git a/vendor/github.com/cs3org/reva/v2/internal/grpc/services/publicshareprovider/publicshareprovider.go b/vendor/github.com/cs3org/reva/v2/internal/grpc/services/publicshareprovider/publicshareprovider.go index 7876750b670..1c97430457e 100644 --- a/vendor/github.com/cs3org/reva/v2/internal/grpc/services/publicshareprovider/publicshareprovider.go +++ b/vendor/github.com/cs3org/reva/v2/internal/grpc/services/publicshareprovider/publicshareprovider.go @@ -332,6 +332,7 @@ func (s *service) CreatePublicShare(ctx context.Context, req *link.CreatePublicS default: res.Status = status.NewOK(ctx) res.Share = share + res.Opaque = utils.AppendPlainToOpaque(nil, "resourcename", sRes.GetInfo().GetName()) } return res, nil @@ -353,15 +354,15 @@ func (s *service) RemovePublicShare(ctx context.Context, req *link.RemovePublicS Status: status.NewInternal(ctx, "error loading public share"), }, err } - if !publicshare.IsCreatedByUser(ps, user) { - sRes, err := gatewayClient.Stat(ctx, &provider.StatRequest{Ref: &provider.Reference{ResourceId: ps.ResourceId}}) - if err != nil { - log.Err(err).Interface("resource_id", ps.ResourceId).Msg("failed to stat shared resource") - return &link.RemovePublicShareResponse{ - Status: status.NewInternal(ctx, "failed to stat shared resource"), - }, err - } + sRes, err := gatewayClient.Stat(ctx, &provider.StatRequest{Ref: &provider.Reference{ResourceId: ps.ResourceId}}) + if err != nil { + log.Err(err).Interface("resource_id", ps.ResourceId).Msg("failed to stat shared resource") + return &link.RemovePublicShareResponse{ + Status: status.NewInternal(ctx, "failed to stat shared resource"), + }, err + } + if !publicshare.IsCreatedByUser(ps, user) { if !sRes.GetInfo().GetPermissionSet().RemoveGrant { return &link.RemovePublicShareResponse{ Status: status.NewPermissionDenied(ctx, nil, "no permission to delete public share"), @@ -374,8 +375,10 @@ func (s *service) RemovePublicShare(ctx context.Context, req *link.RemovePublicS Status: status.NewInternal(ctx, "error deleting public share"), }, err } + o := utils.AppendJSONToOpaque(nil, "resourceid", ps.GetResourceId()) + o = utils.AppendPlainToOpaque(o, "resourcename", sRes.GetInfo().GetName()) return &link.RemovePublicShareResponse{ - Opaque: utils.AppendJSONToOpaque(nil, "resourceid", ps.GetResourceId()), + Opaque: o, Status: status.NewOK(ctx), }, nil } @@ -603,6 +606,7 @@ func (s *service) UpdatePublicShare(ctx context.Context, req *link.UpdatePublicS res := &link.UpdatePublicShareResponse{ Status: status.NewOK(ctx), Share: updateR, + Opaque: utils.AppendPlainToOpaque(nil, "resourcename", sRes.GetInfo().GetName()), } return res, nil } diff --git a/vendor/github.com/cs3org/reva/v2/internal/grpc/services/usershareprovider/usershareprovider.go b/vendor/github.com/cs3org/reva/v2/internal/grpc/services/usershareprovider/usershareprovider.go index 60433148df7..66096689dd8 100644 --- a/vendor/github.com/cs3org/reva/v2/internal/grpc/services/usershareprovider/usershareprovider.go +++ b/vendor/github.com/cs3org/reva/v2/internal/grpc/services/usershareprovider/usershareprovider.go @@ -248,6 +248,7 @@ func (s *service) CreateShare(ctx context.Context, req *collaboration.CreateShar return &collaboration.CreateShareResponse{ Status: status.NewOK(ctx), Share: createdShare, + Opaque: utils.AppendPlainToOpaque(nil, "resourcename", sRes.GetInfo().GetName()), }, nil } @@ -296,6 +297,7 @@ func (s *service) RemoveShare(ctx context.Context, req *collaboration.RemoveShar } o := utils.AppendJSONToOpaque(nil, "resourceid", share.GetResourceId()) + o = utils.AppendPlainToOpaque(o, "resourcename", sRes.GetInfo().GetName()) if user := share.GetGrantee().GetUserId(); user != nil { o = utils.AppendJSONToOpaque(o, "granteeuserid", user) } else { @@ -447,6 +449,7 @@ func (s *service) UpdateShare(ctx context.Context, req *collaboration.UpdateShar res := &collaboration.UpdateShareResponse{ Status: status.NewOK(ctx), Share: share, + Opaque: utils.AppendPlainToOpaque(nil, "resourcename", sRes.GetInfo().GetName()), } return res, nil } @@ -535,16 +538,21 @@ func (s *service) UpdateReceivedShare(ctx context.Context, req *collaboration.Up var uid userpb.UserId _ = utils.ReadJSONFromOpaque(req.Opaque, "userid", &uid) updatedShare, err := s.sm.UpdateReceivedShare(ctx, req.Share, req.UpdateMask, &uid) - if err != nil { + switch err.(type) { + case nil: + return &collaboration.UpdateReceivedShareResponse{ + Status: status.NewOK(ctx), + Share: updatedShare, + }, nil + case errtypes.NotFound: return &collaboration.UpdateReceivedShareResponse{ - Status: status.NewInternal(ctx, "error updating received share"), + Status: status.NewNotFound(ctx, "error getting received share"), + }, nil + default: + return &collaboration.UpdateReceivedShareResponse{ + Status: status.NewInternal(ctx, "error getting received share"), }, nil } - - return &collaboration.UpdateReceivedShareResponse{ - Status: status.NewOK(ctx), - Share: updatedShare, - }, nil } func setReceivedShareMountPoint(ctx context.Context, gwc gateway.GatewayAPIClient, req *collaboration.UpdateReceivedShareRequest) (*rpc.Status, error) { diff --git a/vendor/github.com/cs3org/reva/v2/pkg/events/sharing.go b/vendor/github.com/cs3org/reva/v2/pkg/events/sharing.go index daa13ad11b6..f6bc215ea09 100644 --- a/vendor/github.com/cs3org/reva/v2/pkg/events/sharing.go +++ b/vendor/github.com/cs3org/reva/v2/pkg/events/sharing.go @@ -41,6 +41,7 @@ type ShareCreated struct { GranteeGroupID *group.GroupId Sharee *provider.Grantee ItemID *provider.ResourceId + ResourceName string Permissions *collaboration.SharePermissions CTime *types.Timestamp } @@ -62,8 +63,9 @@ type ShareRemoved struct { GranteeUserID *user.UserId GranteeGroupID *group.GroupId - ItemID *provider.ResourceId - Timestamp time.Time + ItemID *provider.ResourceId + ResourceName string + Timestamp time.Time } // Unmarshal to fulfill umarshaller interface @@ -78,6 +80,7 @@ type ShareUpdated struct { Executant *user.UserId ShareID *collaboration.ShareId ItemID *provider.ResourceId + ResourceName string Permissions *collaboration.SharePermissions GranteeUserID *user.UserId GranteeGroupID *group.GroupId @@ -101,6 +104,7 @@ type ShareExpired struct { ShareID *collaboration.ShareId ShareOwner *user.UserId ItemID *provider.ResourceId + Path string ExpiredAt time.Time // split the protobuf Grantee oneof so we can use stdlib encoding/json GranteeUserID *user.UserId @@ -119,6 +123,7 @@ type ReceivedShareUpdated struct { Executant *user.UserId ShareID *collaboration.ShareId ItemID *provider.ResourceId + Path string Permissions *collaboration.SharePermissions GranteeUserID *user.UserId GranteeGroupID *group.GroupId @@ -141,6 +146,7 @@ type LinkCreated struct { ShareID *link.PublicShareId Sharer *user.UserId ItemID *provider.ResourceId + ResourceName string Permissions *link.PublicSharePermissions DisplayName string Expiration *types.Timestamp @@ -162,6 +168,7 @@ type LinkUpdated struct { ShareID *link.PublicShareId Sharer *user.UserId ItemID *provider.ResourceId + ResourceName string Permissions *link.PublicSharePermissions DisplayName string Expiration *types.Timestamp @@ -185,6 +192,7 @@ type LinkAccessed struct { ShareID *link.PublicShareId Sharer *user.UserId ItemID *provider.ResourceId + Path string Permissions *link.PublicSharePermissions DisplayName string Expiration *types.Timestamp @@ -221,10 +229,11 @@ func (LinkAccessFailed) Unmarshal(v []byte) (interface{}, error) { type LinkRemoved struct { Executant *user.UserId // split protobuf Ref - ShareID *link.PublicShareId - ShareToken string - Timestamp *types.Timestamp - ItemID *provider.ResourceId + ShareID *link.PublicShareId + ShareToken string + Timestamp *types.Timestamp + ItemID *provider.ResourceId + ResourceName string } // Unmarshal to fulfill umarshaller interface diff --git a/vendor/github.com/cs3org/reva/v2/pkg/share/manager/jsoncs3/sharecache/sharecache.go b/vendor/github.com/cs3org/reva/v2/pkg/share/manager/jsoncs3/sharecache/sharecache.go index 3d6fbe70376..f763dee0f85 100644 --- a/vendor/github.com/cs3org/reva/v2/pkg/share/manager/jsoncs3/sharecache/sharecache.go +++ b/vendor/github.com/cs3org/reva/v2/pkg/share/manager/jsoncs3/sharecache/sharecache.go @@ -28,13 +28,15 @@ import ( "sync" "time" + "go.opentelemetry.io/otel/attribute" + "go.opentelemetry.io/otel/codes" + "golang.org/x/exp/maps" + "github.com/cs3org/reva/v2/pkg/appctx" "github.com/cs3org/reva/v2/pkg/errtypes" "github.com/cs3org/reva/v2/pkg/share/manager/jsoncs3/shareid" "github.com/cs3org/reva/v2/pkg/storage/utils/decomposedfs/mtimesyncedcache" "github.com/cs3org/reva/v2/pkg/storage/utils/metadata" - "go.opentelemetry.io/otel/attribute" - "go.opentelemetry.io/otel/codes" ) // name is the Tracer name used to identify this instrumentation library. @@ -246,7 +248,7 @@ func (c *Cache) List(ctx context.Context, userid string) (map[string]SpaceShareI for ssid, cached := range us.UserShares { r[ssid] = SpaceShareIDs{ - IDs: cached.IDs, + IDs: maps.Clone(cached.IDs), } } return r, nil diff --git a/vendor/modules.txt b/vendor/modules.txt index 00eade70485..17a83011dd2 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -367,7 +367,7 @@ github.com/cs3org/go-cs3apis/cs3/storage/provider/v1beta1 github.com/cs3org/go-cs3apis/cs3/storage/registry/v1beta1 github.com/cs3org/go-cs3apis/cs3/tx/v1beta1 github.com/cs3org/go-cs3apis/cs3/types/v1beta1 -# github.com/cs3org/reva/v2 v2.25.1-0.20241015142909-99548fe690bd +# github.com/cs3org/reva/v2 v2.25.1-0.20241016095128-a322d4ae17f8 ## explicit; go 1.21 github.com/cs3org/reva/v2/cmd/revad/internal/grace github.com/cs3org/reva/v2/cmd/revad/runtime