From 6d64c9e027b2ac1218b997a46bef0d210912e33a Mon Sep 17 00:00:00 2001 From: jkoberg Date: Fri, 18 Aug 2023 11:25:21 +0200 Subject: [PATCH] bump reva Signed-off-by: jkoberg --- go.mod | 2 +- go.sum | 6 ++---- .../sharesstorageprovider.go | 13 ++++++++++++- .../cs3org/reva/v2/pkg/events/sse.go | 19 +++++++++++++++++++ vendor/modules.txt | 2 +- 5 files changed, 35 insertions(+), 7 deletions(-) create mode 100644 vendor/github.com/cs3org/reva/v2/pkg/events/sse.go diff --git a/go.mod b/go.mod index 502dac70a26..32e57b51415 100644 --- a/go.mod +++ b/go.mod @@ -13,7 +13,7 @@ require ( github.com/coreos/go-oidc v2.2.1+incompatible github.com/coreos/go-oidc/v3 v3.6.0 github.com/cs3org/go-cs3apis v0.0.0-20230516150832-730ac860c71d - github.com/cs3org/reva/v2 v2.16.0 + github.com/cs3org/reva/v2 v2.16.1-0.20230825124557-5a36e37bf39b github.com/disintegration/imaging v1.6.2 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 0655641fa72..8d88997d042 100644 --- a/go.sum +++ b/go.sum @@ -864,10 +864,8 @@ github.com/crewjam/httperr v0.2.0 h1:b2BfXR8U3AlIHwNeFFvZ+BV1LFvKLlzMjzaTnZMybNo github.com/crewjam/httperr v0.2.0/go.mod h1:Jlz+Sg/XqBQhyMjdDiC+GNNRzZTD7x39Gu3pglZ5oH4= github.com/crewjam/saml v0.4.13 h1:TYHggH/hwP7eArqiXSJUvtOPNzQDyQ7vwmwEqlFWhMc= github.com/crewjam/saml v0.4.13/go.mod h1:igEejV+fihTIlHXYP8zOec3V5A8y3lws5bQBFsTm4gA= -github.com/cs3org/reva/v2 v2.15.1-0.20230816081257-e3a2be91bc4f h1:s0sBJbIB8atyhujVx/OaadujuRHer8ODPpWxyGWfw/s= -github.com/cs3org/reva/v2 v2.15.1-0.20230816081257-e3a2be91bc4f/go.mod h1:6GyXffmxluCqQxXaYuVC2Dg10gj0QW199iVlxV0EAJg= -github.com/cs3org/reva/v2 v2.16.0 h1:XBFoGhzKrcDqqRvYdicOpDOpQVIsRqALmEt8X0N+wm0= -github.com/cs3org/reva/v2 v2.16.0/go.mod h1:RvhuweTFqzezjUFU0SIdTXakrEx9vJlMvQ7znPXSP1g= +github.com/cs3org/reva/v2 v2.16.1-0.20230825124557-5a36e37bf39b h1:0xcrNCCwk6byF7blwx/PbfrDO0TeGGuj1lovDP0TNV4= +github.com/cs3org/reva/v2 v2.16.1-0.20230825124557-5a36e37bf39b/go.mod h1:RvhuweTFqzezjUFU0SIdTXakrEx9vJlMvQ7znPXSP1g= github.com/cyberdelia/templates v0.0.0-20141128023046-ca7fffd4298c/go.mod h1:GyV+0YP4qX0UQ7r2MoYZ+AvYDp12OF5yg4q8rGnyNh4= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= diff --git a/vendor/github.com/cs3org/reva/v2/internal/grpc/services/sharesstorageprovider/sharesstorageprovider.go b/vendor/github.com/cs3org/reva/v2/internal/grpc/services/sharesstorageprovider/sharesstorageprovider.go index 4b1a12f8baf..3176bb0ae5c 100644 --- a/vendor/github.com/cs3org/reva/v2/internal/grpc/services/sharesstorageprovider/sharesstorageprovider.go +++ b/vendor/github.com/cs3org/reva/v2/internal/grpc/services/sharesstorageprovider/sharesstorageprovider.go @@ -1059,7 +1059,7 @@ func (s *service) resolveAcceptedShare(ctx context.Context, ref *provider.Refere if receivedShare.State != collaboration.ShareState_SHARE_STATE_ACCEPTED { continue } - if strings.HasPrefix(strings.TrimPrefix(ref.Path, "./"), receivedShare.MountPoint.Path) { + if isMountPointForPath(receivedShare.MountPoint.Path, ref.Path) { return receivedShare, lsRes.Status, nil } } @@ -1069,6 +1069,17 @@ func (s *service) resolveAcceptedShare(ctx context.Context, ref *provider.Refere return nil, status.NewNotFound(ctx, "sharesstorageprovider: not found "+ref.String()), nil } +func isMountPointForPath(mountpoint, path string) bool { + requiredSegments := strings.Split(strings.TrimPrefix(mountpoint, "./"), "/") + pathSegments := strings.Split(strings.TrimPrefix(path, "./"), "/") + for i := range requiredSegments { + if pathSegments[i] != requiredSegments[i] { + return false + } + } + return true +} + func (s *service) rejectReceivedShare(ctx context.Context, receivedShare *collaboration.ReceivedShare) error { receivedShare.State = collaboration.ShareState_SHARE_STATE_REJECTED receivedShare.MountPoint = nil diff --git a/vendor/github.com/cs3org/reva/v2/pkg/events/sse.go b/vendor/github.com/cs3org/reva/v2/pkg/events/sse.go new file mode 100644 index 00000000000..34841c81f37 --- /dev/null +++ b/vendor/github.com/cs3org/reva/v2/pkg/events/sse.go @@ -0,0 +1,19 @@ +package events + +import ( + "encoding/json" +) + +// SendSEE instructs the sse service to send a notification to a user +type SendSSE struct { + UserID string + Type string + Message []byte +} + +// Unmarshal to fulfill umarshaller interface +func (SendSSE) Unmarshal(v []byte) (interface{}, error) { + e := SendSSE{} + err := json.Unmarshal(v, &e) + return e, err +} diff --git a/vendor/modules.txt b/vendor/modules.txt index b18a56afc87..fb0d2086189 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -354,7 +354,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.16.0 +# github.com/cs3org/reva/v2 v2.16.1-0.20230825124557-5a36e37bf39b ## explicit; go 1.20 github.com/cs3org/reva/v2/cmd/revad/internal/grace github.com/cs3org/reva/v2/cmd/revad/runtime