diff --git a/changelog/unreleased/bump-reva.md b/changelog/unreleased/bump-reva.md index b537cb657f8..a450197767e 100644 --- a/changelog/unreleased/bump-reva.md +++ b/changelog/unreleased/bump-reva.md @@ -2,5 +2,6 @@ Enhancement: Bump reva Bumps reva version +https://github.com/owncloud/ocis/pull/10172 https://github.com/owncloud/ocis/pull/10157 https://github.com/owncloud/ocis/pull/9817 diff --git a/go.mod b/go.mod index dd499f0d5a3..cac3ca18554 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.24.2-0.20240926082340-b5c3c6781528 + github.com/cs3org/reva/v2 v2.24.2-0.20240930121615-c33c803283ee 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 ceaa9220025..151c4c927d0 100644 --- a/go.sum +++ b/go.sum @@ -255,8 +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.24.2-0.20240926082340-b5c3c6781528 h1:sNq9lYNXQeqGGGe8m9zGdzBiw2QYs4fe0zXYTFfD++g= -github.com/cs3org/reva/v2 v2.24.2-0.20240926082340-b5c3c6781528/go.mod h1:p7CHBXcg6sSqB+0JMNDfC1S7TSh9FghXkw1kTV3KcJI= +github.com/cs3org/reva/v2 v2.24.2-0.20240930121615-c33c803283ee h1:+1sYiuA9LRQIznBNG1AFQoIGdCUCqQT1Dof2rTTsDm8= +github.com/cs3org/reva/v2 v2.24.2-0.20240930121615-c33c803283ee/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/graph/pkg/service/v0/tags.go b/services/graph/pkg/service/v0/tags.go index 22a9720d95a..b8310c970e6 100644 --- a/services/graph/pkg/service/v0/tags.go +++ b/services/graph/pkg/service/v0/tags.go @@ -86,6 +86,9 @@ func (g Graph) AssignTags(w http.ResponseWriter, r *http.Request) { return } + // use resource id from stat response to work on the actual resource and not a share jail item + rid = *sres.GetInfo().GetId() + pm := sres.GetInfo().GetPermissionSet() if pm == nil { g.logger.Error().Err(err).Msg("no permissionset on file") @@ -185,6 +188,9 @@ func (g Graph) UnassignTags(w http.ResponseWriter, r *http.Request) { return } + // use resource id from stat response to work on the actual resource and not a share jail item + rid = *sres.GetInfo().GetId() + pm := sres.GetInfo().GetPermissionSet() if pm == nil { g.logger.Error().Err(err).Msg("no permissionset on file") diff --git a/tests/acceptance/features/apiSharingNg1/propfindShares.feature b/tests/acceptance/features/apiSharingNg1/propfindShares.feature index c8be0b64716..93d893e88e6 100644 --- a/tests/acceptance/features/apiSharingNg1/propfindShares.feature +++ b/tests/acceptance/features/apiSharingNg1/propfindShares.feature @@ -49,7 +49,7 @@ Feature: propfind a shares | textfile.txt | textfile (1).txt | | folderToShare | folderToShare (1) | - @issue-4421 + @issue-4421 @issue-9933 @skip Scenario Outline: sharee PROPFIND same name shares shared by multiple users using new dav path Given using DAV path And user "Alice" has uploaded file with content "to share" to "textfile.txt" @@ -93,7 +93,7 @@ Feature: propfind a shares | new | textfile.txt | textfile (1).txt | | new | folderToShare | folderToShare (1) | - @issue-4421 + @issue-4421 @issue-9933 @skip Scenario: sharee PROPFIND shares with bracket in the name Given using spaces DAV path And user "Alice" has created folder "folderToShare" 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 61efbacefa1..92f6d745323 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 @@ -789,21 +789,26 @@ func (s *service) Stat(ctx context.Context, req *provider.StatRequest) (*provide return nil, err } - // TODO return reference? - return gatewayClient.Stat(ctx, &provider.StatRequest{ + statRes, err := gatewayClient.Stat(ctx, &provider.StatRequest{ Opaque: req.Opaque, Ref: buildReferenceInShare(req.Ref, receivedShare), ArbitraryMetadataKeys: req.ArbitraryMetadataKeys, }) + if err != nil { + return nil, err + } - // FIXME when stating a share jail child we need to rewrite the id and use the share + // when stating a share jail mountpoint we need to rewrite the id and use the share // jail space id as the mountpoint has a different id than the grant - // but that might be problematic for eg. wopi because it needs the correct id? ... - // ... but that should stat the grant anyway - - // FIXME when navigating via /dav/spaces/a0ca6a90-a365-4782-871e-d44447bbc668 the web ui seems - // to continue navigating based on the id of resources, causing the path to change. Is that related to WOPI? + if statRes.GetStatus().GetCode() == rpc.Code_CODE_OK && receivedShare.MountPoint.Path == strings.TrimPrefix(req.Ref.Path, "./") && statRes.Info != nil { + statRes.Info.Id = &provider.ResourceId{ + StorageId: utils.ShareStorageProviderID, + SpaceId: utils.ShareStorageSpaceID, + OpaqueId: receivedShare.GetShare().GetId().GetOpaqueId(), + } + } + return statRes, nil } func (s *service) ListContainerStream(req *provider.ListContainerStreamRequest, ss provider.ProviderAPI_ListContainerStreamServer) error { diff --git a/vendor/github.com/cs3org/reva/v2/pkg/storage/utils/metadata/cs3.go b/vendor/github.com/cs3org/reva/v2/pkg/storage/utils/metadata/cs3.go index 63cbb463bf8..0c2656c9c4a 100644 --- a/vendor/github.com/cs3org/reva/v2/pkg/storage/utils/metadata/cs3.go +++ b/vendor/github.com/cs3org/reva/v2/pkg/storage/utils/metadata/cs3.go @@ -22,6 +22,7 @@ import ( "bytes" "context" "errors" + "fmt" "io" "net/http" "os" @@ -107,6 +108,27 @@ func (cs3 *CS3) Init(ctx context.Context, spaceid string) (err error) { if err != nil { return err } + + lsRes, err := client.ListStorageSpaces(ctx, &provider.ListStorageSpacesRequest{ + Filters: []*provider.ListStorageSpacesRequest_Filter{ + { + Type: provider.ListStorageSpacesRequest_Filter_TYPE_ID, + Term: &provider.ListStorageSpacesRequest_Filter_Id{ + Id: &provider.StorageSpaceId{OpaqueId: spaceid + "!" + spaceid}, + }, + }, + }, + }) + switch { + case err != nil: + return err + case lsRes.Status.Code == rpc.Code_CODE_OK && len(lsRes.StorageSpaces) > 0: + if len(lsRes.StorageSpaces) > 0 { + cs3.SpaceRoot = lsRes.StorageSpaces[0].Root + return nil + } + } + // FIXME change CS3 api to allow sending a space id cssr, err := client.CreateStorageSpace(ctx, &provider.CreateStorageSpaceRequest{ Opaque: &types.Opaque{ @@ -127,8 +149,7 @@ func (cs3 *CS3) Init(ctx context.Context, spaceid string) (err error) { case cssr.Status.Code == rpc.Code_CODE_OK: cs3.SpaceRoot = cssr.StorageSpace.Root case cssr.Status.Code == rpc.Code_CODE_ALREADY_EXISTS: - // TODO make CreateStorageSpace return existing space? - cs3.SpaceRoot = &provider.ResourceId{SpaceId: spaceid, OpaqueId: spaceid} + return errtypes.AlreadyExists(fmt.Sprintf("user %s does not have access to metadata space %s, but it exists", cs3.serviceUser.Id.OpaqueId, spaceid)) default: return errtypes.NewErrtypeFromStatus(cssr.Status) } diff --git a/vendor/modules.txt b/vendor/modules.txt index 1db70c8132e..76074c08600 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.24.2-0.20240926082340-b5c3c6781528 +# github.com/cs3org/reva/v2 v2.24.2-0.20240930121615-c33c803283ee ## explicit; go 1.21 github.com/cs3org/reva/v2/cmd/revad/internal/grace github.com/cs3org/reva/v2/cmd/revad/runtime