From ebe89910ca6bcd1b7605868642bf1353e56bbeaa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Friedrich=20Dreyer?= Date: Thu, 26 Sep 2024 15:02:18 +0200 Subject: [PATCH 1/4] bump reva to 02af5a266 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Jörn Friedrich Dreyer --- go.mod | 2 ++ go.sum | 4 +-- .../sharesstorageprovider.go | 21 ++++++++++------ .../reva/v2/pkg/storage/utils/metadata/cs3.go | 25 +++++++++++++++++-- vendor/modules.txt | 3 ++- 5 files changed, 42 insertions(+), 13 deletions(-) diff --git a/go.mod b/go.mod index dd499f0d5..a6f051ec0 100644 --- a/go.mod +++ b/go.mod @@ -365,6 +365,8 @@ replace github.com/unrolled/secure => github.com/DeepDiver1975/secure v0.0.0-202 replace github.com/go-micro/plugins/v4/store/nats-js-kv => github.com/kobergj/plugins/v4/store/nats-js-kv v0.0.0-20240807130109-f62bb67e8c90 +replace github.com/cs3org/reva/v2 => github.com/butonic/reva/v2 v2.19.1-0.20240926125755-02af5a26695d + // exclude the v2 line of go-sqlite3 which was released accidentally and prevents pulling in newer versions of go-sqlite3 // see https://github.com/mattn/go-sqlite3/issues/965 for more details exclude github.com/mattn/go-sqlite3 v2.0.3+incompatible diff --git a/go.sum b/go.sum index ceaa92200..d01339416 100644 --- a/go.sum +++ b/go.sum @@ -195,6 +195,8 @@ github.com/bombsimon/logrusr/v3 v3.1.0/go.mod h1:PksPPgSFEL2I52pla2glgCyyd2OqOHA github.com/boombuler/barcode v1.0.1-0.20190219062509-6c824513bacc/go.mod h1:paBWMcWSl3LHKBqUq+rly7CNSldXjb2rDl3JlRe0mD8= github.com/bufbuild/protocompile v0.4.0 h1:LbFKd2XowZvQ/kajzguUp2DC9UEIQhIq77fZZlaQsNA= github.com/bufbuild/protocompile v0.4.0/go.mod h1:3v93+mbWn/v3xzN+31nwkJfrEpAUwp+BagBSZWx+TP8= +github.com/butonic/reva/v2 v2.19.1-0.20240926125755-02af5a26695d h1:AXQmZPvOoLvkVns8IOy/gIoW7MVRiIySadXFhdwGrEg= +github.com/butonic/reva/v2 v2.19.1-0.20240926125755-02af5a26695d/go.mod h1:p7CHBXcg6sSqB+0JMNDfC1S7TSh9FghXkw1kTV3KcJI= github.com/bwesterb/go-ristretto v1.2.3/go.mod h1:fUIoIZaG73pV5biE2Blr2xEzDoMj7NFEuV9ekS419A0= github.com/bytecodealliance/wasmtime-go/v3 v3.0.2 h1:3uZCA/BLTIu+DqCfguByNMJa2HVHpXvjfy0Dy7g6fuA= github.com/bytecodealliance/wasmtime-go/v3 v3.0.2/go.mod h1:RnUjnIXxEJcL6BgCvNyzCCRzZcxCgsZCi+RNlvYor5Q= @@ -255,8 +257,6 @@ 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/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/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 61efbacef..92f6d7453 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 63cbb463b..0c2656c9c 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 1db70c813..1143e512b 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.20240926082340-b5c3c6781528 => github.com/butonic/reva/v2 v2.19.1-0.20240926125755-02af5a26695d ## explicit; go 1.21 github.com/cs3org/reva/v2/cmd/revad/internal/grace github.com/cs3org/reva/v2/cmd/revad/runtime @@ -2445,3 +2445,4 @@ stash.kopano.io/kgol/rndm # github.com/egirna/icap-client => github.com/fschade/icap-client v0.0.0-20240802074440-aade4a234387 # github.com/unrolled/secure => github.com/DeepDiver1975/secure v0.0.0-20240611112133-abc838fb797c # github.com/go-micro/plugins/v4/store/nats-js-kv => github.com/kobergj/plugins/v4/store/nats-js-kv v0.0.0-20240807130109-f62bb67e8c90 +# github.com/cs3org/reva/v2 => github.com/butonic/reva/v2 v2.19.1-0.20240926125755-02af5a26695d From fec6005458ebae871a0580fac1fa9551cd682902 Mon Sep 17 00:00:00 2001 From: Viktor Scharf Date: Mon, 30 Sep 2024 09:32:09 +0200 Subject: [PATCH 2/4] skip tests --- .../acceptance/features/apiSharingNg1/propfindShares.feature | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/acceptance/features/apiSharingNg1/propfindShares.feature b/tests/acceptance/features/apiSharingNg1/propfindShares.feature index c8be0b647..93d893e88 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" From 0f525e9575e53ea6f27ba299b22db505417d1a2b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Friedrich=20Dreyer?= Date: Mon, 30 Sep 2024 13:13:55 +0200 Subject: [PATCH 3/4] use actual resource id from stat for tagging MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Jörn Friedrich Dreyer --- services/graph/pkg/service/v0/tags.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/services/graph/pkg/service/v0/tags.go b/services/graph/pkg/service/v0/tags.go index 22a9720d9..b8310c970 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") From 633b6819f16aadd19db825c19345d536db254c7a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Friedrich=20Dreyer?= Date: Mon, 30 Sep 2024 14:21:00 +0200 Subject: [PATCH 4/4] add changelog, drop replace MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Jörn Friedrich Dreyer --- changelog/unreleased/bump-reva.md | 1 + go.mod | 4 +--- go.sum | 4 ++-- vendor/modules.txt | 3 +-- 4 files changed, 5 insertions(+), 7 deletions(-) diff --git a/changelog/unreleased/bump-reva.md b/changelog/unreleased/bump-reva.md index b537cb657..a45019776 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 a6f051ec0..cac3ca185 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 @@ -365,8 +365,6 @@ replace github.com/unrolled/secure => github.com/DeepDiver1975/secure v0.0.0-202 replace github.com/go-micro/plugins/v4/store/nats-js-kv => github.com/kobergj/plugins/v4/store/nats-js-kv v0.0.0-20240807130109-f62bb67e8c90 -replace github.com/cs3org/reva/v2 => github.com/butonic/reva/v2 v2.19.1-0.20240926125755-02af5a26695d - // exclude the v2 line of go-sqlite3 which was released accidentally and prevents pulling in newer versions of go-sqlite3 // see https://github.com/mattn/go-sqlite3/issues/965 for more details exclude github.com/mattn/go-sqlite3 v2.0.3+incompatible diff --git a/go.sum b/go.sum index d01339416..151c4c927 100644 --- a/go.sum +++ b/go.sum @@ -195,8 +195,6 @@ github.com/bombsimon/logrusr/v3 v3.1.0/go.mod h1:PksPPgSFEL2I52pla2glgCyyd2OqOHA github.com/boombuler/barcode v1.0.1-0.20190219062509-6c824513bacc/go.mod h1:paBWMcWSl3LHKBqUq+rly7CNSldXjb2rDl3JlRe0mD8= github.com/bufbuild/protocompile v0.4.0 h1:LbFKd2XowZvQ/kajzguUp2DC9UEIQhIq77fZZlaQsNA= github.com/bufbuild/protocompile v0.4.0/go.mod h1:3v93+mbWn/v3xzN+31nwkJfrEpAUwp+BagBSZWx+TP8= -github.com/butonic/reva/v2 v2.19.1-0.20240926125755-02af5a26695d h1:AXQmZPvOoLvkVns8IOy/gIoW7MVRiIySadXFhdwGrEg= -github.com/butonic/reva/v2 v2.19.1-0.20240926125755-02af5a26695d/go.mod h1:p7CHBXcg6sSqB+0JMNDfC1S7TSh9FghXkw1kTV3KcJI= github.com/bwesterb/go-ristretto v1.2.3/go.mod h1:fUIoIZaG73pV5biE2Blr2xEzDoMj7NFEuV9ekS419A0= github.com/bytecodealliance/wasmtime-go/v3 v3.0.2 h1:3uZCA/BLTIu+DqCfguByNMJa2HVHpXvjfy0Dy7g6fuA= github.com/bytecodealliance/wasmtime-go/v3 v3.0.2/go.mod h1:RnUjnIXxEJcL6BgCvNyzCCRzZcxCgsZCi+RNlvYor5Q= @@ -257,6 +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.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/vendor/modules.txt b/vendor/modules.txt index 1143e512b..76074c086 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/butonic/reva/v2 v2.19.1-0.20240926125755-02af5a26695d +# 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 @@ -2445,4 +2445,3 @@ stash.kopano.io/kgol/rndm # github.com/egirna/icap-client => github.com/fschade/icap-client v0.0.0-20240802074440-aade4a234387 # github.com/unrolled/secure => github.com/DeepDiver1975/secure v0.0.0-20240611112133-abc838fb797c # github.com/go-micro/plugins/v4/store/nats-js-kv => github.com/kobergj/plugins/v4/store/nats-js-kv v0.0.0-20240807130109-f62bb67e8c90 -# github.com/cs3org/reva/v2 => github.com/butonic/reva/v2 v2.19.1-0.20240926125755-02af5a26695d