Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for Spaces #4404

Open
wants to merge 145 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
145 commits
Select commit Hold shift + click to select a range
2bf2c87
removed unused config variable
gmgigi96 Oct 23, 2023
cce7bbc
removed old code of spaces
gmgigi96 Oct 24, 2023
04a4243
add boilerplate for spaces
gmgigi96 Oct 24, 2023
64602c6
add literals for space types
gmgigi96 Oct 24, 2023
adb7778
add memory driver for spaces
gmgigi96 Oct 24, 2023
f9dcee2
removed sql file
gmgigi96 Oct 24, 2023
82c6f51
add spaces loader
gmgigi96 Oct 24, 2023
0caea57
load spaces manager drivers
gmgigi96 Oct 24, 2023
3411bf0
add function to get spaces client
gmgigi96 Oct 24, 2023
1f6e508
redirect spaces request to spaces server
gmgigi96 Oct 24, 2023
025f6ab
add ocgraph service
gmgigi96 Oct 24, 2023
505c67d
add graph spec
gmgigi96 Oct 24, 2023
c451ac5
add permissions in the response
gmgigi96 Oct 24, 2023
fb5b43f
read and parse graph api filters to cs3 filters
gmgigi96 Oct 25, 2023
319b9eb
add filters when getting spaces
gmgigi96 Oct 25, 2023
8616525
temporary use my fork for go-cs3apis
gmgigi96 Oct 25, 2023
464b42a
fixes
gmgigi96 Oct 25, 2023
de140a7
load spacesregistry grpc service
gmgigi96 Oct 26, 2023
b066815
require user_space field in memory spaces driver
gmgigi96 Oct 26, 2023
b5f1788
fix urls
gmgigi96 Oct 26, 2023
bd5467e
fix permissions
gmgigi96 Oct 26, 2023
32132e4
fix role names
gmgigi96 Oct 26, 2023
fa2ee5f
fixes in permissions
gmgigi96 Oct 26, 2023
6df8b37
add missing fields
gmgigi96 Oct 27, 2023
e83bada
use path as drive alias
gmgigi96 Oct 27, 2023
014070d
add get me endpoint
gmgigi96 Oct 27, 2023
2d085e9
fix pattern
gmgigi96 Oct 27, 2023
6380bec
mock api endpoint
gmgigi96 Nov 1, 2023
7bee0a1
register ocapi svc
gmgigi96 Nov 1, 2023
ca1e813
make all api unprotected
gmgigi96 Nov 1, 2023
13ffdf2
fix home space naming
gmgigi96 Nov 1, 2023
73ab1c2
fix space discoverY
gmgigi96 Nov 7, 2023
d3f664b
handle spaces relative paths in webdav responses
gmgigi96 Nov 13, 2023
671664d
fix drive alias
gmgigi96 Nov 13, 2023
ab88cef
fix path
gmgigi96 Nov 13, 2023
2f78c61
expose shares as spaces
gmgigi96 Nov 14, 2023
3478beb
Merge branch 'upstream-master' into spaces
gmgigi96 Nov 14, 2023
d9a437f
add remote item info in the mountpoint space
gmgigi96 Nov 15, 2023
1a5af73
implemented shares in spaces
gmgigi96 Dec 1, 2023
7d97c00
encode ids with base32
gmgigi96 Dec 1, 2023
6e68d22
new item id for ocs
gmgigi96 Dec 1, 2023
b74479e
test
gmgigi96 Dec 1, 2023
4b066a7
filter out rejected shares from spaces
gmgigi96 Dec 1, 2023
6dbe2b2
stat shares concurrently
gmgigi96 Dec 1, 2023
48fc735
use base32 for encoding the space id
gmgigi96 Dec 1, 2023
9fbe2fb
fix item id on ocs
gmgigi96 Dec 4, 2023
8f79150
Merge branch 'upsmaster' into spaces
glpatcern Dec 13, 2023
bc75c67
Updated permissions for the new OC API
glpatcern Dec 15, 2023
fcd3850
Updated dependencies
glpatcern Dec 15, 2023
318f774
Changelog
glpatcern Dec 15, 2023
5589bba
Added TODO
glpatcern Dec 19, 2023
b513b0a
Fixed comparison
glpatcern Dec 19, 2023
de1ed72
fix tests
gmgigi96 Feb 1, 2024
ea6ed1b
Revert "Updated dependencies"
gmgigi96 Feb 2, 2024
f5d2837
updated dependencies and fix issue with new version of apis
gmgigi96 Feb 2, 2024
9380528
enable all shares
gmgigi96 Feb 8, 2024
9a016c0
propfind trashbin with spaces
gmgigi96 Feb 9, 2024
883641e
add utils pkg for dealing with spaces ids
gmgigi96 Feb 9, 2024
70c8dbe
refactoring
gmgigi96 Feb 12, 2024
e49ec28
configure user space for spaces registry
gmgigi96 Feb 12, 2024
5839f5d
use new space id format in ocdav
gmgigi96 Feb 12, 2024
1786a6b
add restore
gmgigi96 Feb 13, 2024
063b355
rename files
gmgigi96 Feb 13, 2024
6479ad4
add get drive by id
gmgigi96 Feb 13, 2024
c2b7d8a
filter by id
gmgigi96 Feb 13, 2024
e33ee9a
fixes in auth provider
gmgigi96 Feb 13, 2024
069a14e
fix endpoint for get drive by id
gmgigi96 Feb 13, 2024
32c4e11
rewritten mux for graph svc
gmgigi96 Feb 13, 2024
ec5211e
make shares ids uniform with latest changes
gmgigi96 Feb 14, 2024
694830d
share with spaces
gmgigi96 Feb 14, 2024
ee2fb22
fix share recipients for a resource
gmgigi96 Feb 14, 2024
0957187
list file versions
gmgigi96 Feb 14, 2024
5825a63
add sql driver for storing projects
gmgigi96 Feb 14, 2024
aa5f244
load sql driver for projects
gmgigi96 Feb 14, 2024
10b7c50
fix typo
gmgigi96 Feb 15, 2024
01b0f20
fix linter
gmgigi96 Feb 15, 2024
e712da1
removed spurious file
gmgigi96 Feb 15, 2024
2a1516d
add unit tests for sql projects driver
gmgigi96 Feb 15, 2024
b498493
use more robust proto.Equal for comparing protobuf messages
gmgigi96 Feb 15, 2024
169b0f3
go mod tidy
gmgigi96 Feb 15, 2024
46d6c5c
make app provider spaces aware
gmgigi96 Feb 15, 2024
0eb3274
Merge branch 'master-up' into spaces
gmgigi96 Feb 15, 2024
8fe97db
add missing header
gmgigi96 Feb 15, 2024
d888154
Merge branch 'master' into spaces
gmgigi96 Feb 26, 2024
0837b86
fix ocdav test
gmgigi96 Feb 26, 2024
d040877
Revert "fix ocdav test"
gmgigi96 Feb 27, 2024
4dc9bb7
fixes
gmgigi96 Feb 27, 2024
d927eba
revert fixes
gmgigi96 Mar 5, 2024
23a8608
removed not yet implements panic
gmgigi96 Mar 5, 2024
07e8f03
revert docker fil
gmgigi96 Mar 5, 2024
e8bead6
fix intergration tests
gmgigi96 Mar 6, 2024
c9298c1
fix sql lint
gmgigi96 Mar 6, 2024
6275653
Merge branch 'upmaster' into spaces
gmgigi96 Mar 6, 2024
1b1dc15
improve space detection with trashbins
gmgigi96 Mar 7, 2024
7d7b6dd
Use default spaces endpoint the gateway
gmgigi96 Mar 21, 2024
d786642
whitelist /graph/me for lw accounts
gmgigi96 Mar 22, 2024
97fe2c6
Renamed RootId
glpatcern Mar 22, 2024
519222b
fix relative path for shares
gmgigi96 Mar 22, 2024
e7c1a64
fix file info for app provider
gmgigi96 Mar 22, 2024
bfc366d
fix share with others browsing
gmgigi96 Apr 12, 2024
81e984d
fix linter
gmgigi96 Apr 12, 2024
d4820a2
Merge branch 'upmaster' into spaces
gmgigi96 Apr 12, 2024
78b59aa
fix share access from lw account
gmgigi96 Apr 17, 2024
2f5f617
fake signing-key endpoint
gmgigi96 Apr 17, 2024
62a77ad
fix archiver with spaces
gmgigi96 Apr 17, 2024
f67871d
removed unused permissions from /api endpoint
gmgigi96 Apr 24, 2024
bb743f0
Updated cs3apis
gmgigi96 Apr 24, 2024
777e4e0
quota for personal spaces
gmgigi96 Apr 24, 2024
e030efe
add quota to project space
gmgigi96 Apr 24, 2024
03e7426
add spaces.share_jail capability
gmgigi96 Apr 24, 2024
8d523d6
Updated dependencies
glpatcern Apr 3, 2024
f4fec76
Implemented ListExistingReceivedShares without caching
glpatcern Apr 3, 2024
01b3988
using forked go-cs3api
gmgigi96 Apr 25, 2024
35560a1
fix status code for ListExistingReceivedShares
gmgigi96 Apr 25, 2024
c137159
set quota for projects
gmgigi96 Apr 25, 2024
25cbf9c
expose fake quota for shares
gmgigi96 Apr 25, 2024
b1d35db
fix quota for projects
gmgigi96 Apr 25, 2024
6297252
decorate project space with last activity time
gmgigi96 Apr 25, 2024
f197f88
do not expose permissions on personal space
gmgigi96 May 28, 2024
1a30443
fix panic when getting list of personal spaces
labkode Jun 17, 2024
9fa81d6
return 200 http status code on proppatch
labkode Jun 17, 2024
af4c818
sharedWithMe boilerplate
gmgigi96 Jul 19, 2024
fb68d98
add missing fields in sharedWithMe response
gmgigi96 Jul 23, 2024
7aebeae
include file name in resource info result from eos
gmgigi96 Jul 23, 2024
24e8f9b
add roles and fix folder listing
gmgigi96 Jul 24, 2024
d4057d4
shares role mapping
gmgigi96 Jul 26, 2024
a15f8d3
rewrote router using chi lib
gmgigi96 Jul 31, 2024
1e9046e
first implementation of shareByMe endpoint
gmgigi96 Aug 1, 2024
1077617
add public links
gmgigi96 Aug 1, 2024
9310d4c
Implemented new ListExisting*Shares functions
glpatcern Aug 2, 2024
67d9bcb
Use the new APIs for sharedByMe
glpatcern Aug 2, 2024
6046f43
fix http routing for using go-chi
gmgigi96 Aug 5, 2024
671c20d
boilerplate for permissions endpoint
gmgigi96 Aug 5, 2024
6158790
get root drive permissions
gmgigi96 Aug 5, 2024
64f2ce3
get drive permissions
gmgigi96 Aug 5, 2024
2385eb9
fix permissions set
gmgigi96 Aug 13, 2024
c726deb
Fixed copy/paste typos
glpatcern Aug 14, 2024
d7bbeb2
Merge branch 'upsmaster' into spaces
glpatcern Aug 29, 2024
1880268
Merge branch 'upsmaster' into spaces
glpatcern Aug 30, 2024
c532c7e
Merge branch 'upsmaster' into spaces
glpatcern Oct 17, 2024
ee10143
Removed spurious placeholders
glpatcern Oct 17, 2024
38f7477
Merge branch 'upsmaster' into spaces
glpatcern Nov 1, 2024
e1c2e39
Move list my drives api endpoint to v1beta1
diocas Nov 19, 2024
2e13342
Add Thumbnails capability
diocas Nov 20, 2024
62ec6e9
Merge branch 'upsmaster' into spaces
glpatcern Nov 29, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions changelog/unreleased/spaces.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Enhancement: add support for Spaces

