From 8e0036753df78f8076feb20ea54e6732f4a575af Mon Sep 17 00:00:00 2001 From: jkoberg Date: Thu, 12 May 2022 10:15:54 +0200 Subject: [PATCH 1/5] use custom reva to check changes Signed-off-by: jkoberg --- changelog/unreleased/update-reva.md | 1 + go.mod | 2 ++ go.sum | 4 ++-- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/changelog/unreleased/update-reva.md b/changelog/unreleased/update-reva.md index 3b500a76d99..41e626d89ef 100644 --- a/changelog/unreleased/update-reva.md +++ b/changelog/unreleased/update-reva.md @@ -4,3 +4,4 @@ bumps reva version https://github.com/owncloud/ocis/pull/3746 https://github.com/owncloud/ocis/pull/3771 +https://github.com/owncloud/ocis/pull/3778 diff --git a/go.mod b/go.mod index e435a5c7db9..39389e1dedc 100644 --- a/go.mod +++ b/go.mod @@ -263,3 +263,5 @@ require ( // we need to use a fork to make the windows build pass replace github.com/pkg/xattr => github.com/micbar/xattr v0.4.6-0.20220215112335-88e74d648fb7 + +replace github.com/cs3org/reva/v2 => github.com/kobergj/reva/v2 v2.0.0-20220512084900-2d603425a2d9 diff --git a/go.sum b/go.sum index 9945cd3941a..a800f33e83f 100644 --- a/go.sum +++ b/go.sum @@ -296,8 +296,6 @@ github.com/crewjam/saml v0.4.6/go.mod h1:ZBOXnNPFzB3CgOkRm7Nd6IVdkG+l/wF+0ZXLqD9 github.com/cs3org/cato v0.0.0-20200828125504-e418fc54dd5e/go.mod h1:XJEZ3/EQuI3BXTp/6DUzFr850vlxq11I6satRtz0YQ4= github.com/cs3org/go-cs3apis v0.0.0-20220412090512-93c5918b4bde h1:WrD9O8ZaWvsm0eBzpzVBIuczDhqVq50Nmjc7PGHHA9Y= github.com/cs3org/go-cs3apis v0.0.0-20220412090512-93c5918b4bde/go.mod h1:UXha4TguuB52H14EMoSsCqDj7k8a/t7g4gVP+bgY5LY= -github.com/cs3org/reva/v2 v2.3.2-0.20220511140414-9205e8486b72 h1:V46ZlmNARoJ8b46lvQeO3CdCY6GAhzxpWHFxV8SX88U= -github.com/cs3org/reva/v2 v2.3.2-0.20220511140414-9205e8486b72/go.mod h1:uGeTncJa3FISh8AERkbZYVNXFV40PjYyRht5L09i+LQ= github.com/cubewise-code/go-mime v0.0.0-20200519001935-8c5762b177d8 h1:Z9lwXumT5ACSmJ7WGnFl+OMLLjpz5uR2fyz7dC255FI= github.com/cubewise-code/go-mime v0.0.0-20200519001935-8c5762b177d8/go.mod h1:4abs/jPXcmJzYoYGF91JF9Uq9s/KL5n1jvFDix8KcqY= github.com/cyberdelia/templates v0.0.0-20141128023046-ca7fffd4298c/go.mod h1:GyV+0YP4qX0UQ7r2MoYZ+AvYDp12OF5yg4q8rGnyNh4= @@ -800,6 +798,8 @@ github.com/klauspost/cpuid/v2 v2.0.1/go.mod h1:FInQzS24/EEf25PyTYn52gqo7WaD8xa02 github.com/klauspost/cpuid/v2 v2.0.4/go.mod h1:FInQzS24/EEf25PyTYn52gqo7WaD8xa0213Md/qVLRg= github.com/klauspost/cpuid/v2 v2.0.9 h1:lgaqFMSdTdQYdZ04uHyN2d/eKdOMyi2YLSvlQIBFYa4= github.com/klauspost/cpuid/v2 v2.0.9/go.mod h1:FInQzS24/EEf25PyTYn52gqo7WaD8xa0213Md/qVLRg= +github.com/kobergj/reva/v2 v2.0.0-20220512084900-2d603425a2d9 h1:Kj3xq6DVmXphBGtwDbddCSjniM2+cRZiCEOVFq5TTTU= +github.com/kobergj/reva/v2 v2.0.0-20220512084900-2d603425a2d9/go.mod h1:uGeTncJa3FISh8AERkbZYVNXFV40PjYyRht5L09i+LQ= github.com/kolo/xmlrpc v0.0.0-20200310150728-e0350524596b/go.mod h1:o03bZfuBwAXHetKXuInt4S7omeXUu62/A845kiycsSQ= github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/konsorten/go-windows-terminal-sequences v1.0.2/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= From 7e7e81412d9830bf62f9583fd131b1ba0cdaf4e7 Mon Sep 17 00:00:00 2001 From: jkoberg Date: Thu, 12 May 2022 12:29:03 +0200 Subject: [PATCH 2/5] don't query quota and children when space is disabled Signed-off-by: jkoberg --- extensions/graph/pkg/service/v0/drives.go | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/extensions/graph/pkg/service/v0/drives.go b/extensions/graph/pkg/service/v0/drives.go index 6fde3c5a002..0b3993d01fa 100644 --- a/extensions/graph/pkg/service/v0/drives.go +++ b/extensions/graph/pkg/service/v0/drives.go @@ -401,10 +401,14 @@ func (g Graph) formatDrives(ctx context.Context, baseURL *url.URL, storageSpaces if err != nil { return nil, err } - res.Special = g.GetExtendedSpaceProperties(ctx, baseURL, storageSpace) - res.Quota, err = g.getDriveQuota(ctx, storageSpace) - if err != nil { - return nil, err + + // can't access disabled space + if utils.ReadPlainFromOpaque(storageSpace.Opaque, "trashed") != "trashed" { + res.Special = g.GetExtendedSpaceProperties(ctx, baseURL, storageSpace) + res.Quota, err = g.getDriveQuota(ctx, storageSpace) + if err != nil { + return nil, err + } } responses = append(responses, res) } From 360be110e3500827ae6ca20edce5053c07b2e37a Mon Sep 17 00:00:00 2001 From: jkoberg Date: Fri, 13 May 2022 10:26:52 +0200 Subject: [PATCH 3/5] final touches Signed-off-by: jkoberg --- changelog/unreleased/prevent-access-to-disabled-space.md | 6 ++++++ go.mod | 4 +--- go.sum | 4 ++-- 3 files changed, 9 insertions(+), 5 deletions(-) create mode 100644 changelog/unreleased/prevent-access-to-disabled-space.md diff --git a/changelog/unreleased/prevent-access-to-disabled-space.md b/changelog/unreleased/prevent-access-to-disabled-space.md new file mode 100644 index 00000000000..0d3768a106b --- /dev/null +++ b/changelog/unreleased/prevent-access-to-disabled-space.md @@ -0,0 +1,6 @@ +Change: Prevent access to disabled space + +Previously managers where allowed to edit the space event when it is disabled +This is no longer possible + +https://github.com/owncloud/ocis/pull/3779 diff --git a/go.mod b/go.mod index 39389e1dedc..6fe675517b6 100644 --- a/go.mod +++ b/go.mod @@ -10,7 +10,7 @@ require ( github.com/blevesearch/bleve_index_api v1.0.1 github.com/coreos/go-oidc/v3 v3.1.0 github.com/cs3org/go-cs3apis v0.0.0-20220412090512-93c5918b4bde - github.com/cs3org/reva/v2 v2.3.2-0.20220511140414-9205e8486b72 + github.com/cs3org/reva/v2 v2.3.2-0.20220513093820-4f179b727de6 github.com/disintegration/imaging v1.6.2 github.com/go-chi/chi/v5 v5.0.7 github.com/go-chi/cors v1.2.1 @@ -263,5 +263,3 @@ require ( // we need to use a fork to make the windows build pass replace github.com/pkg/xattr => github.com/micbar/xattr v0.4.6-0.20220215112335-88e74d648fb7 - -replace github.com/cs3org/reva/v2 => github.com/kobergj/reva/v2 v2.0.0-20220512084900-2d603425a2d9 diff --git a/go.sum b/go.sum index a800f33e83f..2280fcf995d 100644 --- a/go.sum +++ b/go.sum @@ -296,6 +296,8 @@ github.com/crewjam/saml v0.4.6/go.mod h1:ZBOXnNPFzB3CgOkRm7Nd6IVdkG+l/wF+0ZXLqD9 github.com/cs3org/cato v0.0.0-20200828125504-e418fc54dd5e/go.mod h1:XJEZ3/EQuI3BXTp/6DUzFr850vlxq11I6satRtz0YQ4= github.com/cs3org/go-cs3apis v0.0.0-20220412090512-93c5918b4bde h1:WrD9O8ZaWvsm0eBzpzVBIuczDhqVq50Nmjc7PGHHA9Y= github.com/cs3org/go-cs3apis v0.0.0-20220412090512-93c5918b4bde/go.mod h1:UXha4TguuB52H14EMoSsCqDj7k8a/t7g4gVP+bgY5LY= +github.com/cs3org/reva/v2 v2.3.2-0.20220513093820-4f179b727de6 h1:SsL8/Uu/h8fYxi44iEg8MbziujeyVMZdwZECeaoMBww= +github.com/cs3org/reva/v2 v2.3.2-0.20220513093820-4f179b727de6/go.mod h1:uGeTncJa3FISh8AERkbZYVNXFV40PjYyRht5L09i+LQ= github.com/cubewise-code/go-mime v0.0.0-20200519001935-8c5762b177d8 h1:Z9lwXumT5ACSmJ7WGnFl+OMLLjpz5uR2fyz7dC255FI= github.com/cubewise-code/go-mime v0.0.0-20200519001935-8c5762b177d8/go.mod h1:4abs/jPXcmJzYoYGF91JF9Uq9s/KL5n1jvFDix8KcqY= github.com/cyberdelia/templates v0.0.0-20141128023046-ca7fffd4298c/go.mod h1:GyV+0YP4qX0UQ7r2MoYZ+AvYDp12OF5yg4q8rGnyNh4= @@ -798,8 +800,6 @@ github.com/klauspost/cpuid/v2 v2.0.1/go.mod h1:FInQzS24/EEf25PyTYn52gqo7WaD8xa02 github.com/klauspost/cpuid/v2 v2.0.4/go.mod h1:FInQzS24/EEf25PyTYn52gqo7WaD8xa0213Md/qVLRg= github.com/klauspost/cpuid/v2 v2.0.9 h1:lgaqFMSdTdQYdZ04uHyN2d/eKdOMyi2YLSvlQIBFYa4= github.com/klauspost/cpuid/v2 v2.0.9/go.mod h1:FInQzS24/EEf25PyTYn52gqo7WaD8xa0213Md/qVLRg= -github.com/kobergj/reva/v2 v2.0.0-20220512084900-2d603425a2d9 h1:Kj3xq6DVmXphBGtwDbddCSjniM2+cRZiCEOVFq5TTTU= -github.com/kobergj/reva/v2 v2.0.0-20220512084900-2d603425a2d9/go.mod h1:uGeTncJa3FISh8AERkbZYVNXFV40PjYyRht5L09i+LQ= github.com/kolo/xmlrpc v0.0.0-20200310150728-e0350524596b/go.mod h1:o03bZfuBwAXHetKXuInt4S7omeXUu62/A845kiycsSQ= github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/konsorten/go-windows-terminal-sequences v1.0.2/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= From d187af5cfb4850b402bb3ddc3d301d83cb46fabf Mon Sep 17 00:00:00 2001 From: jkoberg Date: Mon, 16 May 2022 10:04:09 +0200 Subject: [PATCH 4/5] update expected failures Signed-off-by: jkoberg --- tests/acceptance/expected-failures-localAPI-on-OCIS-storage.md | 3 --- 1 file changed, 3 deletions(-) diff --git a/tests/acceptance/expected-failures-localAPI-on-OCIS-storage.md b/tests/acceptance/expected-failures-localAPI-on-OCIS-storage.md index eae806c58a7..7ce27c67ffd 100644 --- a/tests/acceptance/expected-failures-localAPI-on-OCIS-storage.md +++ b/tests/acceptance/expected-failures-localAPI-on-OCIS-storage.md @@ -19,6 +19,3 @@ The expected failures in this file are from features in the owncloud/ocis repo. - [apiArchiver/downloadById.feature:134](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiArchiver/downloadById.feature#L134) - [apiArchiver/downloadById.feature:135](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiArchiver/downloadById.feature#L135) -#### [Overwriting a file in the space within the allowed quota does not work](https://github.com/owncloud/ocis/issues/2829) -- [apiSpaces/quota.feature:56](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiSpaces/quota.feature#L56) - From fc16349f734dd93ab22c9aa77c9990192a8da6ad Mon Sep 17 00:00:00 2001 From: jkoberg Date: Mon, 16 May 2022 10:27:18 +0200 Subject: [PATCH 5/5] fix changelog typo Signed-off-by: jkoberg --- changelog/unreleased/prevent-access-to-disabled-space.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/changelog/unreleased/prevent-access-to-disabled-space.md b/changelog/unreleased/prevent-access-to-disabled-space.md index 0d3768a106b..8d22249d4ed 100644 --- a/changelog/unreleased/prevent-access-to-disabled-space.md +++ b/changelog/unreleased/prevent-access-to-disabled-space.md @@ -1,6 +1,6 @@ Change: Prevent access to disabled space -Previously managers where allowed to edit the space event when it is disabled +Previously managers where allowed to edit the space even when it is disabled This is no longer possible https://github.com/owncloud/ocis/pull/3779