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

Spaces registry #2234

Merged
merged 268 commits into from
Dec 6, 2021
Merged
Show file tree
Hide file tree
Changes from 222 commits
Commits
Show all changes
268 commits
Select commit Hold shift + click to select a range
5f8edba
Do not allow cross-storage restores
aduffeck Oct 26, 2021
958f9b2
Fix expected failures for s3ng
aduffeck Oct 26, 2021
028b279
Be more robust when handling error cases
aduffeck Oct 27, 2021
4f0949d
WIP: Fix restoring recycle items
aduffeck Oct 27, 2021
a5ca0f3
Fix unit tests
aduffeck Oct 27, 2021
df6021e
Fix license headers
aduffeck Oct 27, 2021
a00d562
Fix linter issues
aduffeck Oct 27, 2021
7f40804
move unwrapping and wrapping of paths to the gateway
Aug 24, 2021
434fb0e
minimal space provider and registry prototypes
butonic Nov 3, 2021
606bfc4
Merge branch 'master' into sharestorageprovider-oc10-sm
butonic Nov 4, 2021
38d8d72
add missing go.sum entry
butonic Nov 4, 2021
e5bcf1e
fix import
butonic Nov 4, 2021
5b5f8ed
add embedded mounts when listing /home
butonic Nov 4, 2021
4e257e8
remove unexpected passes
butonic Nov 4, 2021
6380dc1
use space registry to manage aliases
butonic Nov 4, 2021
e735fed
add changelog
kobergj Nov 5, 2021
d615470
add old logic as comment as we want to bring parts of it back for OCM
butonic Nov 5, 2021
1df7cc2
Merge branch 'master' into spaces-registry-and-provider
butonic Nov 5, 2021
965bf36
further work
butonic Nov 5, 2021
03b1f29
Merge branch 'sharestorageprovider-oc10-sm' into spaces-registry-and-…
butonic Nov 5, 2021
2f157f9
fix access vi space & path
butonic Nov 8, 2021
ab89f60
Merge branch 'wrap-unwrap-gateway2' into spaces-registry-and-provider
butonic Nov 8, 2021
4fb0937
register /home as path alies for the users personal space
butonic Nov 8, 2021
e8b8376
update toml files
butonic Nov 8, 2021
4704592
Merge branch 'master' into spaces-registry-and-provider
butonic Nov 8, 2021
70e7123
rewrite gateway Stat()
butonic Nov 8, 2021
07bde6e
rewrite ListContainer()
butonic Nov 8, 2021
34a8bc7
return not found Status instead of error
butonic Nov 8, 2021
c37fbbd
add comment
butonic Nov 8, 2021
9a465ad
fix create container
butonic Nov 8, 2021
1c43cb6
introduce findAndUnwrap
butonic Nov 8, 2021
31477d2
internally use spaces instead of simple download protocol
butonic Nov 8, 2021
5b1a006
fix drone pipeline
butonic Nov 9, 2021
02f269a
fix litmus on spaces
butonic Nov 9, 2021
968cc72
check if parent exists in decomposedfs
butonic Nov 9, 2021
486eaf8
align local frontend config with drone
butonic Nov 9, 2021
344dcbc
fix move
butonic Nov 9, 2021
43145cb
fix copy
butonic Nov 9, 2021
c9b8418
spaces provider is no longer needed
butonic Nov 9, 2021
377e594
don't discards absolute pathes on providers
kobergj Nov 9, 2021
96894af
add DeleteStorageSpace to internal storage interface
butonic Nov 9, 2021
f44ba49
sharesstorageprovider: implement ListStorageSpaces
butonic Nov 9, 2021
ad4fdcf
tune ListContainer
butonic Nov 9, 2021
ef9fe0b
fine tune spaces registry
butonic Nov 10, 2021
61a8830
drop mount_id config, fix decomposedfs shares spaces
butonic Nov 10, 2021
c79ec14
try fixing shares
butonic Nov 10, 2021
7b84e8b
Merge branch 'master' into spaces-registry-and-provider
butonic Nov 10, 2021
865d4f3
fix shares
butonic Nov 10, 2021
dfff5eb
also wipe spaces when deleting users
butonic Nov 10, 2021
b03e65a
try with empty quota
butonic Nov 10, 2021
c38ad03
add NewErrtypeFromStatus() helper
butonic Nov 11, 2021
bf9b79d
make decomposedfs use nodeid as spaceid, hide spaces of type share
butonic Nov 11, 2021
2882767
align and refactor Stat and ListContainer
butonic Nov 11, 2021
9715963
make sharesstorageprovider list each share as a space
butonic Nov 11, 2021
5637244
make spaces registry stat resource id instead of calling list spaces
butonic Nov 11, 2021
547975d
sharesstorageprovider align stat & list
butonic Nov 11, 2021
5e452f4
register shares spaces as /home/Shares/{name}
butonic Nov 11, 2021
fdf3500
refactor sharesstorageprovider
butonic Nov 11, 2021
d4eeb60
add TODO
butonic Nov 12, 2021
977b304
make gateway storageprovider return correct type on stat
butonic Nov 12, 2021
cb03124
fix path when listing unacceptaed shares
butonic Nov 12, 2021
02d7a7c
add public function commend fort hound
butonic Nov 12, 2021
8e04e50
make gateway handle absolute id based stats correctly
butonic Nov 12, 2021
a248ca8
make spaces registry use configured provider path in id based requests
butonic Nov 12, 2021
ea3b97f
Merge branch 'master' into spaces-registry-and-provider
butonic Nov 12, 2021
92a9b3c
update combined.toml
butonic Nov 12, 2021
346e0c2
drop gateway storage_rules
butonic Nov 12, 2021
5651f09
fix stat to root of space and absolute id
butonic Nov 12, 2021
5cad7e1
better handle relative references
butonic Nov 12, 2021
4b3f5ec
revert path mangling for unaccepted shares
butonic Nov 12, 2021
eb1d562
cleanup toml config
butonic Nov 12, 2021
3081995
remove stale TODO
butonic Nov 12, 2021
86d20e4
avoid caching sideeffects for now
butonic Nov 12, 2021
3c4be00
try cleaner responsibilities
butonic Nov 15, 2021
e4ea550
always send spaceid!nodeid in storagespaceid
butonic Nov 15, 2021
d58109a
fix spaces litmus tests
butonic Nov 15, 2021
8921cd3
make hound happy
butonic Nov 15, 2021
316cca6
fix spaces GET
butonic Nov 15, 2021
3e3f0a0
fix up & download into shares
butonic Nov 16, 2021
f2a3daa
send space type when resolving id based request
butonic Nov 16, 2021
5565241
fix public share listing
butonic Nov 16, 2021
9b53c4d
fix create container on public share
butonic Nov 16, 2021
1bb67bc
use reference for internal recycle api
butonic Nov 16, 2021
c9232aa
fix shares
butonic Nov 16, 2021
ad2240a
allow CurrentUser and Space in space registry template
butonic Nov 16, 2021
4c2b065
ignore error when unsetting a not existing favorite flag
butonic Nov 16, 2021
7cc4aeb
update path in dav report comment
butonic Nov 16, 2021
dc5fd44
only list spaces as nodes if no matches were found
butonic Nov 16, 2021
8f7298b
create a copy of the reference to prevent losing the original
butonic Nov 16, 2021
f10ab0a
get rid of /home mountpoint to make paths unique
butonic Nov 16, 2021
e8736fd
add template to ocs home namespace
butonic Nov 16, 2021
c056183
id based requests must be forwarded as is
butonic Nov 17, 2021
05e7a8a
decomposedfs: fix spaces root
butonic Nov 17, 2021
792fbae
fix public path_template
butonic Nov 17, 2021
7a6cce5
correct config
butonic Nov 17, 2021
b8528db
Merge branch 'master' into spaces-registry-and-provider
butonic Nov 17, 2021
ab0f73a
decomposedfs: add missing error check
kobergj Nov 17, 2021
701eb14
allow sending uuid in createspace
butonic Nov 17, 2021
41a6263
fix drone config
kobergj Nov 17, 2021
f526db7
Merge remote-tracking branch 'upstream/master' into spaces-registry-a…
kobergj Nov 17, 2021
9f70310
remove unexpected passes
butonic Nov 17, 2021
9ecf39a
add xattrs.CopyMetadata() function
butonic Nov 17, 2021
61cfb61
when constructing a folder wipe checksums from metadata
butonic Nov 17, 2021
cf4c62b
align sharesstorageprovider up & download
butonic Nov 17, 2021
d16cfc8
drop unused local toml config
butonic Nov 17, 2021
d08a169
decomposedfs: copy metadata from old to new revision
butonic Nov 17, 2021
e584953
fix loop when downloading from a share
butonic Nov 18, 2021
665228d
fix npe when no checksim is set
butonic Nov 18, 2021
80cb931
fix renaming share
butonic Nov 18, 2021
64f9144
Merge branch 'master' into spaces-registry-and-provider
butonic Nov 18, 2021
d2062a9
make resharing possible
kobergj Nov 18, 2021
01de9ae
work on ocs share paths
butonic Nov 18, 2021
3d62801
cut off path of received shares
butonic Nov 18, 2021
dfea441
work on ocs shares paths
butonic Nov 18, 2021
862035c
use space id when listing trash
butonic Nov 18, 2021
8b31dc6
set name when err == nil
butonic Nov 18, 2021
0d0a62a
use spaceid instead of owner id when deleting a resource
butonic Nov 18, 2021
8ac1fea
fix pending share path
butonic Nov 18, 2021
d2fe978
unmount share on delete
butonic Nov 18, 2021
b1831ae
wrap trash item paths correctly in the gateway
butonic Nov 18, 2021
9e8d93b
the trash key contains root node and relative path
butonic Nov 18, 2021
c5ed2d4
unprefix trash item path in ocdav
butonic Nov 18, 2021
1f3a4f9
fix listing recycle in decomposedfs
butonic Nov 18, 2021
f87582f
add docs to public CopyMetadata()
butonic Nov 18, 2021
f0f8217
fix renaming shares
butonic Nov 18, 2021
1064cde
wrap path in share response
butonic Nov 18, 2021
d5a9b80
wrap path in more share responses
butonic Nov 18, 2021
2821592
fix public storage spaces path_template
butonic Nov 18, 2021
d74fb64
omit virtual spaces config for now
butonic Nov 18, 2021
eca832a
omit PUT request for empty files
butonic Nov 19, 2021
c153d74
Do not try to walk an empty path
aduffeck Nov 19, 2021
992b8f6
publicstorageprovider: do not prefix relative path to ListContainer i…
butonic Nov 19, 2021
e57a60b
publicstorageprovider: fix id based stat
butonic Nov 19, 2021
a19db8d
return expected xml error on public link auth errors
butonic Nov 19, 2021
b9a8e72
fix sharesstorageprovider unit tests
kobergj Nov 19, 2021
715de88
fix file_target
butonic Nov 19, 2021
c07ed9a
unwrap permission error from scope
butonic Nov 19, 2021
920a520
fix sharing unit tests
kobergj Nov 19, 2021
fff6992
forward recycle item key when purging
butonic Nov 19, 2021
56607fb
work on decomposedfs tree tests
butonic Nov 19, 2021
d290dc3
fix chunked upload
butonic Nov 19, 2021
140e553
Merge branch 'master' into spaces-registry-and-provider
butonic Nov 19, 2021
0fac1cc
refactor gateway RestoreRecycleItem
butonic Nov 19, 2021
e878c10
fix trash restore
butonic Nov 19, 2021
4581ff4
return ocs body on error when stating during create share
butonic Nov 19, 2021
96499d4
remove unexpected passes
butonic Nov 19, 2021
551aa96
render xml when resoucre not found on /dav/meta
butonic Nov 19, 2021
8ef6e9f
Add grpc integration tests for the gateway
aduffeck Nov 19, 2021
1fff339
skip spaces tests and fix tree_test
kobergj Nov 22, 2021
a212095
when resource has same storageid delegate MOVE decision
butonic Nov 22, 2021
1a5a95b
Merge branch 'master' into spaces-registry-and-provider
butonic Nov 22, 2021
14b1023
make content disposition reflect request base path
butonic Nov 22, 2021
9d3230b
remove EnableHome from decomposedfs
kobergj Nov 22, 2021
a7e7395
make unit tests presumably green
kobergj Nov 22, 2021
e1eb328
remove home references from decomposedfs
kobergj Nov 22, 2021
d1ed00d
use exact path match to find responsible ListRecycle provider
butonic Nov 22, 2021
eb1acc5
fix log typo
butonic Nov 22, 2021
9062142
fix finding correct recycle source provider
butonic Nov 22, 2021
ea9b55b
fix restore ref unwrapping
butonic Nov 22, 2021
3ac05e2
align expected failures
butonic Nov 22, 2021
6b76b4b
fix decomposedfs/node unit tests
kobergj Nov 23, 2021
f043f14
fix decomposedfs/tree unit tests
kobergj Nov 23, 2021
fff2238
fix decomposedfs unit tests
kobergj Nov 23, 2021
db9865b
fix decomposedfs concurrency unit tests
kobergj Nov 23, 2021
4ca5641
look up home provider from gateway
butonic Nov 23, 2021
545897d
make the linter happy
kobergj Nov 23, 2021
7e1ecf4
make build work again
kobergj Nov 23, 2021
cd6d77a
make linter even more happy
kobergj Nov 23, 2021
7e5023a
more linting fixes
kobergj Nov 24, 2021
6654150
add even more linting fixes
kobergj Nov 24, 2021
f8d31fc
fix trash item lookup
butonic Nov 24, 2021
adc54c2
cache spaceid -> provider lookup
butonic Nov 24, 2021
91618b5
actually cache providers
butonic Nov 24, 2021
693c435
first round of integration test fixes
kobergj Nov 24, 2021
98f9838
get rid of old cache in spaces registry
butonic Nov 24, 2021
d293937
don't use custom tempdir for integration tests
kobergj Nov 24, 2021
01cc82d
fix linter, add mount point caching thoughts
butonic Nov 24, 2021
3a517ef
fix log typo
butonic Nov 24, 2021
a4a1142
update spaces Readme
butonic Nov 24, 2021
ddd9661
comment unused mount cache for now
butonic Nov 24, 2021
052299d
integration test fixes part II
kobergj Nov 24, 2021
4c73911
fix restore logic in decomposedfs
kobergj Nov 25, 2021
2f707fd
fix ocis integration tests
kobergj Nov 25, 2021
923eb91
Merge branch 'master' into spaces-registry-and-provider
kobergj Nov 25, 2021
537d033
Add gateway integration tests for sharded directories
aduffeck Nov 23, 2021
a2eee7b
Start refactoring spaces registry, bring back unit tests
aduffeck Nov 29, 2021
80f1686
fix spaces registry tests
butonic Nov 25, 2021
9dab22f
make storageregistry service use new internal interface
butonic Nov 26, 2021
55faaca
commant internal storage registry interface
butonic Nov 26, 2021
5ee13de
Bring back support for id based requests
aduffeck Nov 26, 2021
3f82ecc
adjust gateway to new registry API
butonic Nov 26, 2021
544bbee
make static registry compatible with new gateway
butonic Nov 26, 2021
6d5aafb
fix findAndUnwrap
butonic Nov 26, 2021
da73449
Merge branch 'spaces-registry-and-provider' into spaces-registry-and-…
butonic Nov 29, 2021
38a4489
Merge pull request #225 from aduffeck/spaces-registry-and-provider-re…
butonic Nov 29, 2021
6bc66c4
Merge branch 'master' into spaces-registry-and-provider
butonic Nov 29, 2021
bbcd336
make hound happy again
butonic Nov 29, 2021
30056ff
send mount path in GetProvider response
butonic Nov 29, 2021
1dd883e
add naming comment
butonic Nov 29, 2021
3deb485
fix path in stat response for id based requests
butonic Nov 29, 2021
761e7ab
experimental fix for integration tests
kobergj Nov 29, 2021
ac7c156
sharpen unwrap logic
kobergj Nov 29, 2021
16eaa35
attempt to fix the problem + probdescription
kobergj Nov 29, 2021
988b9e5
more sophisticated way of determining the root
kobergj Nov 29, 2021
cbc6529
add same logic to recycle operations
kobergj Nov 29, 2021
762714a
fix stat file type mount points
butonic Nov 30, 2021
f981e3e
Streamline tests, increase coverage
aduffeck Nov 30, 2021
f286896
Increase test coverage
aduffeck Nov 30, 2021
db8521e
comment cleanup
butonic Nov 30, 2021
f203b91
fix ListStorageSpace to contain correct spaceid
butonic Nov 30, 2021
6d92f08
fix linting & hound
kobergj Nov 30, 2021
7f35eb8
fix linting issues
kobergj Nov 30, 2021
b73b107
log correct call
butonic Dec 1, 2021
794de6e
extract ref from opaque for public link scope
butonic Dec 1, 2021
057119a
fix publiclink corner cases and scope
butonic Dec 1, 2021
1fe9b28
Clarify spaces registry configuration
aduffeck Dec 1, 2021
f1207a2
update expected failures
butonic Dec 1, 2021
29e016e
fixing gateway.RestoreTrashItem
butonic Dec 1, 2021
1cdb1b7
Remove programmatic test focus
aduffeck Dec 1, 2021
4d582cd
refactor utils.SplitStorageSpaceID
butonic Dec 1, 2021
724b1d9
forbid cross provider RestoreRecycleItem
butonic Dec 1, 2021
bc7e4e7
fix relative references in space registry
butonic Dec 1, 2021
9b26327
refactor integration tests
kobergj Dec 1, 2021
2aa312d
fallback to CreateHome, deprecate GetHome
butonic Dec 1, 2021
a213c13
Fix CreateHome/GetHome when using the static registry
aduffeck Dec 2, 2021
f87989d
update cache notes
butonic Dec 2, 2021
9a39aa2
rename spaces registry rule struct to provider
butonic Dec 2, 2021
1e5572e
add a Stat cache to the gateway
kobergj Dec 2, 2021
86e2a0f
also activate the cache
kobergj Dec 2, 2021
99ff5e1
Merge branch 'master' into spaces-registry-and-provider
kobergj Dec 2, 2021
2730d72
fix build after master merge
kobergj Dec 2, 2021
3da9965
fix integration tests (again)
kobergj Dec 3, 2021
9732035
Allow read access to the root node
aduffeck Dec 3, 2021
7e6da31
Add grpc integration tests for the virtual views case
aduffeck Dec 3, 2021
903732b
disable cache for now
butonic Dec 3, 2021
4dadbcd
add comment to PublicStorageProviderID
butonic Dec 3, 2021
6d143c4
Merge remote-tracking branch 'master' into spaces-registry-and-provider
butonic Dec 3, 2021
dcd277f
fix sharing
butonic Dec 6, 2021
f96a277
fix unit tests (again)
kobergj Dec 6, 2021
e2c028a
fix 0 byte uploads
butonic Dec 6, 2021
a1e5ab3
fix concurrency tests (again)
kobergj Dec 6, 2021
195c6e0
add license header for storageprovidercache
kobergj Dec 6, 2021
00f4942
no longer wipe storage after every test
butonic Dec 6, 2021
5be829a
fix linting (again)
kobergj Dec 6, 2021
cc9921b
Fix integration tests
aduffeck Dec 6, 2021
124f38d
make codacy happy
kobergj Dec 6, 2021
29a1ae8
Revert "no longer wipe storage after every test"
butonic Dec 6, 2021
cbe1a2c
make codacy happy (part II)
kobergj Dec 6, 2021
a023668
make codacy happy (part III)
kobergj Dec 6, 2021
b48b2f3
virtual views pipeline is covered by tests/integration/grpc/gateway_s…
butonic Dec 6, 2021
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
26 changes: 12 additions & 14 deletions .drone.star
Original file line number Diff line number Diff line change
Expand Up @@ -511,10 +511,9 @@ def virtualViews():
"commands": [
"cd /drone/src/tests/oc-integration-tests/drone/",
"/drone/src/cmd/revad/revad -c frontend-global.toml &",
"/drone/src/cmd/revad/revad -c gateway.toml &",
"/drone/src/cmd/revad/revad -c storage-home-ocis.toml &",
"/drone/src/cmd/revad/revad -c storage-local-1.toml &",
"/drone/src/cmd/revad/revad -c storage-local-2.toml &",
"/drone/src/cmd/revad/revad -c gateway-virtual.toml &",
"/drone/src/cmd/revad/revad -c storage-users-0-9.toml &",
"/drone/src/cmd/revad/revad -c storage-users-a-f.toml &",
"/drone/src/cmd/revad/revad -c users.toml",
],
},
Expand All @@ -530,7 +529,7 @@ def virtualViews():
"PATH_TO_CORE": "/drone/src/tmp/testrunner",
"TEST_SERVER_URL": "http://revad-services:20180",
"OCIS_REVA_DATA_ROOT": "/drone/src/tmp/reva/data/",
"DELETE_USER_DATA_CMD": "rm -rf /drone/src/tmp/reva/data/nodes/root/* /drone/src/tmp/reva/data/nodes/*-*-*-* /drone/src/tmp/reva/data/blobs/*",
"DELETE_USER_DATA_CMD": "rm -rf /drone/src/tmp/reva/data/nodes/root/* /drone/src/tmp/reva/data/nodes/*-*-*-* /drone/src/tmp/reva/data/blobs/* /drone/src/tmp/reva/data/spaces/*/*",
"STORAGE_DRIVER": "OCIS",
"SKELETON_DIR": "/drone/src/tmp/testing/data/apiSkeleton",
"TEST_REVA": "true",
Expand Down Expand Up @@ -570,7 +569,6 @@ def litmusOcisOldWebdav():
"cd /drone/src/tests/oc-integration-tests/drone/",
"/drone/src/cmd/revad/revad -c frontend.toml &",
"/drone/src/cmd/revad/revad -c gateway.toml &",
"/drone/src/cmd/revad/revad -c storage-home-ocis.toml &",
"/drone/src/cmd/revad/revad -c storage-users-ocis.toml &",
"/drone/src/cmd/revad/revad -c users.toml",
],
Expand Down Expand Up @@ -623,7 +621,6 @@ def litmusOcisNewWebdav():
"cd /drone/src/tests/oc-integration-tests/drone/",
"/drone/src/cmd/revad/revad -c frontend.toml &",
"/drone/src/cmd/revad/revad -c gateway.toml &",
"/drone/src/cmd/revad/revad -c storage-home-ocis.toml &",
"/drone/src/cmd/revad/revad -c storage-users-ocis.toml &",
"/drone/src/cmd/revad/revad -c users.toml",
]
Expand Down Expand Up @@ -677,7 +674,6 @@ def litmusOcisSpacesDav():
"cd /drone/src/tests/oc-integration-tests/drone/",
"/drone/src/cmd/revad/revad -c frontend.toml &",
"/drone/src/cmd/revad/revad -c gateway.toml &",
"/drone/src/cmd/revad/revad -c storage-home-ocis.toml &",
"/drone/src/cmd/revad/revad -c storage-users-ocis.toml &",
"/drone/src/cmd/revad/revad -c users.toml",
]
Expand All @@ -700,7 +696,7 @@ def litmusOcisSpacesDav():
"commands": [
# The spaceid is randomly generated during the first login so we need this hack to construct the correct url.
"curl -s -k -u einstein:relativity -I http://revad-services:20080/remote.php/dav/files/einstein",
"export LITMUS_URL=http://revad-services:20080/remote.php/dav/spaces/123e4567-e89b-12d3-a456-426655440000!$(ls /drone/src/tmp/reva/data/spaces/personal/)",
"export LITMUS_URL=http://revad-services:20080/remote.php/dav/spaces/$(ls /drone/src/tmp/reva/data/spaces/personal/)",
"/usr/local/bin/litmus-wrapper",
]
},
Expand Down Expand Up @@ -743,7 +739,8 @@ def ocisIntegrationTests(parallelRuns, skipExceptParts = []):
"/drone/src/cmd/revad/revad -c frontend.toml &",
"/drone/src/cmd/revad/revad -c gateway.toml &",
"/drone/src/cmd/revad/revad -c shares.toml &",
"/drone/src/cmd/revad/revad -c storage-home-ocis.toml &",
"/drone/src/cmd/revad/revad -c storage-shares.toml &",
"/drone/src/cmd/revad/revad -c machine-auth.toml &",
"/drone/src/cmd/revad/revad -c storage-users-ocis.toml &",
"/drone/src/cmd/revad/revad -c storage-publiclink.toml &",
"/drone/src/cmd/revad/revad -c ldap-users.toml",
Expand All @@ -760,7 +757,7 @@ def ocisIntegrationTests(parallelRuns, skipExceptParts = []):
"environment": {
"TEST_SERVER_URL": "http://revad-services:20080",
"OCIS_REVA_DATA_ROOT": "/drone/src/tmp/reva/data/",
"DELETE_USER_DATA_CMD": "rm -rf /drone/src/tmp/reva/data/nodes/root/* /drone/src/tmp/reva/data/nodes/*-*-*-* /drone/src/tmp/reva/data/blobs/*",
"DELETE_USER_DATA_CMD": "rm -rf /drone/src/tmp/reva/data/nodes/root/* /drone/src/tmp/reva/data/nodes/*-*-*-* /drone/src/tmp/reva/data/blobs/* /drone/src/tmp/reva/data/spaces/*/*",
"STORAGE_DRIVER": "OCIS",
"SKELETON_DIR": "/drone/src/tmp/testing/data/apiSkeleton",
"TEST_WITH_LDAP": "true",
Expand Down Expand Up @@ -818,10 +815,11 @@ def s3ngIntegrationTests(parallelRuns, skipExceptParts = []):
"/drone/src/cmd/revad/revad -c frontend.toml &",
"/drone/src/cmd/revad/revad -c gateway.toml &",
"/drone/src/cmd/revad/revad -c shares.toml &",
"/drone/src/cmd/revad/revad -c storage-home-s3ng.toml &",
"/drone/src/cmd/revad/revad -c storage-users-s3ng.toml &",
"/drone/src/cmd/revad/revad -c storage-publiclink.toml &",
"/drone/src/cmd/revad/revad -c ldap-users.toml",
"/drone/src/cmd/revad/revad -c storage-shares.toml &",
"/drone/src/cmd/revad/revad -c ldap-users.toml &",
"/drone/src/cmd/revad/revad -c machine-auth.toml",
],
},
cloneOc10TestReposStep(),
Expand All @@ -835,7 +833,7 @@ def s3ngIntegrationTests(parallelRuns, skipExceptParts = []):
"environment": {
"TEST_SERVER_URL": "http://revad-services:20080",
"OCIS_REVA_DATA_ROOT": "/drone/src/tmp/reva/data/",
"DELETE_USER_DATA_CMD": "rm -rf /drone/src/tmp/reva/data/nodes/root/* /drone/src/tmp/reva/data/nodes/*-*-*-* /drone/src/tmp/reva/data/blobs/*",
"DELETE_USER_DATA_CMD": "rm -rf /drone/src/tmp/reva/data/nodes/root/* /drone/src/tmp/reva/data/nodes/*-*-*-* /drone/src/tmp/reva/data/blobs/* /drone/src/tmp/reva/data/spaces/*/*",
"STORAGE_DRIVER": "S3NG",
"SKELETON_DIR": "/drone/src/tmp/testing/data/apiSkeleton",
"TEST_WITH_LDAP": "true",
Expand Down
5 changes: 5 additions & 0 deletions changelog/unreleased/sharestorageprovider.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Change: Add a sharestorageprovider

This PR adds a ShareStorageProvider which enables us to get rid of a lot of special casing in other parts of the code. It also fixes several issues regarding shares and group shares.

https://github.com/cs3org/reva/pull/2023
5 changes: 5 additions & 0 deletions changelog/unreleased/spaces-registry.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Change: Add a spaces registry

Spaces registry is supposed to manage spaces. Read `pkg/storage/registry/spaces/Readme.md` for full details

https://github.com/cs3org/reva/pull/2234
5 changes: 5 additions & 0 deletions changelog/unreleased/wrap-unwrap-in-gateway.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Change: move wrapping and unwrapping of paths to the storage gateway

We've moved the wrapping and unwrapping of reference paths to the storage gateway so that the storageprovider doesn't have to know its mount path.

https://github.com/cs3org/reva/pull/2016
Original file line number Diff line number Diff line change
Expand Up @@ -8,32 +8,16 @@ description: >

# _struct: config_

{{% dir name="mount_path" type="string" default="/" %}}
The path where the file system would be mounted. [[Ref]](https://github.com/cs3org/reva/tree/master/internal/grpc/services/storageprovider/storageprovider.go#L57)
{{< highlight toml >}}
[grpc.services.storageprovider]
mount_path = "/"
{{< /highlight >}}
{{% /dir %}}

{{% dir name="mount_id" type="string" default="-" %}}
The ID of the mounted file system. [[Ref]](https://github.com/cs3org/reva/tree/master/internal/grpc/services/storageprovider/storageprovider.go#L58)
{{< highlight toml >}}
[grpc.services.storageprovider]
mount_id = "-"
{{< /highlight >}}
{{% /dir %}}

{{% dir name="driver" type="string" default="localhome" %}}
The storage driver to be used. [[Ref]](https://github.com/cs3org/reva/tree/master/internal/grpc/services/storageprovider/storageprovider.go#L59)
The storage driver to be used. [[Ref]](https://github.com/cs3org/reva/tree/master/internal/grpc/services/storageprovider/storageprovider.go#L54)
{{< highlight toml >}}
[grpc.services.storageprovider]
driver = "localhome"
{{< /highlight >}}
{{% /dir %}}

{{% dir name="drivers" type="map[string]map[string]interface{}" default="localhome" %}}
[[Ref]](https://github.com/cs3org/reva/tree/master/internal/grpc/services/storageprovider/storageprovider.go#L60)
[[Ref]](https://github.com/cs3org/reva/tree/master/internal/grpc/services/storageprovider/storageprovider.go#L55)
{{< highlight toml >}}
[grpc.services.storageprovider.drivers.localhome]
root = "/var/tmp/reva/"
Expand All @@ -44,39 +28,39 @@ user_layout = "{{.Username}}"
{{% /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#L61)
Path to temporary folder. [[Ref]](https://github.com/cs3org/reva/tree/master/internal/grpc/services/storageprovider/storageprovider.go#L56)
{{< 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#L62)
The URL for the data server. [[Ref]](https://github.com/cs3org/reva/tree/master/internal/grpc/services/storageprovider/storageprovider.go#L57)
{{< 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#L63)
Whether to expose data server. [[Ref]](https://github.com/cs3org/reva/tree/master/internal/grpc/services/storageprovider/storageprovider.go#L58)
{{< 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#L64)
List of available checksums. [[Ref]](https://github.com/cs3org/reva/tree/master/internal/grpc/services/storageprovider/storageprovider.go#L59)
{{< highlight toml >}}
[grpc.services.storageprovider]
available_checksums = nil
{{< /highlight >}}
{{% /dir %}}

{{% dir name="mimetypes" type="map[string]string" default=nil %}}
List of supported mime types and corresponding file extensions. [[Ref]](https://github.com/cs3org/reva/tree/master/internal/grpc/services/storageprovider/storageprovider.go#L65)
List of supported mime types and corresponding file extensions. [[Ref]](https://github.com/cs3org/reva/tree/master/internal/grpc/services/storageprovider/storageprovider.go#L60)
{{< highlight toml >}}
[grpc.services.storageprovider]
mimetypes = nil
Expand Down
4 changes: 0 additions & 4 deletions examples/nextcloud-integration/revad.toml
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,6 @@ driver = "static"

[grpc.services.storageprovider]
driver = "nextcloud"
mount_path = "/home"
mount_id = "123e4567-e89b-12d3-a456-426655440000"
expose_data_server = true
data_server_url = "http://127.0.0.1:19001/data"
enable_home_creation = true
Expand All @@ -110,8 +108,6 @@ driver = "nextcloud"
end_point = "http://localhost/apps/sciencemesh/"

[http]
enabled_services = ["ocmd"]
enabled_middlewares = ["providerauthorizer", "cors"]
address = "0.0.0.0:19001"

[http.services.dataprovider]
Expand Down
2 changes: 0 additions & 2 deletions examples/oc-phoenix/ocmd.toml
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,6 @@ driver = "json"
providers = "providers.demo.json"

[http]
enabled_services = ["ocmd"]
enabled_middlewares = ["providerauthorizer", "cors"]
address = "0.0.0.0:13001"

[http.services.ocmd]
Expand Down
2 changes: 0 additions & 2 deletions examples/oc-phoenix/storage-home.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,6 @@ address = "0.0.0.0:12000"
# the context path wrapper reads tho username from the context and prefixes the relative storage path with it
[grpc.services.storageprovider]
driver = "owncloud"
mount_path = "/home"
mount_id = "123e4567-e89b-12d3-a456-426655440000"
expose_data_server = true
data_server_url = "http://localhost:12001/data"
enable_home_creation = true
Expand Down
2 changes: 0 additions & 2 deletions examples/oc-phoenix/storage-oc.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@ address = "0.0.0.0:11000"
# we have a locally running dataprovider
[grpc.services.storageprovider]
driver = "owncloud"
mount_path = "/oc"
mount_id = "123e4567-e89b-12d3-a456-426655440000"
expose_data_server = true
data_server_url = "http://localhost:11001/data"

Expand Down
2 changes: 0 additions & 2 deletions examples/ocmd/ocmd-server-1.toml
Original file line number Diff line number Diff line change
Expand Up @@ -91,8 +91,6 @@ app_url = "https://your-collabora-server.org:9980"

[grpc.services.storageprovider]
driver = "localhome"
mount_path = "/home"
mount_id = "123e4567-e89b-12d3-a456-426655440000"
expose_data_server = true
data_server_url = "http://localhost:19001/data"
enable_home_creation = true
Expand Down
2 changes: 0 additions & 2 deletions examples/ocmd/ocmd-server-2.toml
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,6 @@ driver = "memory"

[grpc.services.storageprovider]
driver = "localhome"
mount_path = "/home"
mount_id = "123e4567-e89b-12d3-a456-426655440000"
expose_data_server = true
data_server_url = "http://localhost:17001/data"
enable_home_creation = true
Expand Down
2 changes: 0 additions & 2 deletions examples/storage-references/storage-home.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@ address = "0.0.0.0:17000"

[grpc.services.storageprovider]
driver = "localhome"
mount_path = "/home"
mount_id = "123e4567-e89b-12d3-a456-426655440000"
data_server_url = "http://localhost:17001/data"

[http]
Expand Down
2 changes: 0 additions & 2 deletions examples/storage-references/storage-public.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@ address = "0.0.0.0:16000"

[grpc.services.publicstorageprovider]
driver = "localhome"
mount_path = "/public"
mount_id = "123e4567-e89b-12d3-a456-426655440000"
data_server_url = "http://localhost:16001/data"
gateway_addr = "localhost:19000"

Expand Down
2 changes: 0 additions & 2 deletions examples/storage-references/storage-reva.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@ address = "0.0.0.0:18000"

[grpc.services.storageprovider]
driver = "local"
mount_path = "/reva"
mount_id = "123e4567-e89b-12d3-a456-426655440000"
data_server_url = "http://localhost:18001/data"

[http]
Expand Down
2 changes: 0 additions & 2 deletions examples/two-server-setup/storage-home-1.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@ address = "0.0.0.0:17000"

[grpc.services.storageprovider]
driver = "localhome"
mount_path = "/home"
mount_id = "123e4567-e89b-12d3-a456-426655440000"
data_server_url = "http://localhost:17001/data"

[http]
Expand Down
2 changes: 0 additions & 2 deletions examples/two-server-setup/storage-home-2.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@ address = "0.0.0.0:27000"

[grpc.services.storageprovider]
driver = "localhome"
mount_path = "/home"
mount_id = "123e4567-e89b-12d3-a456-426655440000"
data_server_url = "http://localhost:27001/data"

[http]
Expand Down
2 changes: 0 additions & 2 deletions examples/two-server-setup/storage-reva-1.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@ address = "0.0.0.0:18000"

[grpc.services.storageprovider]
driver = "local"
mount_path = "/reva"
mount_id = "123e4567-e89b-12d3-a456-426655440000"
data_server_url = "http://localhost:18001/data"

[http]
Expand Down
2 changes: 0 additions & 2 deletions examples/two-server-setup/storage-reva-2.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@ address = "0.0.0.0:28000"

[grpc.services.storageprovider]
driver = "local"
mount_path = "/reva"
mount_id = "123e4567-e89b-12d3-a456-426655440000"
data_server_url = "http://localhost:28001/data"

[http]
Expand Down
20 changes: 20 additions & 0 deletions internal/grpc/interceptors/auth/scope.go
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,26 @@ func checkIfNestedResource(ctx context.Context, ref *provider.Reference, parent

return strings.HasPrefix(childPath, parentPath), nil

// resourcePath := statResponse.Info.Path

// if strings.HasPrefix(ref.GetPath(), resourcePath) {
// // The path corresponds to the resource to which the token has access.
// // We allow access to it.
// return true, nil
// }

// // If we arrived here that could mean that ref.GetPath is not prefixed with the storage mount path but resourcePath is
// // because it was returned by the gateway which will prefix it. To fix that we remove the mount path from the resourcePath.
// // resourcePath = "/users/<name>/some/path"
// // After the split we have [" ", "users", "<name>/some/path"].
// trimmedPath := "/" + strings.SplitN(resourcePath, "/", 3)[2]
// if strings.HasPrefix(ref.GetPath(), trimmedPath) {
// // The path corresponds to the resource to which the token has access.
// // We allow access to it.
// return true, nil
// }

// return false, nil
Comment on lines +213 to +232
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd remove these lines instead of commenting them. It is clutter.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in #2383

}

func extractRef(req interface{}, hasEditorRole bool) (*provider.Reference, bool) {
Expand Down
30 changes: 4 additions & 26 deletions internal/grpc/services/gateway/appprovider.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,41 +44,19 @@ import (
)

func (s *svc) OpenInApp(ctx context.Context, req *gateway.OpenInAppRequest) (*providerpb.OpenInAppResponse, error) {
p, st := s.getPath(ctx, req.Ref)
if st.Code != rpc.Code_CODE_OK {
if st.Code == rpc.Code_CODE_NOT_FOUND {
return &providerpb.OpenInAppResponse{
Status: status.NewNotFound(ctx, "gateway: resource not found:"+req.Ref.String()),
}, nil
}
return &providerpb.OpenInAppResponse{
Status: st,
}, nil
}

if s.isSharedFolder(ctx, p) {
return &providerpb.OpenInAppResponse{
Status: status.NewInvalid(ctx, "gateway: can't open shared folder"),
}, nil
}

resName, resChild := p, ""
if s.isShareChild(ctx, p) {
resName, resChild = s.splitShare(ctx, p)
}

statRes, err := s.stat(ctx, &storageprovider.StatRequest{
Ref: &storageprovider.Reference{Path: resName},
resChild := ""
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nope. Removed in #2383

statRes, err := s.Stat(ctx, &storageprovider.StatRequest{
Ref: req.Ref,
})
if err != nil {
return &providerpb.OpenInAppResponse{
Status: status.NewInternal(ctx, err, "gateway: error calling Stat on the resource path for the app provider: "+req.Ref.GetPath()),
}, nil
}
if statRes.Status.Code != rpc.Code_CODE_OK {
err := status.NewErrorFromCode(statRes.Status.GetCode(), "gateway")
return &providerpb.OpenInAppResponse{
Status: status.NewInternal(ctx, err, "Stat failed on the resource path for the app provider: "+req.Ref.GetPath()),
Status: statRes.Status,
}, nil
}

Expand Down
Loading