Credits to @gmgigi96

https://github.com/cs3org/reva/pull/4404
1 change: 1 addition & 0 deletions cmd/revad/runtime/loader.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ import (
_ "github.com/cs3org/reva/pkg/ocm/share/repository/loader"
_ "github.com/cs3org/reva/pkg/permission/manager/loader"
_ "github.com/cs3org/reva/pkg/preferences/loader"
_ "github.com/cs3org/reva/pkg/projects/manager/loader"
_ "github.com/cs3org/reva/pkg/prom/loader"
_ "github.com/cs3org/reva/pkg/publicshare/manager/loader"
_ "github.com/cs3org/reva/pkg/rhttp/datatx/manager/loader"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,40 +43,32 @@ user_layout = "{{.Username}}"
{{< /highlight >}}
{{% /dir %}}

{{% dir name="tmp_folder" type="string" default="/var/tmp" %}}
Path to temporary folder. [[Ref]](https://github.com/cs3org/reva/tree/master/internal/grpc/services/storageprovider/storageprovider.go#L65)
{{< highlight toml >}}
[grpc.services.storageprovider]
tmp_folder = "/var/tmp"
{{< /highlight >}}
{{% /dir %}}

{{% dir name="data_server_url" type="string" default="http://localhost/data" %}}
The URL for the data server. [[Ref]](https://github.com/cs3org/reva/tree/master/internal/grpc/services/storageprovider/storageprovider.go#L66)
The URL for the data server. [[Ref]](https://github.com/cs3org/reva/tree/master/internal/grpc/services/storageprovider/storageprovider.go#L65)
{{< highlight toml >}}
[grpc.services.storageprovider]
data_server_url = "http://localhost/data"
{{< /highlight >}}
{{% /dir %}}

{{% dir name="expose_data_server" type="bool" default=false %}}
Whether to expose data server. [[Ref]](https://github.com/cs3org/reva/tree/master/internal/grpc/services/storageprovider/storageprovider.go#L67)
Whether to expose data server. [[Ref]](https://github.com/cs3org/reva/tree/master/internal/grpc/services/storageprovider/storageprovider.go#L66)
{{< highlight toml >}}
[grpc.services.storageprovider]
expose_data_server = false
{{< /highlight >}}
{{% /dir %}}

{{% dir name="available_checksums" type="map[string]uint32" default=nil %}}
List of available checksums. [[Ref]](https://github.com/cs3org/reva/tree/master/internal/grpc/services/storageprovider/storageprovider.go#L68)
List of available checksums. [[Ref]](https://github.com/cs3org/reva/tree/master/internal/grpc/services/storageprovider/storageprovider.go#L67)
{{< highlight toml >}}
[grpc.services.storageprovider]
available_checksums = nil
{{< /highlight >}}
{{% /dir %}}

{{% dir name="custom_mime_types_json" type="string" default="nil" %}}
An optional mapping file with the list of supported custom file extensions and corresponding mime types. [[Ref]](https://github.com/cs3org/reva/tree/master/internal/grpc/services/storageprovider/storageprovider.go#L69)
An optional mapping file with the list of supported custom file extensions and corresponding mime types. [[Ref]](https://github.com/cs3org/reva/tree/master/internal/grpc/services/storageprovider/storageprovider.go#L68)
{{< highlight toml >}}
[grpc.services.storageprovider]
custom_mime_types_json = "nil"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,15 @@ description: >
# _struct: Config_

{{% dir name="insecure" type="bool" default=false %}}
Whether to skip certificate checks when sending requests. [[Ref]](https://github.com/cs3org/reva/tree/master/internal/http/services/owncloud/ocdav/ocdav.go#L110)
Whether to skip certificate checks when sending requests. [[Ref]](https://github.com/cs3org/reva/tree/master/internal/http/services/owncloud/ocdav/ocdav.go#L114)
{{< highlight toml >}}
[http.services.owncloud.ocdav]
insecure = false
{{< /highlight >}}
{{% /dir %}}

{{% dir name="notifications" type="map[string]interface{}" default=nil %}}
settings for the notification helper [[Ref]](https://github.com/cs3org/reva/tree/master/internal/http/services/owncloud/ocdav/ocdav.go#L123)
settings for the notification helper [[Ref]](https://github.com/cs3org/reva/tree/master/internal/http/services/owncloud/ocdav/ocdav.go#L127)
{{< highlight toml >}}
[http.services.owncloud.ocdav]
notifications = nil
Expand Down
12 changes: 11 additions & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ module github.com/cs3org/reva

require (
github.com/BurntSushi/toml v1.3.2
github.com/CiscoM31/godata v1.0.8
github.com/Masterminds/sprig v2.22.0+incompatible
github.com/ReneKroon/ttlcache/v2 v2.11.0
github.com/beevik/etree v1.3.0
Expand All @@ -18,7 +19,7 @@ require (
github.com/dolthub/go-mysql-server v0.14.0
github.com/gdexlab/go-render v1.0.1
github.com/glpatcern/go-mime v0.0.0-20221026162842-2a8d71ad17a9
github.com/go-chi/chi/v5 v5.0.12
github.com/go-chi/chi/v5 v5.1.0
github.com/go-ldap/ldap/v3 v3.4.6
github.com/go-playground/locales v0.14.1
github.com/go-playground/universal-translator v0.18.1
Expand All @@ -41,6 +42,7 @@ require (
github.com/nats-io/nats.go v1.37.0
github.com/onsi/ginkgo v1.16.5
github.com/onsi/gomega v1.30.0
github.com/owncloud/libre-graph-api-go v1.0.5-0.20240425090020-dba6d1507c38
github.com/pkg/errors v0.9.1
github.com/prometheus/client_golang v1.19.0
github.com/rs/cors v1.10.1
Expand All @@ -64,11 +66,14 @@ require (
gotest.tools v2.2.0+incompatible
)

require github.com/google/go-cmp v0.6.0 // indirect

require (
filippo.io/edwards25519 v1.1.0 // indirect
github.com/Azure/go-ntlmssp v0.0.0-20221128193559-754e69321358 // indirect
github.com/Masterminds/goutils v1.1.1 // indirect
github.com/Masterminds/semver v1.5.0 // indirect
github.com/alitto/pond v1.8.3
github.com/asaskevich/govalidator v0.0.0-20230301143203-a9d515a09cc2 // indirect
github.com/beorn7/perks v1.0.1 // indirect
github.com/bmizerany/pat v0.0.0-20210406213842-e4b6760bdd6f // indirect
Expand Down Expand Up @@ -132,3 +137,8 @@ require (
)

go 1.21

replace (
github.com/eventials/go-tus => github.com/andrewmostello/go-tus v0.0.0-20200314041820-904a9904af9a
github.com/oleiade/reflections => github.com/oleiade/reflections v1.0.1
)
8 changes: 8 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -770,6 +770,8 @@ github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03
github.com/BurntSushi/toml v1.3.2 h1:o7IhLm0Msx3BaB+n3Ag7L8EVlByGnpq14C4YWiu/gL8=
github.com/BurntSushi/toml v1.3.2/go.mod h1:CxXYINrC8qIiEnFrOxCa7Jy5BFHlXnUU2pbicEuybxQ=
github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo=
github.com/CiscoM31/godata v1.0.8 h1:ZhPjm1dSwZWMUvb33P4bcVm048iiQ1wbncoCc9bLChQ=
github.com/CiscoM31/godata v1.0.8/go.mod h1:ZMiT6JuD3Rm83HEtiTx4JEChsd25YCrxchKGag/sdTc=
github.com/DATA-DOG/go-sqlmock v1.5.0 h1:Shsta01QNfFxHCfpW6YH2STWB0MudeXXEWMr20OEh60=
github.com/DATA-DOG/go-sqlmock v1.5.0/go.mod h1:f/Ixk793poVmq4qj/V1dPUg2JEAKC73Q5eFN3EC/SaM=
github.com/JohnCGriffin/overflow v0.0.0-20211019200055-46fa312c352c/go.mod h1:X0CRv0ky0k6m906ixxpzmDRLvX58TFUKS2eePweuyxk=
Expand Down Expand Up @@ -802,6 +804,8 @@ github.com/alecthomas/units v0.0.0-20190924025748-f65c72e2690d/go.mod h1:rBZYJk5
github.com/alecthomas/units v0.0.0-20211218093645-b94a6e3cc137/go.mod h1:OMCwj8VM1Kc9e19TLln2VL61YJF0x1XFtfdL4JdbSyE=
github.com/alexbrainman/sspi v0.0.0-20210105120005-909beea2cc74 h1:Kk6a4nehpJ3UuJRqlA3JxYxBZEqCeOmATOvrbT4p9RA=
github.com/alexbrainman/sspi v0.0.0-20210105120005-909beea2cc74/go.mod h1:cEWa1LVoE5KvSD9ONXsZrj0z6KqySlCCNKHlLzbqAt4=
github.com/alitto/pond v1.8.3 h1:ydIqygCLVPqIX/USe5EaV/aSRXTRXDEI9JwuDdu+/xs=
github.com/alitto/pond v1.8.3/go.mod h1:CmvIIGd5jKLasGI3D87qDkQxjzChdKMmnXMg3fG6M6Q=
github.com/andybalholm/brotli v1.0.4/go.mod h1:fO7iG3H7G2nSZ7m0zPUDn85XEX2GTukHGRSepvi9Eig=
github.com/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kdvxnR2qWY=
github.com/apache/arrow/go/v10 v10.0.1/go.mod h1:YvhnlEePVnBS4+0z3fhPfUy7W1Ikj0Ih0vcRo/gZ1M0=
Expand Down Expand Up @@ -957,6 +961,8 @@ github.com/go-asn1-ber/asn1-ber v1.5.5 h1:MNHlNMBDgEKD4TcKr36vQN68BA00aDfjIt3/bD
github.com/go-asn1-ber/asn1-ber v1.5.5/go.mod h1:hEBeB/ic+5LoWskz+yKT7vGhhPYkProFKoKdwZRWMe0=
github.com/go-chi/chi/v5 v5.0.12 h1:9euLV5sTrTNTRUU9POmDUvfxyj6LAABLUcEWO+JJb4s=
github.com/go-chi/chi/v5 v5.0.12/go.mod h1:DslCQbL2OYiznFReuXYUmQ2hGd1aDpCnlMNITLSKoi8=
github.com/go-chi/chi/v5 v5.1.0 h1:acVI1TYaD+hhedDJ3r54HyA6sExp3HfXq7QWEEY/xMw=
github.com/go-chi/chi/v5 v5.1.0/go.mod h1:DslCQbL2OYiznFReuXYUmQ2hGd1aDpCnlMNITLSKoi8=
github.com/go-fonts/dejavu v0.1.0/go.mod h1:4Wt4I4OU2Nq9asgDCteaAaWZOV24E+0/Pwo0gppep4g=
github.com/go-fonts/latin-modern v0.2.0/go.mod h1:rQVLdDMK+mK1xscDwsqM5J8U2jrRa3T0ecnM9pNujks=
github.com/go-fonts/liberation v0.1.1/go.mod h1:K6qoJYypsmfVjWg8KOVDQhLc8UDgIK2HYqyqAO9z7GY=
Expand Down Expand Up @@ -1376,6 +1382,8 @@ github.com/openzipkin-contrib/zipkin-go-opentracing v0.4.5/go.mod h1:/wsWhb9smxS
github.com/openzipkin/zipkin-go v0.1.6/go.mod h1:QgAqvLzwWbR/WpD4A3cGpPtJrZXNIiJc5AZX7/PBEpw=
github.com/openzipkin/zipkin-go v0.2.1/go.mod h1:NaW6tEwdmWMaCDZzg8sh+IBNOxHMPnhQw8ySjnjRyN4=
github.com/openzipkin/zipkin-go v0.2.2/go.mod h1:NaW6tEwdmWMaCDZzg8sh+IBNOxHMPnhQw8ySjnjRyN4=
github.com/owncloud/libre-graph-api-go v1.0.5-0.20240425090020-dba6d1507c38 h1:Ld9bPh0c4y1H22mhiWZBw4AoupWjg8L0WLKX0hfbJho=
github.com/owncloud/libre-graph-api-go v1.0.5-0.20240425090020-dba6d1507c38/go.mod h1:yXI+rmE8yYx+ZsGVrnCpprw/gZMcxjwntnX2y2+VKxY=
github.com/pact-foundation/pact-go v1.0.4/go.mod h1:uExwJY4kCzNPcHRj+hCR/HBbOOIwwtUjcrb0b5/5kLM=
github.com/pascaldekloe/goe v0.0.0-20180627143212-57f6aae5913c/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc=
github.com/pborman/uuid v1.2.0/go.mod h1:X/NO0urCmaxf9VXbdlT7C2Yzkj2IKimNn4k+gtPdI/k=
Expand Down
2 changes: 2 additions & 0 deletions internal/grpc/services/gateway/gateway.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ type config struct {
DataTxEndpoint string `mapstructure:"datatx"`
DataGatewayEndpoint string `mapstructure:"datagateway"`
PermissionsEndpoint string `mapstructure:"permissionssvc"`
SpacesEndpoint string `mapstructure:"spacessvc"`
CommitShareToStorageGrant bool `mapstructure:"commit_share_to_storage_grant"`
CommitShareToStorageRef bool `mapstructure:"commit_share_to_storage_ref"`
DisableHomeCreationOnLogin bool `mapstructure:"disable_home_creation_on_login"`
Expand Down Expand Up @@ -101,6 +102,7 @@ func (c *config) ApplyDefaults() {
c.UserProviderEndpoint = sharedconf.GetGatewaySVC(c.UserProviderEndpoint)
c.GroupProviderEndpoint = sharedconf.GetGatewaySVC(c.GroupProviderEndpoint)
c.DataTxEndpoint = sharedconf.GetGatewaySVC(c.DataTxEndpoint)
c.SpacesEndpoint = sharedconf.GetGatewaySVC(c.SpacesEndpoint)

c.DataGatewayEndpoint = sharedconf.GetDataGateway(c.DataGatewayEndpoint)

Expand Down
68 changes: 57 additions & 11 deletions internal/grpc/services/gateway/publicshareprovider.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,14 @@ package gateway
import (
"context"

"github.com/alitto/pond"
gateway "github.com/cs3org/go-cs3apis/cs3/gateway/v1beta1"
rpc "github.com/cs3org/go-cs3apis/cs3/rpc/v1beta1"
collaboration "github.com/cs3org/go-cs3apis/cs3/sharing/collaboration/v1beta1"
link "github.com/cs3org/go-cs3apis/cs3/sharing/link/v1beta1"
provider "github.com/cs3org/go-cs3apis/cs3/storage/provider/v1beta1"
"github.com/cs3org/reva/pkg/appctx"
"github.com/cs3org/reva/pkg/errtypes"
"github.com/cs3org/reva/pkg/rgrpc/status"
"github.com/cs3org/reva/pkg/rgrpc/todo/pool"
"github.com/pkg/errors"
)
Expand Down Expand Up @@ -101,16 +103,6 @@ func (s *svc) GetPublicShare(ctx context.Context, req *link.GetPublicShareReques
return pClient.GetPublicShare(ctx, req)
}

func (s *svc) ListExistingPublicShares(ctx context.Context, req *link.ListPublicSharesRequest) (*gateway.ListExistingPublicSharesResponse, error) {
return nil, nil
}
func (s *svc) ListExistingReceivedShares(ctx context.Context, req *collaboration.ListReceivedSharesRequest) (*gateway.ListExistingReceivedSharesResponse, error) {
return nil, nil
}
func (s *svc) ListExistingShares(ctx context.Context, req *collaboration.ListSharesRequest) (*gateway.ListExistingSharesResponse, error) {
return nil, nil
}

func (s *svc) ListPublicShares(ctx context.Context, req *link.ListPublicSharesRequest) (*link.ListPublicSharesResponse, error) {
log := appctx.GetLogger(ctx)
log.Info().Msg("listing public shares")
Expand All @@ -133,6 +125,60 @@ func (s *svc) ListPublicShares(ctx context.Context, req *link.ListPublicSharesRe
return res, nil
}

func (s *svc) ListExistingPublicShares(ctx context.Context, req *link.ListPublicSharesRequest) (*gateway.ListExistingPublicSharesResponse, error) {
shares, err := s.ListPublicShares(ctx, req)
if err != nil {
err := errors.Wrap(err, "gateway: error calling ListExistingPublicShares")
return &gateway.ListExistingPublicSharesResponse{
Status: status.NewInternal(ctx, err, "error listing public shares"),
}, nil
}

sharesCh := make(chan *gateway.PublicShareResourceInfo, len(shares.Share))
pool := pond.New(50, len(shares.Share))
for _, share := range shares.Share {
share := share
// TODO (gdelmont): we should report any eventual error raised by the goroutines
pool.Submit(func() {
// TODO(lopresti) incorporate the cache layer from internal/http/services/owncloud/ocs/handlers/apps/sharing/shares/shares.go
stat, err := s.Stat(ctx, &provider.StatRequest{
Ref: &provider.Reference{
ResourceId: share.ResourceId,
},
})
if err != nil {
return
}
if stat.Status.Code != rpc.Code_CODE_OK {
return
}

sharesCh <- &gateway.PublicShareResourceInfo{
ResourceInfo: stat.Info,
PublicShare: share,
}
})
}

sris := make([]*gateway.PublicShareResourceInfo, 0, len(shares.Share))
done := make(chan struct{})
go func() {
for s := range sharesCh {
sris = append(sris, s)
}
done <- struct{}{}
}()
pool.StopAndWait()
close(sharesCh)
<-done
close(done)

return &gateway.ListExistingPublicSharesResponse{
ShareInfos: sris,
Status: status.NewOK(ctx),
}, nil
}

func (s *svc) UpdatePublicShare(ctx context.Context, req *link.UpdatePublicShareRequest) (*link.UpdatePublicShareResponse, error) {
log := appctx.GetLogger(ctx)
log.Info().Msg("update public share")
Expand Down
59 changes: 55 additions & 4 deletions internal/grpc/services/gateway/spaces.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,20 +22,71 @@ import (
"context"

provider "github.com/cs3org/go-cs3apis/cs3/storage/provider/v1beta1"
"github.com/cs3org/reva/pkg/rgrpc/status"
"github.com/cs3org/reva/pkg/rgrpc/todo/pool"
"github.com/pkg/errors"
)

func (s *svc) CreateStorageSpace(ctx context.Context, req *provider.CreateStorageSpaceRequest) (*provider.CreateStorageSpaceResponse, error) {
return nil, nil
c, err := pool.GetSpacesClient(pool.Endpoint(s.c.SpacesEndpoint))
if err != nil {
return &provider.CreateStorageSpaceResponse{
Status: status.NewInternal(ctx, err, "error getting spaces client"),
}, nil
}

res, err := c.CreateStorageSpace(ctx, req)
if err != nil {
return nil, errors.Wrap(err, "gateway: error calling CreateStorageSpace")
}

return res, nil
}

func (s *svc) ListStorageSpaces(ctx context.Context, req *provider.ListStorageSpacesRequest) (*provider.ListStorageSpacesResponse, error) {
return nil, nil
c, err := pool.GetSpacesClient(pool.Endpoint(s.c.SpacesEndpoint))
if err != nil {
return &provider.ListStorageSpacesResponse{
Status: status.NewInternal(ctx, err, "error getting spaces client"),
}, nil
}

res, err := c.ListStorageSpaces(ctx, req)
if err != nil {
return nil, errors.Wrap(err, "gateway: error calling ListStorageSpaces")
}

return res, nil
}

func (s *svc) UpdateStorageSpace(ctx context.Context, req *provider.UpdateStorageSpaceRequest) (*provider.UpdateStorageSpaceResponse, error) {
return nil, nil
c, err := pool.GetSpacesClient(pool.Endpoint(s.c.SpacesEndpoint))
if err != nil {
return &provider.UpdateStorageSpaceResponse{
Status: status.NewInternal(ctx, err, "error getting spaces client"),
}, nil
}

res, err := c.UpdateStorageSpace(ctx, req)
if err != nil {
return nil, errors.Wrap(err, "gateway: error calling ListStorageSpaces")
}

return res, nil
}

func (s *svc) DeleteStorageSpace(ctx context.Context, req *provider.DeleteStorageSpaceRequest) (*provider.DeleteStorageSpaceResponse, error) {
return nil, nil
c, err := pool.GetSpacesClient(pool.Endpoint(s.c.SpacesEndpoint))
if err != nil {
return &provider.DeleteStorageSpaceResponse{
Status: status.NewInternal(ctx, err, "error getting spaces client"),
}, nil
}

res, err := c.DeleteStorageSpace(ctx, req)
if err != nil {
return nil, errors.Wrap(err, "gateway: error calling ListStorageSpaces")
}

return res, nil
}
Loading