Compare commits
59
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
79c60b505c | ||
|
|
f8f4805d64 | ||
|
|
ab1d7053d8 | ||
|
|
7eb8ae84bd | ||
|
|
fbf49a747f | ||
|
|
e4a836503f | ||
|
|
09536fa650 | ||
|
|
4bf95bd684 | ||
|
|
21dfd1147b | ||
|
|
8738c56942 | ||
|
|
4c43661664 | ||
|
|
51982d7fa4 | ||
|
|
1c96c2fbb0 | ||
|
|
123aab9675 | ||
|
|
749074e2cd | ||
|
|
adad85a9a2 | ||
|
|
4663e88403 | ||
|
|
7305694eb3 | ||
|
|
44ca518735 | ||
|
|
3afea693fd | ||
|
|
24907d7ebb | ||
|
|
ccdd08b152 | ||
|
|
ab5c9703c1 | ||
|
|
6848667292 | ||
|
|
1d2a868fba | ||
|
|
7546e476be | ||
|
|
6c00b5d26b | ||
|
|
669a5eb2bc | ||
|
|
158cede97f | ||
|
|
1074b259f9 | ||
|
|
0edc99340f | ||
|
|
930f9053d8 | ||
|
|
b725c175ef | ||
|
|
9925627c91 | ||
|
|
fac368acfa | ||
|
|
ffe56dbb6f | ||
|
|
4df9532fd3 | ||
|
|
2e3f21afbb | ||
|
|
8d1f990abd | ||
|
|
8006b5d25e | ||
|
|
0cc51c4cff | ||
|
|
e15dac85e9 | ||
|
|
ed8342de5d | ||
|
|
4515240a67 | ||
|
|
3b9ee2e49f | ||
|
|
6866f5a664 | ||
|
|
154feaaef9 | ||
|
|
c527d98b27 | ||
|
|
ea698f6f7b | ||
|
|
bf8f6ea3c6 | ||
|
|
4e509605f7 | ||
|
|
f22864f969 | ||
|
|
d0f3458261 | ||
|
|
ad2e310ec3 | ||
|
|
c6859cc9fb | ||
|
|
66f4204b09 | ||
|
|
89baa049b7 | ||
|
|
565f58c68a | ||
|
|
187c8f3133 |
No files matched your search
+1
-1
@@ -1,3 +1,3 @@
|
||||
# The test runner source for UI tests
|
||||
WEB_COMMITID=3088a7d9a353ebf5e128d9d784b28fb103a30a40
|
||||
WEB_COMMITID=264014d2f2a216de72114e5453cfa684ab275978
|
||||
WEB_BRANCH=stable-11.0
|
||||
+11
@@ -242,6 +242,17 @@ config = {
|
||||
"GATEWAY_GRPC_ADDR": "0.0.0.0:9142",
|
||||
},
|
||||
},
|
||||
"authApp": {
|
||||
"suites": [
|
||||
"apiAuthApp",
|
||||
],
|
||||
"skip": False,
|
||||
"withRemotePhp": [True],
|
||||
"extraServerEnvironment": {
|
||||
"OCIS_ADD_RUN_SERVICES": "auth-app",
|
||||
"PROXY_ENABLE_APP_AUTH": True,
|
||||
},
|
||||
},
|
||||
"cliCommands": {
|
||||
"suites": [
|
||||
"cliCommands",
|
||||
|
||||
+99
-1
@@ -1,6 +1,7 @@
|
||||
# Table of Contents
|
||||
|
||||
* [Changelog for unreleased](#changelog-for-unreleased-unreleased)
|
||||
* [Changelog for 7.0.0-rc.4](#changelog-for-700-rc4-2024-12-09)
|
||||
* [Changelog for 7.0.0-rc.3](#changelog-for-700-rc3-2024-11-21)
|
||||
* [Changelog for 5.0.9](#changelog-for-509-2024-11-14)
|
||||
* [Changelog for 7.0.0-rc.2](#changelog-for-700-rc2-2024-11-12)
|
||||
@@ -59,7 +60,104 @@
|
||||
|
||||
The following sections list the changes for unreleased.
|
||||
|
||||
[unreleased]: https://github.com/owncloud/ocis/compare/v7.0.0-rc.3...master
|
||||
[unreleased]: https://github.com/owncloud/ocis/compare/v7.0.0-rc.4...master
|
||||
|
||||
## Summary
|
||||
|
||||
* Bugfix - Fix link activity message: [#10663](https://github.com/owncloud/ocis/pull/10663)
|
||||
* Bugfix - Fix graph drives response for federated shares: [#10730](https://github.com/owncloud/ocis/pull/10730)
|
||||
* Bugfix - GetLastModified property in the REPORT response will use RFC1123 format: [#10738](https://github.com/owncloud/ocis/pull/10738)
|
||||
* Bugfix - Unifi logging: [#10743](https://github.com/owncloud/ocis/pull/10743/)
|
||||
* Bugfix - Fix FileInfo BreadcrumbFolderURL upd: [#10757](https://github.com/owncloud/ocis/pull/10757)
|
||||
* Bugfix - Bump Reva: [#10766](https://github.com/owncloud/ocis/pull/10766)
|
||||
* Enhancement - Update web to v11.0.6: [#10755](https://github.com/owncloud/ocis/pull/10755)
|
||||
|
||||
## Details
|
||||
|
||||
* Bugfix - Fix link activity message: [#10663](https://github.com/owncloud/ocis/pull/10663)
|
||||
|
||||
We changed the link token to display name in the activity message.
|
||||
|
||||
https://github.com/owncloud/ocis/issues/10295
|
||||
https://github.com/owncloud/ocis/pull/10663
|
||||
|
||||
* Bugfix - Fix graph drives response for federated shares: [#10730](https://github.com/owncloud/ocis/pull/10730)
|
||||
|
||||
Federated shares where erroneously showing up in the /me/drives response on the
|
||||
graph API.
|
||||
|
||||
https://github.com/owncloud/ocis/issues/10689
|
||||
https://github.com/owncloud/ocis/pull/10730
|
||||
|
||||
* Bugfix - GetLastModified property in the REPORT response will use RFC1123 format: [#10738](https://github.com/owncloud/ocis/pull/10738)
|
||||
|
||||
This will follow the standard and will also match the format of the same
|
||||
property in the PROPFIND response
|
||||
|
||||
https://github.com/owncloud/ocis/pull/10738
|
||||
|
||||
* Bugfix - Unifi logging: [#10743](https://github.com/owncloud/ocis/pull/10743/)
|
||||
|
||||
We fixed some cases where we did not use the correct logger.
|
||||
|
||||
https://github.com/owncloud/ocis/pull/10743/
|
||||
|
||||
* Bugfix - Fix FileInfo BreadcrumbFolderURL upd: [#10757](https://github.com/owncloud/ocis/pull/10757)
|
||||
|
||||
Made GetScopeByKeyPrefix function as a private method of the FileConnector
|
||||
|
||||
https://github.com/owncloud/ocis/pull/10757
|
||||
|
||||
* Bugfix - Bump Reva: [#10766](https://github.com/owncloud/ocis/pull/10766)
|
||||
|
||||
Bumps reva version to 2.27.0
|
||||
|
||||
* Bugfix [cs3org/reva#4985](https://github.com/cs3org/reva/pull/4985): Drop unneeded session locks
|
||||
* Bugfix [cs3org/reva#5000](https://github.com/cs3org/reva/pull/5000): Fix ceph build
|
||||
* Bugfix [cs3org/reva#4989](https://github.com/cs3org/reva/pull/4989): Deleting OCM share also updates storageprovider
|
||||
* Enhancement [cs3org/reva#4998](https://github.com/cs3org/reva/pull/4998): Emit event when an ocm share is received
|
||||
* Enhancement [cs3org/reva#4996](https://github.com/cs3org/reva/pull/4996): Get rid of some cases of unstructured logging
|
||||
|
||||
https://github.com/owncloud/ocis/pull/10766
|
||||
|
||||
* Enhancement - Update web to v11.0.6: [#10755](https://github.com/owncloud/ocis/pull/10755)
|
||||
|
||||
Tags: web
|
||||
|
||||
We updated ownCloud Web to v11.0.6. Please refer to the changelog (linked) for
|
||||
details on the web release.
|
||||
|
||||
- Bugfix [owncloud/web#11992](https://github.com/owncloud/web/pull/11992): OCM
|
||||
invite flow - Bugfix
|
||||
[owncloud/web#11997](https://github.com/owncloud/web/pull/11997): Change search
|
||||
scope without search term - Bugfix
|
||||
[owncloud/web#11998](https://github.com/owncloud/web/pull/11998): Do not load
|
||||
version when sidebar is closed - Bugfix
|
||||
[owncloud/web#12000](https://github.com/owncloud/web/pull/12000): Use only space
|
||||
resource with driveType "project" as space in sidebar - Bugfix
|
||||
[owncloud/web#12002](https://github.com/owncloud/web/pull/12002): OCM share
|
||||
editing - Bugfix
|
||||
[owncloud/web#12002](https://github.com/owncloud/web/pull/12002): OCM share
|
||||
recipient issuer - Bugfix
|
||||
[owncloud/web#12008](https://github.com/owncloud/web/pull/12008): Missing
|
||||
activities on Shared with me page - Bugfix
|
||||
[owncloud/web#12010](https://github.com/owncloud/web/pull/12010): Sidebar file
|
||||
info for shares - Bugfix
|
||||
[owncloud/web#12012](https://github.com/owncloud/web/pull/12012): Show missing
|
||||
role name in link share panel - Bugfix
|
||||
[owncloud/web#12013](https://github.com/owncloud/web/pull/12013): Missing
|
||||
translations for share type filters - Bugfix
|
||||
[owncloud/web#12022](https://github.com/owncloud/web/pull/12022): Permanent link
|
||||
for shares
|
||||
|
||||
https://github.com/owncloud/ocis/pull/10755
|
||||
https://github.com/owncloud/web/releases/tag/v11.0.6
|
||||
|
||||
# Changelog for [7.0.0-rc.4] (2024-12-09)
|
||||
|
||||
The following sections list the changes for 7.0.0-rc.4.
|
||||
|
||||
[7.0.0-rc.4]: https://github.com/owncloud/ocis/compare/v7.0.0-rc.3...v7.0.0-rc.4
|
||||
|
||||
## Summary
|
||||
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
Bugfix: Bump Reva
|
||||
|
||||
Bumps reva version to 2.27.0
|
||||
|
||||
* Bugfix [cs3org/reva#4985](https://github.com/cs3org/reva/pull/4985): Drop unneeded session locks
|
||||
* Bugfix [cs3org/reva#5000](https://github.com/cs3org/reva/pull/5000): Fix ceph build
|
||||
* Bugfix [cs3org/reva#4989](https://github.com/cs3org/reva/pull/4989): Deleting OCM share also updates storageprovider
|
||||
* Enhancement [cs3org/reva#4998](https://github.com/cs3org/reva/pull/4998): Emit event when an ocm share is received
|
||||
* Enhancement [cs3org/reva#4996](https://github.com/cs3org/reva/pull/4996): Get rid of some cases of unstructured logging
|
||||
|
||||
https://github.com/owncloud/ocis/pull/10766
|
||||
@@ -0,0 +1,6 @@
|
||||
Bugfix: Fix link activity message
|
||||
|
||||
We changed the link token to display name in the activity message.
|
||||
|
||||
https://github.com/owncloud/ocis/pull/10663
|
||||
https://github.com/owncloud/ocis/issues/10295
|
||||
@@ -0,0 +1,5 @@
|
||||
Bugfix: Fix FileInfo BreadcrumbFolderURL upd
|
||||
|
||||
Made GetScopeByKeyPrefix function as a private method of the FileConnector
|
||||
|
||||
https://github.com/owncloud/ocis/pull/10757
|
||||
@@ -0,0 +1,7 @@
|
||||
Bugfix: Fix graph drives response for federated shares
|
||||
|
||||
Federated shares where erroneously showing up in the /me/drives response
|
||||
on the graph API.
|
||||
|
||||
https://github.com/owncloud/ocis/pull/10730
|
||||
https://github.com/owncloud/ocis/issues/10689
|
||||
@@ -0,0 +1,5 @@
|
||||
Bugfix: Unifi logging
|
||||
|
||||
We fixed some cases where we did not use the correct logger.
|
||||
|
||||
https://github.com/owncloud/ocis/pull/10743/
|
||||
@@ -0,0 +1,20 @@
|
||||
Enhancement: Update web to v11.0.6
|
||||
|
||||
Tags: web
|
||||
|
||||
We updated ownCloud Web to v11.0.6. Please refer to the changelog (linked) for details on the web release.
|
||||
|
||||
- Bugfix [owncloud/web#11992](https://github.com/owncloud/web/pull/11992): OCM invite flow
|
||||
- Bugfix [owncloud/web#11997](https://github.com/owncloud/web/pull/11997): Change search scope without search term
|
||||
- Bugfix [owncloud/web#11998](https://github.com/owncloud/web/pull/11998): Do not load version when sidebar is closed
|
||||
- Bugfix [owncloud/web#12000](https://github.com/owncloud/web/pull/12000): Use only space resource with driveType "project" as space in sidebar
|
||||
- Bugfix [owncloud/web#12002](https://github.com/owncloud/web/pull/12002): OCM share editing
|
||||
- Bugfix [owncloud/web#12002](https://github.com/owncloud/web/pull/12002): OCM share recipient issuer
|
||||
- Bugfix [owncloud/web#12008](https://github.com/owncloud/web/pull/12008): Missing activities on Shared with me page
|
||||
- Bugfix [owncloud/web#12010](https://github.com/owncloud/web/pull/12010): Sidebar file info for shares
|
||||
- Bugfix [owncloud/web#12012](https://github.com/owncloud/web/pull/12012): Show missing role name in link share panel
|
||||
- Bugfix [owncloud/web#12013](https://github.com/owncloud/web/pull/12013): Missing translations for share type filters
|
||||
- Bugfix [owncloud/web#12022](https://github.com/owncloud/web/pull/12022): Permanent link for shares
|
||||
|
||||
https://github.com/owncloud/ocis/pull/10755
|
||||
https://github.com/owncloud/web/releases/tag/v11.0.6
|
||||
@@ -0,0 +1,5 @@
|
||||
Bugfix: GetLastModified property in the REPORT response will use RFC1123 format
|
||||
|
||||
This will follow the standard and will also match the format of the same property in the PROPFIND response
|
||||
|
||||
https://github.com/owncloud/ocis/pull/10738
|
||||
@@ -22,7 +22,6 @@
|
||||
- https://github.com/fschade.keys
|
||||
- https://github.com/kulmann.keys
|
||||
- https://github.com/micbar.keys
|
||||
- https://github.com/rhafer.keys
|
||||
- https://github.com/wkloucek.keys
|
||||
docker_compose_projects:
|
||||
- name: ocis
|
||||
|
||||
@@ -22,7 +22,6 @@
|
||||
- https://github.com/fschade.keys
|
||||
- https://github.com/kulmann.keys
|
||||
- https://github.com/micbar.keys
|
||||
- https://github.com/rhafer.keys
|
||||
- https://github.com/wkloucek.keys
|
||||
docker_compose_projects:
|
||||
- name: ocis
|
||||
|
||||
@@ -22,7 +22,6 @@
|
||||
- https://github.com/fschade.keys
|
||||
- https://github.com/kulmann.keys
|
||||
- https://github.com/micbar.keys
|
||||
- https://github.com/rhafer.keys
|
||||
- https://github.com/wkloucek.keys
|
||||
docker_compose_projects:
|
||||
- name: ocis
|
||||
|
||||
@@ -22,7 +22,6 @@
|
||||
- https://github.com/fschade.keys
|
||||
- https://github.com/kulmann.keys
|
||||
- https://github.com/micbar.keys
|
||||
- https://github.com/rhafer.keys
|
||||
- https://github.com/wkloucek.keys
|
||||
docker_compose_projects:
|
||||
- name: ocis
|
||||
|
||||
@@ -22,7 +22,6 @@
|
||||
- https://github.com/fschade.keys
|
||||
- https://github.com/kulmann.keys
|
||||
- https://github.com/micbar.keys
|
||||
- https://github.com/rhafer.keys
|
||||
- https://github.com/wkloucek.keys
|
||||
docker_compose_projects:
|
||||
- name: ocis
|
||||
|
||||
@@ -22,7 +22,6 @@
|
||||
- https://github.com/fschade.keys
|
||||
- https://github.com/kulmann.keys
|
||||
- https://github.com/micbar.keys
|
||||
- https://github.com/rhafer.keys
|
||||
- https://github.com/wkloucek.keys
|
||||
docker_compose_projects:
|
||||
- name: ocis
|
||||
|
||||
@@ -22,7 +22,6 @@
|
||||
- https://github.com/fschade.keys
|
||||
- https://github.com/kulmann.keys
|
||||
- https://github.com/micbar.keys
|
||||
- https://github.com/rhafer.keys
|
||||
- https://github.com/wkloucek.keys
|
||||
docker_compose_projects:
|
||||
- name: ocis
|
||||
|
||||
@@ -22,7 +22,6 @@
|
||||
- https://github.com/fschade.keys
|
||||
- https://github.com/kulmann.keys
|
||||
- https://github.com/micbar.keys
|
||||
- https://github.com/rhafer.keys
|
||||
- https://github.com/wkloucek.keys
|
||||
docker_compose_projects:
|
||||
- name: ocis
|
||||
|
||||
@@ -53,7 +53,7 @@ services:
|
||||
restart: always
|
||||
|
||||
collabora:
|
||||
image: collabora/code:24.04.10.1.1
|
||||
image: collabora/code:24.04.10.2.1
|
||||
# release notes: https://www.collaboraonline.com/release-notes/
|
||||
networks:
|
||||
ocis-net:
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
---
|
||||
services:
|
||||
traefik:
|
||||
image: traefik:v3.2.1
|
||||
image: traefik:v3.2.2
|
||||
# release notes: https://github.com/traefik/traefik/releases
|
||||
networks:
|
||||
ocis-net:
|
||||
|
||||
@@ -17,7 +17,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-20241105092511-3ad35d174fc1
|
||||
github.com/cs3org/reva/v2 v2.26.8
|
||||
github.com/cs3org/reva/v2 v2.27.0
|
||||
github.com/davidbyttow/govips/v2 v2.15.0
|
||||
github.com/dhowden/tag v0.0.0-20240417053706-3d75831295e8
|
||||
github.com/dutchcoders/go-clamd v0.0.0-20170520113014-b970184f4d9e
|
||||
|
||||
@@ -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-20241105092511-3ad35d174fc1 h1:RU6LT6mkD16xZs011+8foU7T3LrPvTTSWeTQ9OgfhkA=
|
||||
github.com/cs3org/go-cs3apis v0.0.0-20241105092511-3ad35d174fc1/go.mod h1:DedpcqXl193qF/08Y04IO0PpxyyMu8+GrkD6kWK2MEQ=
|
||||
github.com/cs3org/reva/v2 v2.26.8 h1:MTqEPfyYxtwgew1Yo35MasfFkI8afTIHSTr+mwX9Gh0=
|
||||
github.com/cs3org/reva/v2 v2.26.8/go.mod h1:fJWmn7EkttWOWphZfiKdFOcHuthcUsU55aSN1VeTOhU=
|
||||
github.com/cs3org/reva/v2 v2.27.0 h1:Lq8VBRjQmyCfCO6+wC80Z4vH2Q1MfgORggg1e6mEcdM=
|
||||
github.com/cs3org/reva/v2 v2.27.0/go.mod h1:fJWmn7EkttWOWphZfiKdFOcHuthcUsU55aSN1VeTOhU=
|
||||
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=
|
||||
|
||||
@@ -16,7 +16,7 @@ var (
|
||||
// LatestTag is the latest released version plus the dev meta version.
|
||||
// Will be overwritten by the release pipeline
|
||||
// Needs a manual change for every tagged release
|
||||
LatestTag = "7.0.0-rc.4+dev"
|
||||
LatestTag = "7.0.0-rc.5+dev"
|
||||
|
||||
// Date indicates the build date.
|
||||
// This has been removed, it looks like you can only replace static strings with recent go versions
|
||||
|
||||
@@ -24,6 +24,7 @@ import (
|
||||
"github.com/cs3org/reva/v2/pkg/store"
|
||||
"github.com/owncloud/ocis/v2/ocis-pkg/config"
|
||||
"github.com/owncloud/ocis/v2/ocis/pkg/register"
|
||||
"github.com/rs/zerolog"
|
||||
"github.com/urfave/cli/v2"
|
||||
)
|
||||
|
||||
@@ -96,7 +97,7 @@ func check(c *cli.Context) error {
|
||||
return err
|
||||
}
|
||||
|
||||
tree := tree.New(lu, bs, o, store.Create())
|
||||
tree := tree.New(lu, bs, o, store.Create(), &zerolog.Logger{})
|
||||
|
||||
nId := c.String("node")
|
||||
n, err := lu.NodeFromSpaceID(context.Background(), nId)
|
||||
|
||||
@@ -204,7 +204,7 @@ func (s *ActivitylogService) HandleGetItemActivities(w http.ResponseWriter, r *h
|
||||
WithVar("resource", storagespace.FormatResourceID(ev.ItemID), ev.ResourceName),
|
||||
WithUser(ev.Executant, nil, nil),
|
||||
WithTranslation(&t, loc, "field", []string{ev.FieldUpdated}),
|
||||
WithVar("token", ev.ItemID.GetOpaqueId(), ev.Token))
|
||||
WithVar("token", ev.ItemID.GetOpaqueId(), ev.DisplayName))
|
||||
case events.LinkRemoved:
|
||||
message = MessageLinkDeleted
|
||||
ts = utils.TSToTime(ev.Timestamp)
|
||||
|
||||
@@ -11,7 +11,7 @@ msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: \n"
|
||||
"Report-Msgid-Bugs-To: EMAIL\n"
|
||||
"POT-Creation-Date: 2024-11-26 00:18+0000\n"
|
||||
"POT-Creation-Date: 2024-12-16 00:19+0000\n"
|
||||
"PO-Revision-Date: 2024-08-20 10:13+0000\n"
|
||||
"Last-Translator: Jesús Recio <jrecio@solidgear.es>, 2024\n"
|
||||
"Language-Team: Spanish (https://app.transifex.com/owncloud-org/teams/6149/es/)\n"
|
||||
|
||||
@@ -11,7 +11,7 @@ msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: \n"
|
||||
"Report-Msgid-Bugs-To: EMAIL\n"
|
||||
"POT-Creation-Date: 2024-11-21 00:23+0000\n"
|
||||
"POT-Creation-Date: 2024-12-12 00:51+0000\n"
|
||||
"PO-Revision-Date: 2024-08-20 10:13+0000\n"
|
||||
"Last-Translator: hoshi1800 <hoshi1800@gmail.com>, 2024\n"
|
||||
"Language-Team: Japanese (Japan) (https://app.transifex.com/owncloud-org/teams/6149/ja_JP/)\n"
|
||||
|
||||
@@ -12,7 +12,7 @@ msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: \n"
|
||||
"Report-Msgid-Bugs-To: EMAIL\n"
|
||||
"POT-Creation-Date: 2024-11-23 00:55+0000\n"
|
||||
"POT-Creation-Date: 2024-12-14 00:17+0000\n"
|
||||
"PO-Revision-Date: 2024-08-20 10:13+0000\n"
|
||||
"Last-Translator: Flávio Veras <flaviove@gmail.com>, 2024\n"
|
||||
"Language-Team: Portuguese (Brazil) (https://app.transifex.com/owncloud-org/teams/6149/pt_BR/)\n"
|
||||
|
||||
@@ -11,7 +11,7 @@ msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: \n"
|
||||
"Report-Msgid-Bugs-To: EMAIL\n"
|
||||
"POT-Creation-Date: 2024-11-24 00:23+0000\n"
|
||||
"POT-Creation-Date: 2024-12-15 00:43+0000\n"
|
||||
"PO-Revision-Date: 2024-08-20 10:13+0000\n"
|
||||
"Last-Translator: Keram, 2024\n"
|
||||
"Language-Team: Uyghur (https://app.transifex.com/owncloud-org/teams/6149/ug/)\n"
|
||||
|
||||
@@ -11,7 +11,7 @@ msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: \n"
|
||||
"Report-Msgid-Bugs-To: EMAIL\n"
|
||||
"POT-Creation-Date: 2024-11-23 00:55+0000\n"
|
||||
"POT-Creation-Date: 2024-12-14 00:17+0000\n"
|
||||
"PO-Revision-Date: 2024-08-20 10:13+0000\n"
|
||||
"Last-Translator: Roman Perekhod, 2024\n"
|
||||
"Language-Team: Ukrainian (https://app.transifex.com/owncloud-org/teams/6149/uk/)\n"
|
||||
|
||||
@@ -6,6 +6,7 @@ import (
|
||||
"encoding/base64"
|
||||
"encoding/binary"
|
||||
"encoding/hex"
|
||||
"fmt"
|
||||
"io"
|
||||
"net/url"
|
||||
"path"
|
||||
@@ -13,6 +14,7 @@ import (
|
||||
"time"
|
||||
|
||||
appproviderv1beta1 "github.com/cs3org/go-cs3apis/cs3/app/provider/v1beta1"
|
||||
auth "github.com/cs3org/go-cs3apis/cs3/auth/provider/v1beta1"
|
||||
gatewayv1beta1 "github.com/cs3org/go-cs3apis/cs3/gateway/v1beta1"
|
||||
userv1beta1 "github.com/cs3org/go-cs3apis/cs3/identity/user/v1beta1"
|
||||
rpcv1beta1 "github.com/cs3org/go-cs3apis/cs3/rpc/v1beta1"
|
||||
@@ -23,6 +25,7 @@ import (
|
||||
"github.com/cs3org/reva/v2/pkg/rgrpc/todo/pool"
|
||||
"github.com/cs3org/reva/v2/pkg/storagespace"
|
||||
"github.com/cs3org/reva/v2/pkg/utils"
|
||||
"github.com/golang/protobuf/proto"
|
||||
"github.com/google/uuid"
|
||||
"github.com/owncloud/ocis/v2/services/collaboration/pkg/config"
|
||||
"github.com/owncloud/ocis/v2/services/collaboration/pkg/connector/fileinfo"
|
||||
@@ -1230,7 +1233,7 @@ func (f *FileConnector) CheckFileInfo(ctx context.Context) (*ConnectorResponse,
|
||||
} else {
|
||||
if scopes, ok := ctxpkg.ContextGetScopes(ctx); ok {
|
||||
publicShare := &link.PublicShare{}
|
||||
if err := helpers.GetScopeByKeyPrefix(scopes, "publicshare:", publicShare); err == nil {
|
||||
if err := f.getScopeByKeyPrefix(scopes, "publicshare:", publicShare); err == nil {
|
||||
parentFolderURL.Path = path.Join(ocisURL.Path, "s", publicShare.GetToken())
|
||||
} else {
|
||||
logger.Error().Err(err).Msg("CheckFileInfo: error getting public share scope")
|
||||
@@ -1483,3 +1486,17 @@ func (f *FileConnector) adjustWopiReference(ctx context.Context, wopiContext *mi
|
||||
|
||||
return newStatRes.GetInfo(), nil
|
||||
}
|
||||
|
||||
// getScopeByKeyPrefix returns the scope from the AccessToken Scope map by key prefix
|
||||
func (f *FileConnector) getScopeByKeyPrefix(scopes map[string]*auth.Scope, keyPrefix string, m proto.Message) error {
|
||||
for k, v := range scopes {
|
||||
if strings.HasPrefix(k, keyPrefix) && v.Resource.Decoder == "json" {
|
||||
err := utils.UnmarshalJSONToProtoV1(v.Resource.Value, m)
|
||||
if err != nil {
|
||||
return fmt.Errorf("can't unmarshal public share from scope: %w", err)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
}
|
||||
return fmt.Errorf("scope %s not found", keyPrefix)
|
||||
}
|
||||
@@ -1,24 +0,0 @@
|
||||
package helpers
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"strings"
|
||||
|
||||
auth "github.com/cs3org/go-cs3apis/cs3/auth/provider/v1beta1"
|
||||
"github.com/cs3org/reva/v2/pkg/utils"
|
||||
"github.com/golang/protobuf/proto"
|
||||
)
|
||||
|
||||
// GetScopeByKeyPrefix returns the scope from the AccessToken Scope map by key prefix
|
||||
func GetScopeByKeyPrefix(scopes map[string]*auth.Scope, keyPrefix string, m proto.Message) error {
|
||||
for k, v := range scopes {
|
||||
if strings.HasPrefix(k, keyPrefix) && v.Resource.Decoder == "json" {
|
||||
err := utils.UnmarshalJSONToProtoV1(v.Resource.Value, m)
|
||||
if err != nil {
|
||||
return fmt.Errorf("can't unmarshal public share from scope: %w", err)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
}
|
||||
return fmt.Errorf("scope %s not found", keyPrefix)
|
||||
}
|
||||
@@ -12,7 +12,7 @@ msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: \n"
|
||||
"Report-Msgid-Bugs-To: EMAIL\n"
|
||||
"POT-Creation-Date: 2024-11-26 00:18+0000\n"
|
||||
"POT-Creation-Date: 2024-12-16 00:19+0000\n"
|
||||
"PO-Revision-Date: 2024-04-04 00:17+0000\n"
|
||||
"Last-Translator: Michael Barz <mbarz@owncloud.com>, 2024\n"
|
||||
"Language-Team: German (https://app.transifex.com/owncloud-org/teams/6149/de/)\n"
|
||||
|
||||
@@ -11,7 +11,7 @@ msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: \n"
|
||||
"Report-Msgid-Bugs-To: EMAIL\n"
|
||||
"POT-Creation-Date: 2024-11-25 19:13+0000\n"
|
||||
"POT-Creation-Date: 2024-12-16 00:19+0000\n"
|
||||
"PO-Revision-Date: 2024-04-04 00:17+0000\n"
|
||||
"Last-Translator: Keram, 2024\n"
|
||||
"Language-Team: Uyghur (https://app.transifex.com/owncloud-org/teams/6149/ug/)\n"
|
||||
|
||||
@@ -11,7 +11,7 @@ msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: \n"
|
||||
"Report-Msgid-Bugs-To: EMAIL\n"
|
||||
"POT-Creation-Date: 2024-11-26 00:18+0000\n"
|
||||
"POT-Creation-Date: 2024-12-16 00:19+0000\n"
|
||||
"PO-Revision-Date: 2024-04-04 00:17+0000\n"
|
||||
"Last-Translator: Roman Perekhod, 2024\n"
|
||||
"Language-Team: Ukrainian (https://app.transifex.com/owncloud-org/teams/6149/uk/)\n"
|
||||
|
||||
@@ -645,6 +645,10 @@ func (g Graph) formatDrives(ctx context.Context, baseURL *url.URL, storageSpaces
|
||||
for i := 0; i < numWorkers; i++ {
|
||||
errg.Go(func() error {
|
||||
for storageSpace := range work {
|
||||
if storageSpace.GetRoot().GetStorageId() == utils.OCMStorageProviderID {
|
||||
// skip OCM shares they are no supposed to show up in the drives list
|
||||
continue
|
||||
}
|
||||
res, err := g.cs3StorageSpaceToDrive(ctx, baseURL, storageSpace, apiVersion)
|
||||
if err != nil {
|
||||
return err
|
||||
@@ -679,11 +683,9 @@ func (g Graph) formatDrives(ctx context.Context, baseURL *url.URL, storageSpaces
|
||||
close(results)
|
||||
}()
|
||||
|
||||
responses := make([]*libregraph.Drive, len(storageSpaces))
|
||||
i := 0
|
||||
responses := make([]*libregraph.Drive, 0, len(storageSpaces))
|
||||
for r := range results {
|
||||
responses[i] = r
|
||||
i++
|
||||
responses = append(responses, r)
|
||||
}
|
||||
|
||||
if err := errg.Wait(); err != nil {
|
||||
|
||||
@@ -11,7 +11,7 @@ msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: \n"
|
||||
"Report-Msgid-Bugs-To: EMAIL\n"
|
||||
"POT-Creation-Date: 2024-11-20 00:17+0000\n"
|
||||
"POT-Creation-Date: 2024-12-11 00:19+0000\n"
|
||||
"PO-Revision-Date: 2023-04-19 11:11+0000\n"
|
||||
"Last-Translator: Arnau Morancho, 2023\n"
|
||||
"Language-Team: Catalan (https://app.transifex.com/owncloud-org/teams/6149/ca/)\n"
|
||||
|
||||
@@ -14,7 +14,7 @@ msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: \n"
|
||||
"Report-Msgid-Bugs-To: EMAIL\n"
|
||||
"POT-Creation-Date: 2024-11-20 00:17+0000\n"
|
||||
"POT-Creation-Date: 2024-12-11 00:19+0000\n"
|
||||
"PO-Revision-Date: 2023-04-19 11:11+0000\n"
|
||||
"Last-Translator: Martin <github@diemattels.at>, 2024\n"
|
||||
"Language-Team: German (https://app.transifex.com/owncloud-org/teams/6149/de/)\n"
|
||||
|
||||
@@ -12,7 +12,7 @@ msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: \n"
|
||||
"Report-Msgid-Bugs-To: EMAIL\n"
|
||||
"POT-Creation-Date: 2024-11-20 00:17+0000\n"
|
||||
"POT-Creation-Date: 2024-12-11 00:19+0000\n"
|
||||
"PO-Revision-Date: 2023-04-19 11:11+0000\n"
|
||||
"Last-Translator: Michael Barz <mbarz@owncloud.com>, 2023\n"
|
||||
"Language-Team: German (Germany) (https://app.transifex.com/owncloud-org/teams/6149/de_DE/)\n"
|
||||
|
||||
@@ -12,7 +12,7 @@ msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: \n"
|
||||
"Report-Msgid-Bugs-To: EMAIL\n"
|
||||
"POT-Creation-Date: 2024-11-26 00:18+0000\n"
|
||||
"POT-Creation-Date: 2024-12-16 00:19+0000\n"
|
||||
"PO-Revision-Date: 2023-04-19 11:11+0000\n"
|
||||
"Last-Translator: Jesús Recio <jrecio@solidgear.es>, 2024\n"
|
||||
"Language-Team: Spanish (https://app.transifex.com/owncloud-org/teams/6149/es/)\n"
|
||||
|
||||
@@ -11,7 +11,7 @@ msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: \n"
|
||||
"Report-Msgid-Bugs-To: EMAIL\n"
|
||||
"POT-Creation-Date: 2024-11-20 00:17+0000\n"
|
||||
"POT-Creation-Date: 2024-12-11 00:19+0000\n"
|
||||
"PO-Revision-Date: 2023-04-19 11:11+0000\n"
|
||||
"Last-Translator: hoshi1800 <hoshi1800@gmail.com>, 2024\n"
|
||||
"Language-Team: Japanese (Japan) (https://app.transifex.com/owncloud-org/teams/6149/ja_JP/)\n"
|
||||
|
||||
@@ -11,7 +11,7 @@ msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: \n"
|
||||
"Report-Msgid-Bugs-To: EMAIL\n"
|
||||
"POT-Creation-Date: 2024-11-20 00:17+0000\n"
|
||||
"POT-Creation-Date: 2024-12-11 00:19+0000\n"
|
||||
"PO-Revision-Date: 2023-04-19 11:11+0000\n"
|
||||
"Last-Translator: Hugo Blackwood, 2023\n"
|
||||
"Language-Team: Korean (https://app.transifex.com/owncloud-org/teams/6149/ko/)\n"
|
||||
|
||||
@@ -11,7 +11,7 @@ msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: \n"
|
||||
"Report-Msgid-Bugs-To: EMAIL\n"
|
||||
"POT-Creation-Date: 2024-11-20 00:17+0000\n"
|
||||
"POT-Creation-Date: 2024-12-11 00:19+0000\n"
|
||||
"PO-Revision-Date: 2023-04-19 11:11+0000\n"
|
||||
"Last-Translator: Flávio Veras <flaviove@gmail.com>, 2024\n"
|
||||
"Language-Team: Portuguese (Brazil) (https://app.transifex.com/owncloud-org/teams/6149/pt_BR/)\n"
|
||||
|
||||
@@ -12,7 +12,7 @@ msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: \n"
|
||||
"Report-Msgid-Bugs-To: EMAIL\n"
|
||||
"POT-Creation-Date: 2024-11-20 00:17+0000\n"
|
||||
"POT-Creation-Date: 2024-12-11 00:19+0000\n"
|
||||
"PO-Revision-Date: 2023-04-19 11:11+0000\n"
|
||||
"Last-Translator: dutty5, 2024\n"
|
||||
"Language-Team: Russian (Russia) (https://app.transifex.com/owncloud-org/teams/6149/ru_RU/)\n"
|
||||
|
||||
@@ -11,7 +11,7 @@ msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: \n"
|
||||
"Report-Msgid-Bugs-To: EMAIL\n"
|
||||
"POT-Creation-Date: 2024-11-20 00:17+0000\n"
|
||||
"POT-Creation-Date: 2024-12-11 00:19+0000\n"
|
||||
"PO-Revision-Date: 2023-04-19 11:11+0000\n"
|
||||
"Last-Translator: Begüm Topyıldız <bgmtpyldz@gmail.com>, 2023\n"
|
||||
"Language-Team: Turkish (https://app.transifex.com/owncloud-org/teams/6149/tr/)\n"
|
||||
|
||||
@@ -11,7 +11,7 @@ msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: \n"
|
||||
"Report-Msgid-Bugs-To: EMAIL\n"
|
||||
"POT-Creation-Date: 2024-11-24 00:23+0000\n"
|
||||
"POT-Creation-Date: 2024-12-15 00:43+0000\n"
|
||||
"PO-Revision-Date: 2023-04-19 11:11+0000\n"
|
||||
"Last-Translator: Keram, 2024\n"
|
||||
"Language-Team: Uyghur (https://app.transifex.com/owncloud-org/teams/6149/ug/)\n"
|
||||
|
||||
@@ -11,7 +11,7 @@ msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: \n"
|
||||
"Report-Msgid-Bugs-To: EMAIL\n"
|
||||
"POT-Creation-Date: 2024-11-20 00:17+0000\n"
|
||||
"POT-Creation-Date: 2024-12-11 00:19+0000\n"
|
||||
"PO-Revision-Date: 2023-04-19 11:11+0000\n"
|
||||
"Last-Translator: Shouyuan, 2023\n"
|
||||
"Language-Team: Chinese Simplified (https://app.transifex.com/owncloud-org/teams/6149/zh-Hans/)\n"
|
||||
|
||||
@@ -11,7 +11,7 @@ msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: \n"
|
||||
"Report-Msgid-Bugs-To: EMAIL\n"
|
||||
"POT-Creation-Date: 2024-11-20 00:17+0000\n"
|
||||
"POT-Creation-Date: 2024-12-11 00:19+0000\n"
|
||||
"PO-Revision-Date: 2023-04-19 11:11+0000\n"
|
||||
"Last-Translator: Shouyuan, 2023\n"
|
||||
"Language-Team: Chinese (China) (https://app.transifex.com/owncloud-org/teams/6149/zh_CN/)\n"
|
||||
|
||||
@@ -4,6 +4,7 @@ import (
|
||||
"crypto/tls"
|
||||
"crypto/x509"
|
||||
"errors"
|
||||
stdlog "log"
|
||||
"net"
|
||||
"net/http"
|
||||
"net/http/httputil"
|
||||
@@ -32,6 +33,9 @@ func NewMultiHostReverseProxy(opts ...Option) (*MultiHostReverseProxy, error) {
|
||||
options := newOptions(opts...)
|
||||
|
||||
rp := &MultiHostReverseProxy{
|
||||
ReverseProxy: httputil.ReverseProxy{
|
||||
ErrorLog: stdlog.New(options.Logger, "", 0),
|
||||
},
|
||||
Directors: make(map[string]map[config.RouteType]map[string]map[string]func(req *http.Request)),
|
||||
logger: options.Logger,
|
||||
config: options.Config,
|
||||
|
||||
@@ -14,7 +14,7 @@ msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: \n"
|
||||
"Report-Msgid-Bugs-To: EMAIL\n"
|
||||
"POT-Creation-Date: 2024-11-23 00:55+0000\n"
|
||||
"POT-Creation-Date: 2024-12-14 00:17+0000\n"
|
||||
"PO-Revision-Date: 2023-03-15 08:28+0000\n"
|
||||
"Last-Translator: dutty5, 2024\n"
|
||||
"Language-Team: Russian (https://app.transifex.com/owncloud-org/teams/6149/ru/)\n"
|
||||
|
||||
@@ -12,7 +12,7 @@ msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: \n"
|
||||
"Report-Msgid-Bugs-To: EMAIL\n"
|
||||
"POT-Creation-Date: 2024-11-23 00:55+0000\n"
|
||||
"POT-Creation-Date: 2024-12-14 00:17+0000\n"
|
||||
"PO-Revision-Date: 2023-03-15 08:28+0000\n"
|
||||
"Last-Translator: dutty5, 2024\n"
|
||||
"Language-Team: Russian (Russia) (https://app.transifex.com/owncloud-org/teams/6149/ru_RU/)\n"
|
||||
|
||||
@@ -11,7 +11,7 @@ msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: \n"
|
||||
"Report-Msgid-Bugs-To: EMAIL\n"
|
||||
"POT-Creation-Date: 2024-11-24 00:23+0000\n"
|
||||
"POT-Creation-Date: 2024-12-15 00:43+0000\n"
|
||||
"PO-Revision-Date: 2023-03-15 08:28+0000\n"
|
||||
"Last-Translator: Keram, 2024\n"
|
||||
"Language-Team: Uyghur (https://app.transifex.com/owncloud-org/teams/6149/ug/)\n"
|
||||
|
||||
@@ -11,7 +11,7 @@ msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: \n"
|
||||
"Report-Msgid-Bugs-To: EMAIL\n"
|
||||
"POT-Creation-Date: 2024-11-26 00:18+0000\n"
|
||||
"POT-Creation-Date: 2024-12-16 00:19+0000\n"
|
||||
"PO-Revision-Date: 2023-03-15 08:28+0000\n"
|
||||
"Last-Translator: Roman Perekhod, 2024\n"
|
||||
"Language-Team: Ukrainian (https://app.transifex.com/owncloud-org/teams/6149/uk/)\n"
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
SHELL := bash
|
||||
NAME := web
|
||||
WEB_ASSETS_VERSION = v11.0.4
|
||||
WEB_ASSETS_VERSION = v11.0.6
|
||||
|
||||
include ../../.make/recursion.mk
|
||||
|
||||
|
||||
@@ -5,4 +5,9 @@ type contextKey int
|
||||
const (
|
||||
ContextKeyID contextKey = iota
|
||||
ContextKeyPath
|
||||
|
||||
// RFC1123 time that mimics oc10. time.RFC1123 would end in "UTC", see https://github.com/golang/go/issues/13781
|
||||
// Format copied from internal package https://github.com/cs3org/reva/blob/edge/internal/http/services/owncloud/ocdav/net/net.go.
|
||||
// It's needed to match the times shown in PROPFIND and REPORT requests.
|
||||
RFC1123 = "Mon, 02 Jan 2006 15:04:05 GMT"
|
||||
)
|
||||
@@ -9,7 +9,6 @@ import (
|
||||
"path"
|
||||
"strconv"
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
provider "github.com/cs3org/go-cs3apis/cs3/storage/provider/v1beta1"
|
||||
merrors "go-micro.dev/v4/errors"
|
||||
@@ -21,6 +20,7 @@ import (
|
||||
"github.com/cs3org/reva/v2/pkg/utils"
|
||||
searchmsg "github.com/owncloud/ocis/v2/protogen/gen/ocis/messages/search/v0"
|
||||
searchsvc "github.com/owncloud/ocis/v2/protogen/gen/ocis/services/search/v0"
|
||||
"github.com/owncloud/ocis/v2/services/webdav/pkg/constants"
|
||||
"github.com/owncloud/ocis/v2/services/webdav/pkg/net"
|
||||
"github.com/owncloud/ocis/v2/services/webdav/pkg/prop"
|
||||
"github.com/owncloud/ocis/v2/services/webdav/pkg/propfind"
|
||||
@@ -192,7 +192,7 @@ func matchToPropResponse(ctx context.Context, match *searchmsg.Match) (*propfind
|
||||
})))
|
||||
}
|
||||
propstatOK.Prop = append(propstatOK.Prop, prop.Escaped("oc:name", match.Entity.Name))
|
||||
propstatOK.Prop = append(propstatOK.Prop, prop.Escaped("d:getlastmodified", match.Entity.LastModifiedTime.AsTime().Format(time.RFC3339)))
|
||||
propstatOK.Prop = append(propstatOK.Prop, prop.Escaped("d:getlastmodified", match.Entity.LastModifiedTime.AsTime().Format(constants.RFC1123)))
|
||||
propstatOK.Prop = append(propstatOK.Prop, prop.Escaped("d:getcontenttype", match.Entity.MimeType))
|
||||
propstatOK.Prop = append(propstatOK.Prop, prop.Escaped("oc:permissions", match.Entity.Permissions))
|
||||
propstatOK.Prop = append(propstatOK.Prop, prop.Escaped("oc:highlights", match.Entity.Highlights))
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
sonar.projectKey=owncloud_ocis
|
||||
sonar.organization=owncloud-1
|
||||
sonar.projectName=ocis
|
||||
sonar.projectVersion=7.0.0-rc.4
|
||||
sonar.projectVersion=7.0.0-rc.5
|
||||
sonar.host.url=https://sonarcloud.io
|
||||
|
||||
# =====================================================
|
||||
|
||||
@@ -0,0 +1,93 @@
|
||||
<?php declare(strict_types=1);
|
||||
/**
|
||||
* ownCloud
|
||||
*
|
||||
* @author Niraj Acharya <niraj@jankaritech.com>
|
||||
* @copyright Copyright (c) 2024 Niraj Acharya niraj@jankaritech.com
|
||||
*
|
||||
* This code is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Affero General Public License,
|
||||
* as published by the Free Software Foundation;
|
||||
* either version 3 of the License, or any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Affero General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>
|
||||
*
|
||||
*/
|
||||
|
||||
namespace TestHelpers;
|
||||
|
||||
use Psr\Http\Message\ResponseInterface;
|
||||
|
||||
/**
|
||||
* A helper class for managing Auth App API requests
|
||||
*/
|
||||
class AuthAppHelper {
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public static function getAuthAppEndpoint(): string {
|
||||
return "/auth-app/tokens";
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $baseUrl
|
||||
* @param string $user
|
||||
* @param string $password
|
||||
*
|
||||
* @return ResponseInterface
|
||||
*/
|
||||
public static function listAllAppAuthTokensForUser(string $baseUrl, string $user, string $password): ResponseInterface {
|
||||
$url = $baseUrl . self::getAuthAppEndpoint();
|
||||
return HttpRequestHelper::sendRequest(
|
||||
$url,
|
||||
null,
|
||||
"GET",
|
||||
$user,
|
||||
$password,
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $baseUrl
|
||||
* @param string $user
|
||||
* @param string $password
|
||||
* @param string $expiration
|
||||
*
|
||||
* @return ResponseInterface
|
||||
*/
|
||||
public static function createAppAuthToken(string $baseUrl, string $user, string $password, string $expiration): ResponseInterface {
|
||||
$url = $baseUrl . self::getAuthAppEndpoint() . "?expiry=$expiration";
|
||||
return HttpRequestHelper::sendRequest(
|
||||
$url,
|
||||
null,
|
||||
"POST",
|
||||
$user,
|
||||
$password,
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $baseUrl
|
||||
* @param string $user
|
||||
* @param string $password
|
||||
* @param string $token
|
||||
*
|
||||
* @return ResponseInterface
|
||||
*/
|
||||
public static function deleteAppAuthToken(string $baseUrl, string $user, string $password, string $token): ResponseInterface {
|
||||
$url = $baseUrl . self::getAuthAppEndpoint() . "?token=$token";
|
||||
return HttpRequestHelper::sendRequest(
|
||||
$url,
|
||||
null,
|
||||
"DELETE",
|
||||
$user,
|
||||
$password,
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -43,6 +43,7 @@ class GraphHelper {
|
||||
public const ADDITIONAL_PERMISSIONS_ROLES = [
|
||||
'Secure Viewer' => 'aa97fe03-7980-45ac-9e50-b325749fd7e6',
|
||||
'Space Editor Without Versions' => '3284f2d5-0070-4ad8-ac40-c247f7c1fb27',
|
||||
'Denied' => '63e64e19-8d43-42ec-a738-2b6af2610efa',
|
||||
];
|
||||
|
||||
public const SHARES_SPACE_ID = 'a0ca6a90-a365-4782-871e-d44447bbc668$a0ca6a90-a365-4782-871e-d44447bbc668';
|
||||
@@ -126,7 +127,14 @@ class GraphHelper {
|
||||
* @return string
|
||||
*/
|
||||
public static function getFederatedUserRegex(): string {
|
||||
return '^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=|[A-Za-z0-9+/]{4})$';
|
||||
return '(?=(.{4})*$)[A-Za-z0-9+/]*={0,2}$';
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public static function getFederatedFileIdRegex(): string {
|
||||
return self::getSpaceIdRegex() . '!(?=(.{4})*$)[A-Za-z0-9+/]*={0,2}';
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -46,8 +46,7 @@ class UploadHelper extends Assert {
|
||||
* @param string|null $xRequestId
|
||||
* @param array|null $headers
|
||||
* @param int|null $davPathVersionToUse (1|2)
|
||||
* @param int|null $chunkingVersion (1|2|null)
|
||||
* if set to null chunking will not be used
|
||||
* @param bool $doChunkUpload
|
||||
* @param int|null $noOfChunks how many chunks to upload
|
||||
* @param bool|null $isGivenStep
|
||||
*
|
||||
@@ -63,12 +62,11 @@ class UploadHelper extends Assert {
|
||||
?string $xRequestId = '',
|
||||
?array $headers = [],
|
||||
?int $davPathVersionToUse = 1,
|
||||
?int $chunkingVersion = null,
|
||||
bool $doChunkUpload = false,
|
||||
?int $noOfChunks = 1,
|
||||
?bool $isGivenStep = false
|
||||
?bool $isGivenStep = false,
|
||||
): ResponseInterface {
|
||||
//simple upload with no chunking
|
||||
if ($chunkingVersion === null) {
|
||||
if (!$doChunkUpload) {
|
||||
$data = \file_get_contents($source);
|
||||
return WebDavHelper::makeDavRequest(
|
||||
$baseUrl,
|
||||
@@ -91,56 +89,16 @@ class UploadHelper extends Assert {
|
||||
null,
|
||||
$isGivenStep
|
||||
);
|
||||
} else {
|
||||
//prepare chunking
|
||||
$chunks = self::chunkFile($source, $noOfChunks);
|
||||
$chunkingId = 'chunking-' . \rand(1000, 9999);
|
||||
$v2ChunksDestination = '/uploads/' . $user . '/' . $chunkingId;
|
||||
}
|
||||
|
||||
//prepare chunking
|
||||
$chunks = self::chunkFile($source, $noOfChunks);
|
||||
$chunkingId = 'chunking-' . \rand(1000, 9999);
|
||||
$result = null;
|
||||
|
||||
//prepare chunking version specific stuff
|
||||
if ($chunkingVersion === 1) {
|
||||
$headers['OC-Chunked'] = '1';
|
||||
} elseif ($chunkingVersion === 2) {
|
||||
$result = WebDavHelper::makeDavRequest(
|
||||
$baseUrl,
|
||||
$user,
|
||||
$password,
|
||||
'MKCOL',
|
||||
$v2ChunksDestination,
|
||||
$headers,
|
||||
null,
|
||||
$xRequestId,
|
||||
null,
|
||||
$davPathVersionToUse,
|
||||
"uploads",
|
||||
null,
|
||||
"basic",
|
||||
false,
|
||||
0,
|
||||
null,
|
||||
[],
|
||||
null,
|
||||
$isGivenStep
|
||||
);
|
||||
if ($result->getStatusCode() >= 400) {
|
||||
return $result;
|
||||
}
|
||||
}
|
||||
|
||||
//upload chunks
|
||||
foreach ($chunks as $index => $chunk) {
|
||||
if ($chunkingVersion === 1) {
|
||||
$filename = $destination . "-" . $chunkingId . "-" .
|
||||
\count($chunks) . '-' . $index;
|
||||
$davRequestType = "files";
|
||||
} else {
|
||||
// do chunking version 2
|
||||
$filename = $v2ChunksDestination . '/' . $index;
|
||||
$davRequestType = "uploads";
|
||||
}
|
||||
$filename = $destination . "-" . $chunkingId . "-" . \count($chunks) . '-' . $index;
|
||||
$result = WebDavHelper::makeDavRequest(
|
||||
$baseUrl,
|
||||
$user,
|
||||
@@ -152,7 +110,7 @@ class UploadHelper extends Assert {
|
||||
$xRequestId,
|
||||
$chunk,
|
||||
$davPathVersionToUse,
|
||||
$davRequestType,
|
||||
"files",
|
||||
null,
|
||||
"basic",
|
||||
false,
|
||||
@@ -166,121 +124,11 @@ class UploadHelper extends Assert {
|
||||
return $result;
|
||||
}
|
||||
}
|
||||
//finish upload for new chunking
|
||||
if ($chunkingVersion === 2) {
|
||||
$source = $v2ChunksDestination . '/.file';
|
||||
$headers['Destination'] = $baseUrl . "/" .
|
||||
WebDavHelper::getDavPath($davPathVersionToUse, $user) .
|
||||
$destination;
|
||||
$result = WebDavHelper::makeDavRequest(
|
||||
$baseUrl,
|
||||
$user,
|
||||
$password,
|
||||
'MOVE',
|
||||
$source,
|
||||
$headers,
|
||||
null,
|
||||
$xRequestId,
|
||||
null,
|
||||
$davPathVersionToUse,
|
||||
"uploads",
|
||||
null,
|
||||
"basic",
|
||||
false,
|
||||
0,
|
||||
null,
|
||||
[],
|
||||
null,
|
||||
$isGivenStep
|
||||
);
|
||||
if ($result->getStatusCode() >= 400) {
|
||||
return $result;
|
||||
}
|
||||
}
|
||||
self::assertNotNull($result, __METHOD__ . " chunking version $chunkingVersion was requested but no upload was done.");
|
||||
|
||||
self::assertNotNull($result, __METHOD__ . " chunking was requested but no upload was done.");
|
||||
return $result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Upload the same file multiple times with different mechanisms.
|
||||
*
|
||||
* @param string|null $baseUrl URL of owncloud
|
||||
* @param string|null $user user who uploads
|
||||
* @param string|null $password
|
||||
* @param string|null $source source file path
|
||||
* @param string|null $destination destination path on the server
|
||||
* @param string|null $xRequestId
|
||||
* @param bool $overwriteMode when false creates separate files to test uploading brand-new files,
|
||||
* when true it just overwrites the same file over and over again with the same name
|
||||
* @param string|null $exceptChunkingType empty string or "old" or "new"
|
||||
*
|
||||
* @return array of ResponseInterface
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public static function uploadWithAllMechanisms(
|
||||
?string $baseUrl,
|
||||
?string $user,
|
||||
?string $password,
|
||||
?string $source,
|
||||
?string $destination,
|
||||
?string $xRequestId = '',
|
||||
?bool $overwriteMode = false,
|
||||
?string $exceptChunkingType = ''
|
||||
):array {
|
||||
$responses = [];
|
||||
foreach ([1, 2] as $davPathVersion) {
|
||||
if ($davPathVersion === 1) {
|
||||
$davHuman = 'old';
|
||||
} else {
|
||||
$davHuman = 'new';
|
||||
}
|
||||
|
||||
switch ($exceptChunkingType) {
|
||||
case 'old':
|
||||
$exceptChunkingVersion = 1;
|
||||
break;
|
||||
case 'new':
|
||||
$exceptChunkingVersion = 2;
|
||||
break;
|
||||
default:
|
||||
$exceptChunkingVersion = -1;
|
||||
break;
|
||||
}
|
||||
|
||||
foreach ([null, 1, 2] as $chunkingVersion) {
|
||||
if ($chunkingVersion === $exceptChunkingVersion) {
|
||||
continue;
|
||||
}
|
||||
$valid = WebDavHelper::isValidDavChunkingCombination(
|
||||
$davPathVersion,
|
||||
$chunkingVersion
|
||||
);
|
||||
if ($valid === false) {
|
||||
continue;
|
||||
}
|
||||
$finalDestination = $destination;
|
||||
if (!$overwriteMode && $chunkingVersion !== null) {
|
||||
$finalDestination .= "-{$davHuman}dav-{$davHuman}chunking";
|
||||
} elseif (!$overwriteMode && $chunkingVersion === null) {
|
||||
$finalDestination .= "-{$davHuman}dav-regular";
|
||||
}
|
||||
$responses[] = self::upload(
|
||||
$baseUrl,
|
||||
$user,
|
||||
$password,
|
||||
$source,
|
||||
$finalDestination,
|
||||
$xRequestId,
|
||||
[],
|
||||
$davPathVersion,
|
||||
$chunkingVersion,
|
||||
2
|
||||
);
|
||||
}
|
||||
}
|
||||
return $responses;
|
||||
}
|
||||
|
||||
/**
|
||||
* cut the file in multiple chunks
|
||||
* returns an array of chunks with the content of the file
|
||||
|
||||
@@ -816,34 +816,6 @@ class WebDavHelper {
|
||||
return \preg_replace("/([^:]\/)\/+/", '$1', $url);
|
||||
}
|
||||
|
||||
/**
|
||||
* Decides if the proposed dav version and chunking version are
|
||||
* a valid combination.
|
||||
* If no chunkingVersion is specified, then any dav version is valid.
|
||||
* If a chunkingVersion is specified, then it has to match the dav version.
|
||||
* Note: in future, the dav and chunking versions might or might not
|
||||
* move together and/or be supported together. So a more complex
|
||||
* matrix could be needed here.
|
||||
*
|
||||
* @param string|int $davPathVersion
|
||||
* @param string|int|null $chunkingVersion
|
||||
*
|
||||
* @return boolean is this a valid combination
|
||||
*/
|
||||
public static function isValidDavChunkingCombination(
|
||||
$davPathVersion,
|
||||
$chunkingVersion
|
||||
): bool {
|
||||
if ($davPathVersion === self::DAV_VERSION_SPACES) {
|
||||
// allow only old chunking version when using the spaces dav
|
||||
return $chunkingVersion === 1;
|
||||
}
|
||||
return (
|
||||
($chunkingVersion === 'no' || $chunkingVersion === null) ||
|
||||
($davPathVersion === $chunkingVersion)
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* get Mtime of File in a public link share
|
||||
*
|
||||
|
||||
@@ -0,0 +1,104 @@
|
||||
<?php declare(strict_types=1);
|
||||
/**
|
||||
* ownCloud
|
||||
*
|
||||
* @author Niraj Acharya <niraj@jankaritech.com>
|
||||
* @copyright Copyright (c) 2024 Niraj Acharya niraj@jankaritech.com
|
||||
*
|
||||
* This code is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Affero General Public License,
|
||||
* as published by the Free Software Foundation;
|
||||
* either version 3 of the License, or any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Affero General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>
|
||||
*
|
||||
*/
|
||||
|
||||
use Behat\Behat\Context\Context;
|
||||
use Behat\Behat\Hook\Scope\BeforeScenarioScope;
|
||||
use TestHelpers\BehatHelper;
|
||||
use GuzzleHttp\Exception\GuzzleException;
|
||||
use TestHelpers\AuthAppHelper;
|
||||
|
||||
require_once 'bootstrap.php';
|
||||
|
||||
/**
|
||||
* AuthApp context
|
||||
*/
|
||||
class AuthAppContext implements Context {
|
||||
private FeatureContext $featureContext;
|
||||
|
||||
/**
|
||||
* @BeforeScenario
|
||||
*
|
||||
* @param BeforeScenarioScope $scope
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function before(BeforeScenarioScope $scope): void {
|
||||
// Get the environment
|
||||
$environment = $scope->getEnvironment();
|
||||
// Get all the contexts you need in this context
|
||||
$this->featureContext = BehatHelper::getContext($scope, $environment, 'FeatureContext');
|
||||
}
|
||||
|
||||
/**
|
||||
* @When user :user creates app token with expiration time :expiration using the auth-app API
|
||||
*
|
||||
* @param string $user
|
||||
* @param string $expiration
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function userCreatesAppTokenWithExpirationTimeUsingTheAuthAppApi(string $user, string $expiration): void {
|
||||
$this->featureContext->setResponse(
|
||||
AuthAppHelper::createAppAuthToken(
|
||||
$this->featureContext->getBaseUrl(),
|
||||
$this->featureContext->getActualUsername($user),
|
||||
$this->featureContext->getPasswordForUser($user),
|
||||
$expiration,
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* @Given user :user has created app token with expiration time :expiration
|
||||
*
|
||||
* @param string $user
|
||||
* @param string $expiration
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function userHasCreatedAppTokenWithExpirationTime(string $user, string $expiration): void {
|
||||
$response = AuthAppHelper::createAppAuthToken(
|
||||
$this->featureContext->getBaseUrl(),
|
||||
$this->featureContext->getActualUsername($user),
|
||||
$this->featureContext->getPasswordForUser($user),
|
||||
$expiration,
|
||||
);
|
||||
$this->featureContext->theHTTPStatusCodeShouldBe(200, "", $response);
|
||||
}
|
||||
|
||||
/**
|
||||
* @When user :user lists all created tokens using the auth-app API
|
||||
*
|
||||
* @param string $user
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function userListsAllCreatedTokensUsingTheAuthAppApi(string $user): void {
|
||||
$this->featureContext->setResponse(
|
||||
AuthAppHelper::listAllAppAuthTokensForUser(
|
||||
$this->featureContext->getBaseUrl(),
|
||||
$this->featureContext->getActualUsername($user),
|
||||
$this->featureContext->getPasswordForUser($user),
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -1132,9 +1132,11 @@ class FeatureContext extends BehatVariablesContext {
|
||||
Assert::fail("'$validator' should be an object not an array");
|
||||
}
|
||||
Assert::assertFalse($value->allOf || $value->anyOf, "'allOf' and 'anyOf' are not allowed in array");
|
||||
Assert::assertNotNull($value->oneOf, "'oneOf' is required to assert more than one elements");
|
||||
Assert::assertTrue(\is_array($value->oneOf), "'oneOf' should be an array");
|
||||
Assert::assertEquals($schemaObj->maxItems, \count($value->oneOf), "Expected " . $schemaObj->maxItems . " 'oneOf' items but got " . \count($value->oneOf));
|
||||
if ($value->oneOf) {
|
||||
Assert::assertNotNull($value->oneOf, "'oneOf' is required to assert more than one elements");
|
||||
Assert::assertTrue(\is_array($value->oneOf), "'oneOf' should be an array");
|
||||
Assert::assertEquals($schemaObj->maxItems, \count($value->oneOf), "Expected " . $schemaObj->maxItems . " 'oneOf' items but got " . \count($value->oneOf));
|
||||
}
|
||||
}
|
||||
Assert::assertTrue(\is_object($value), "'$validator' should be an object when expecting 1 element");
|
||||
break;
|
||||
@@ -1226,7 +1228,7 @@ class FeatureContext extends BehatVariablesContext {
|
||||
$errors = $this->getJsonSchemaErrors($e);
|
||||
$messages = ["JSON Schema validation failed:"];
|
||||
|
||||
$previousPointer = '';
|
||||
$previousPointer = null;
|
||||
$errorCount = 0;
|
||||
foreach ($errors as $error) {
|
||||
$expected = $error->constraint;
|
||||
@@ -1236,6 +1238,9 @@ class FeatureContext extends BehatVariablesContext {
|
||||
$dataPointer = \str_replace("/", ".", \trim($error->getDataPointer(), "/"));
|
||||
|
||||
$pointer = \str_contains($schemaPointer, "additionalProperties") ? $dataPointer : $schemaPointer;
|
||||
if ($pointer === '') {
|
||||
$pointer = "{root}";
|
||||
}
|
||||
if ($pointer === $previousPointer) {
|
||||
continue;
|
||||
}
|
||||
@@ -2339,6 +2344,14 @@ class FeatureContext extends BehatVariablesContext {
|
||||
],
|
||||
"parameter" => []
|
||||
],
|
||||
[
|
||||
"code" => "%federated_file_id_pattern%",
|
||||
"function" => [
|
||||
__NAMESPACE__ . '\TestHelpers\GraphHelper',
|
||||
"getFederatedFileIdRegex"
|
||||
],
|
||||
"parameter" => []
|
||||
],
|
||||
[
|
||||
"code" => "%group_id_pattern%",
|
||||
"function" => [
|
||||
|
||||
@@ -4000,12 +4000,50 @@ class SpacesContext implements Context {
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $resource // can be resource name, space id or file id
|
||||
* @param array $properties // ["key" => "value"]
|
||||
* @param SimpleXMLElement $responseXmlObject
|
||||
* @param array $xpaths
|
||||
* @param string $message
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function buildXpathErrorMessage(SimpleXMLElement $responseXmlObject, array $xpaths, string $message): string {
|
||||
return "Using xpaths:\n\t- " . \join("\n\t- ", $xpaths)
|
||||
. "\n"
|
||||
. $message
|
||||
. "\n\t"
|
||||
. "'" . \trim($responseXmlObject->asXML()) . "'";
|
||||
}
|
||||
|
||||
/**
|
||||
* @param SimpleXMLElement $responseXmlObject
|
||||
* @param string $siblingXpath
|
||||
* @param string $siblingToFind
|
||||
*
|
||||
* @return string
|
||||
* @throws Exception
|
||||
*/
|
||||
public function getXpathSiblingValue(SimpleXMLElement $responseXmlObject, string $siblingXpath, string $siblingToFind): string {
|
||||
$xpaths[] = $siblingXpath . "/preceding-sibling::$siblingToFind";
|
||||
$xpaths[] = $siblingXpath . "/following-sibling::$siblingToFind";
|
||||
|
||||
foreach ($xpaths as $key => $xpath) {
|
||||
$foundSibling = $responseXmlObject->xpath($xpath);
|
||||
if (\count($foundSibling)) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
$errorMessage = $this->buildXpathErrorMessage($responseXmlObject, $xpaths, "Could not find sibling '<$siblingToFind>' element in the XML response");
|
||||
Assert::assertNotEmpty($foundSibling, $errorMessage);
|
||||
return \preg_quote($foundSibling[0]->__toString(), "/");
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $resource // can be resource name, space id or file id
|
||||
* @param array $properties // ["key" => "value"]
|
||||
*
|
||||
* @return void
|
||||
* @throws GuzzleException
|
||||
* @throws JsonException
|
||||
* @throws Exception
|
||||
*/
|
||||
public function theXMLResponseShouldContain(string $resource, array $properties): void {
|
||||
$responseXmlObject = HttpRequestHelper::getResponseXml($this->featureContext->getResponse(), __METHOD__);
|
||||
@@ -4056,17 +4094,39 @@ class SpacesContext implements Context {
|
||||
$xpaths[] = $xpath;
|
||||
}
|
||||
|
||||
Assert::assertCount(
|
||||
1,
|
||||
$foundXmlItem,
|
||||
$this->buildXpathErrorMessage($responseXmlObject, $xpaths, "Found multiple elements for '<$itemToFind>' in the XML response")
|
||||
);
|
||||
Assert::assertNotEmpty(
|
||||
$foundXmlItem,
|
||||
// all these for the sake of a nice error message
|
||||
"Using xpaths:\n\t- " . \join("\n\t- ", $xpaths)
|
||||
. "\n"
|
||||
. "Could not find '<$itemToFind>' element in the XML response\n\t"
|
||||
. "'" . \trim($responseXmlObject->asXML()) . "'"
|
||||
$this->buildXpathErrorMessage($responseXmlObject, $xpaths, "Could not find '<$itemToFind>' element in the XML response")
|
||||
);
|
||||
|
||||
$actualValue = $foundXmlItem[0]->__toString();
|
||||
$expectedValue = $this->featureContext->substituteInLineCodes($property['value']);
|
||||
$expectedValue = $property['value'];
|
||||
\preg_match_all("/%self::[a-z0-9-:]+?%/", $expectedValue, $selfMatches);
|
||||
$substituteFunctions = [];
|
||||
if (!empty($selfMatches[0])) {
|
||||
$siblingXpath = $xpaths[\count($xpaths) - 1];
|
||||
foreach ($selfMatches[0] as $match) {
|
||||
$siblingToFind = \ltrim($match, "/%self::/");
|
||||
$siblingToFind = \rtrim($siblingToFind, "/%/");
|
||||
$substituteFunctions[] = [
|
||||
"code" => $match,
|
||||
"function" =>
|
||||
[$this, "getXpathSiblingValue"],
|
||||
"parameter" => [$responseXmlObject, $siblingXpath, $siblingToFind]
|
||||
];
|
||||
}
|
||||
}
|
||||
$expectedValue = $this->featureContext->substituteInLineCodes(
|
||||
$property['value'],
|
||||
null,
|
||||
[],
|
||||
$substituteFunctions,
|
||||
);
|
||||
|
||||
switch ($itemToFind) {
|
||||
case "oc:fileid":
|
||||
|
||||
@@ -68,8 +68,6 @@ trait WebDav {
|
||||
|
||||
private int $httpRequestTimeout = 0;
|
||||
|
||||
private ?int $chunkingToUse = null;
|
||||
|
||||
/**
|
||||
* The ability to do requests with depth infinity is disabled by default.
|
||||
* This remembers when the setting dav.propfind.depth_infinity has been
|
||||
@@ -1626,7 +1624,7 @@ trait WebDav {
|
||||
* @param array|null $headers
|
||||
* @param int|null $noOfChunks Only use for chunked upload when $this->chunkingToUse is not null
|
||||
*
|
||||
* @return void
|
||||
* @return ResponseInterface
|
||||
* @throws Exception
|
||||
*/
|
||||
public function uploadFileWithHeaders(
|
||||
@@ -1635,30 +1633,27 @@ trait WebDav {
|
||||
string $destination,
|
||||
?array $headers = [],
|
||||
?int $noOfChunks = 0
|
||||
):void {
|
||||
$chunkingVersion = $this->chunkingToUse;
|
||||
): ResponseInterface {
|
||||
$doChunkUpload = true;
|
||||
if ($noOfChunks <= 0) {
|
||||
$chunkingVersion = null;
|
||||
}
|
||||
try {
|
||||
$this->pauseUploadDelete();
|
||||
$this->response = UploadHelper::upload(
|
||||
$this->getBaseUrl(),
|
||||
$this->getActualUsername($user),
|
||||
$this->getUserPassword($user),
|
||||
$source,
|
||||
$destination,
|
||||
$this->getStepLineRef(),
|
||||
$headers,
|
||||
$this->getDavPathVersion(),
|
||||
$chunkingVersion,
|
||||
$noOfChunks
|
||||
);
|
||||
$this->lastUploadDeleteTime = \time();
|
||||
} catch (BadResponseException $e) {
|
||||
// 4xx and 5xx responses cause an exception
|
||||
$this->response = $e->getResponse();
|
||||
$doChunkUpload = false;
|
||||
}
|
||||
|
||||
$this->pauseUploadDelete();
|
||||
$response = UploadHelper::upload(
|
||||
$this->getBaseUrl(),
|
||||
$this->getActualUsername($user),
|
||||
$this->getUserPassword($user),
|
||||
$source,
|
||||
$destination,
|
||||
$this->getStepLineRef(),
|
||||
$headers,
|
||||
$this->getDavPathVersion(),
|
||||
$doChunkUpload,
|
||||
$noOfChunks,
|
||||
);
|
||||
$this->lastUploadDeleteTime = \time();
|
||||
return $response;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1669,7 +1664,7 @@ trait WebDav {
|
||||
* @param boolean $async
|
||||
* @param array|null $headers
|
||||
*
|
||||
* @return void
|
||||
* @return ResponseInterface
|
||||
*/
|
||||
public function userUploadsAFileInChunk(
|
||||
string $user,
|
||||
@@ -1678,7 +1673,7 @@ trait WebDav {
|
||||
int $noOfChunks = 2,
|
||||
bool $async = false,
|
||||
?array $headers = []
|
||||
):void {
|
||||
): ResponseInterface {
|
||||
$user = $this->getActualUsername($user);
|
||||
Assert::assertGreaterThan(
|
||||
0,
|
||||
@@ -1686,52 +1681,16 @@ trait WebDav {
|
||||
"What does it mean to have $noOfChunks chunks?"
|
||||
);
|
||||
|
||||
// use chunking version 1 as default, since version 2 uses "remote.php/dav/uploads" endpoint and it doesn't exist in oCIS
|
||||
$this->chunkingToUse = 1;
|
||||
|
||||
if ($async === true) {
|
||||
$headers['OC-LazyOps'] = 'true';
|
||||
}
|
||||
$this->uploadFileWithHeaders(
|
||||
return $this->uploadFileWithHeaders(
|
||||
$user,
|
||||
$this->acceptanceTestsDirLocation() . $source,
|
||||
$destination,
|
||||
$headers,
|
||||
$noOfChunks
|
||||
);
|
||||
$this->pushToLastStatusCodesArrays();
|
||||
}
|
||||
|
||||
/**
|
||||
* Uploading with old/new DAV and chunked/non-chunked.
|
||||
* Except do not do the new-DAV-new-chunking combination. That is not being
|
||||
* supported on all implementations.
|
||||
*
|
||||
* @When user :user uploads file :source to filenames based on :destination with all mechanisms except new chunking using the WebDAV API
|
||||
*
|
||||
* @param string $user
|
||||
* @param string $source
|
||||
* @param string $destination
|
||||
*
|
||||
* @return void
|
||||
* @throws Exception
|
||||
*/
|
||||
public function userUploadsAFileToWithAllMechanismsExceptNewChunking(
|
||||
string $user,
|
||||
string $source,
|
||||
string $destination
|
||||
):void {
|
||||
$user = $this->getActualUsername($user);
|
||||
$this->uploadResponses = UploadHelper::uploadWithAllMechanisms(
|
||||
$this->getBaseUrl(),
|
||||
$this->getActualUsername($user),
|
||||
$this->getUserPassword($user),
|
||||
$this->acceptanceTestsDirLocation() . $source,
|
||||
$destination,
|
||||
$this->getStepLineRef(),
|
||||
false,
|
||||
'new'
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1751,24 +1710,9 @@ trait WebDav {
|
||||
string $destination,
|
||||
int $noOfChunks = 2
|
||||
):void {
|
||||
$this->userUploadsAFileInChunk($user, $source, $destination, $noOfChunks);
|
||||
}
|
||||
|
||||
/**
|
||||
* @Then /^the HTTP status code of all upload responses should be "([^"]*)"$/
|
||||
*
|
||||
* @param int $statusCode
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function theHTTPStatusCodeOfAllUploadResponsesShouldBe(int $statusCode):void {
|
||||
foreach ($this->uploadResponses as $response) {
|
||||
Assert::assertEquals(
|
||||
$statusCode,
|
||||
$response->getStatusCode(),
|
||||
'Response did not return expected status code'
|
||||
);
|
||||
}
|
||||
$response = $this->userUploadsAFileInChunk($user, $source, $destination, $noOfChunks);
|
||||
$this->setResponse($response);
|
||||
$this->pushToLastStatusCodesArrays();
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1960,32 +1904,6 @@ trait WebDav {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @Then /^the HTTP status code of all upload responses should be between "(\d+)" and "(\d+)"$/
|
||||
*
|
||||
* @param int $minStatusCode
|
||||
* @param int $maxStatusCode
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function theHTTPStatusCodeOfAllUploadResponsesShouldBeBetween(
|
||||
int $minStatusCode,
|
||||
int $maxStatusCode
|
||||
):void {
|
||||
foreach ($this->uploadResponses as $response) {
|
||||
Assert::assertGreaterThanOrEqual(
|
||||
$minStatusCode,
|
||||
$response->getStatusCode(),
|
||||
'Response did not return expected status code'
|
||||
);
|
||||
Assert::assertLessThanOrEqual(
|
||||
$maxStatusCode,
|
||||
$response->getStatusCode(),
|
||||
'Response did not return expected status code'
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $user
|
||||
* @param string $destination
|
||||
@@ -2203,7 +2121,7 @@ trait WebDav {
|
||||
$this->getStepLineRef(),
|
||||
["X-OC-Mtime" => $mtime],
|
||||
$this->getDavPathVersion(),
|
||||
null,
|
||||
false,
|
||||
1,
|
||||
$isGivenStep
|
||||
);
|
||||
@@ -2238,7 +2156,7 @@ trait WebDav {
|
||||
$this->getStepLineRef(),
|
||||
["X-OC-Mtime" => $mtime],
|
||||
$this->getDavPathVersion(),
|
||||
null,
|
||||
false,
|
||||
1,
|
||||
true
|
||||
);
|
||||
|
||||
@@ -424,6 +424,14 @@ default:
|
||||
- FeatureContext: *common_feature_context_params
|
||||
- OcisConfigContext:
|
||||
|
||||
apiAuthApp:
|
||||
paths:
|
||||
- "%paths.base%/../features/apiAuthApp"
|
||||
context: *common_ldap_suite_context
|
||||
contexts:
|
||||
- FeatureContext: *common_feature_context_params
|
||||
- AuthAppContext:
|
||||
|
||||
cliCommands:
|
||||
paths:
|
||||
- "%paths.base%/../features/cliCommands"
|
||||
|
||||
@@ -79,7 +79,7 @@ _ocdav: api compatibility, return correct status code_
|
||||
- [coreApiAuth/webDavLOCKAuth.feature:46](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/coreApiAuth/webDavLOCKAuth.feature#L46)
|
||||
- [coreApiAuth/webDavLOCKAuth.feature:58](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/coreApiAuth/webDavLOCKAuth.feature#L58)
|
||||
|
||||
#### [Missing properties in REPORT response](https://github.com/owncloud/ocis/issues/9780), [REPORT response has different date format for d:getlastmodified](https://github.com/owncloud/ocis/issues/9781), [d:getetag property has empty value in REPORT response](https://github.com/owncloud/ocis/issues/9783)
|
||||
#### [Missing properties in REPORT response](https://github.com/owncloud/ocis/issues/9780), [d:getetag property has empty value in REPORT response](https://github.com/owncloud/ocis/issues/9783)
|
||||
|
||||
- [coreApiWebdavOperations/search.feature:180](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/coreApiWebdavOperations/search.feature#L180)
|
||||
- [coreApiWebdavOperations/search.feature:181](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/coreApiWebdavOperations/search.feature#L181)
|
||||
|
||||
@@ -318,5 +318,9 @@ The expected failures in this file are from features in the owncloud/ocis repo.
|
||||
- [apiSearchContent/contentSearch.feature:266](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiSearchContent/contentSearch.feature#L266)
|
||||
- [apiSearchContent/contentSearch.feature:267](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiSearchContent/contentSearch.feature#L267)
|
||||
|
||||
#### [Shares Jail PROPFIND returns different File IDs for the same item](https://github.com/owncloud/ocis/issues/9933)
|
||||
|
||||
- [apiSharingNg1/propfindShares.feature:149](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiSharingNg1/propfindShares.feature#L149)
|
||||
|
||||
Note: always have an empty line at the end of this file.
|
||||
The bash script that processes this file requires that the last line has a newline on the end.
|
||||
@@ -210,8 +210,8 @@
|
||||
- [apiLocks/unlockFiles.feature:321](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiLocks/unlockFiles.feature#L321)
|
||||
- [apiLocks/unlockFiles.feature:322](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiLocks/unlockFiles.feature#L322)
|
||||
- [apiLocks/unlockFiles.feature:323](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiLocks/unlockFiles.feature#L323)
|
||||
- [apiActivities/shareActivities.feature:1962](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiActivities/shareActivities.feature#L1962)
|
||||
- [apiActivities/shareActivities.feature:2101](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiActivities/shareActivities.feature#L2101)
|
||||
- [apiActivities/shareActivities.feature:1956](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiActivities/shareActivities.feature#L1956)
|
||||
- [apiActivities/shareActivities.feature:2095](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiActivities/shareActivities.feature#L2095)
|
||||
- [apiAntivirus/antivirus.feature:114](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiAntivirus/antivirus.feature#L114)
|
||||
- [apiAntivirus/antivirus.feature:115](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiAntivirus/antivirus.feature#L115)
|
||||
- [apiAntivirus/antivirus.feature:116](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiAntivirus/antivirus.feature#L116)
|
||||
|
||||
@@ -1161,8 +1161,7 @@ Feature: check share activity
|
||||
"pattern": "%user_id_pattern%"
|
||||
},
|
||||
"name": {
|
||||
"type": "string",
|
||||
"pattern": "[a-zA-z]{15}"
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
},
|
||||
@@ -1235,8 +1234,7 @@ Feature: check share activity
|
||||
"pattern": "%user_id_pattern%"
|
||||
},
|
||||
"name": {
|
||||
"type": "string",
|
||||
"pattern": "[a-zA-z]{15}"
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
},
|
||||
@@ -1309,8 +1307,7 @@ Feature: check share activity
|
||||
"pattern": "%user_id_pattern%"
|
||||
},
|
||||
"name": {
|
||||
"type": "string",
|
||||
"pattern": "[a-zA-z]{15}"
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
},
|
||||
@@ -1660,8 +1657,7 @@ Feature: check share activity
|
||||
"pattern": "%user_id_pattern%"
|
||||
},
|
||||
"name": {
|
||||
"type": "string",
|
||||
"pattern": "[a-zA-z]{15}"
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
},
|
||||
@@ -1734,8 +1730,7 @@ Feature: check share activity
|
||||
"pattern": "%user_id_pattern%"
|
||||
},
|
||||
"name": {
|
||||
"type": "string",
|
||||
"pattern": "[a-zA-z]{15}"
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
},
|
||||
@@ -1808,8 +1803,7 @@ Feature: check share activity
|
||||
"pattern": "%user_id_pattern%"
|
||||
},
|
||||
"name": {
|
||||
"type": "string",
|
||||
"pattern": "[a-zA-z]{15}"
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
@@ -0,0 +1,67 @@
|
||||
Feature: create auth token
|
||||
As a user
|
||||
I want to create App Tokens
|
||||
So that I can use 3rd party apps
|
||||
|
||||
Background:
|
||||
Given user "Alice" has been created with default attributes
|
||||
|
||||
|
||||
Scenario: user creates app token
|
||||
When user "Alice" creates app token with expiration time "72h" using the auth-app API
|
||||
Then the HTTP status code should be "200"
|
||||
And the JSON data of the response should match
|
||||
"""
|
||||
{
|
||||
"type": "object",
|
||||
"required": [
|
||||
"token",
|
||||
"expiration_date",
|
||||
"created_date",
|
||||
"label"
|
||||
],
|
||||
"properties": {
|
||||
"token": {
|
||||
"type": "string",
|
||||
"pattern": "^[a-zA-Z0-9]{16}$"
|
||||
},
|
||||
"label": {
|
||||
"const": "Generated via API"
|
||||
}
|
||||
}
|
||||
}
|
||||
"""
|
||||
|
||||
|
||||
Scenario: user lists app tokens
|
||||
Given user "Alice" has created app token with expiration time "72h"
|
||||
And user "Alice" has created app token with expiration time "2h"
|
||||
When user "Alice" lists all created tokens using the auth-app API
|
||||
Then the HTTP status code should be "200"
|
||||
And the JSON data of the response should match
|
||||
"""
|
||||
{
|
||||
"type": "array",
|
||||
"minItems": 2,
|
||||
"maxItems": 2,
|
||||
"uniqueItems": true,
|
||||
"items": {
|
||||
"type": "object",
|
||||
"required": [
|
||||
"token",
|
||||
"expiration_date",
|
||||
"created_date",
|
||||
"label"
|
||||
],
|
||||
"properties": {
|
||||
"token": {
|
||||
"type": "string",
|
||||
"pattern": "^\\$2a\\$11\\$[A-Za-z0-9./]{53}$"
|
||||
},
|
||||
"label": {
|
||||
"const": "Generated via API"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
"""
|
||||
@@ -12,7 +12,7 @@ Feature: search federation users
|
||||
And using server "REMOTE"
|
||||
And user "Brian" has been created with default attributes
|
||||
|
||||
|
||||
@issue-9813
|
||||
Scenario: users search for federation users by display name
|
||||
Given using server "LOCAL"
|
||||
And "Alice" has created the federation share invitation
|
||||
@@ -142,7 +142,7 @@ Feature: search federation users
|
||||
}
|
||||
"""
|
||||
|
||||
|
||||
@issue-9813
|
||||
Scenario: user search for federation users by email
|
||||
Given using server "LOCAL"
|
||||
And "Alice" has created the federation share invitation
|
||||
|
||||
@@ -9,20 +9,19 @@ Feature: an user shares resources using ScienceMesh application
|
||||
And user "Brian" has been created with default attributes
|
||||
|
||||
@issue-9534
|
||||
Scenario Outline: local user shares resources to federation user
|
||||
Scenario: local user shares a folder to federation user
|
||||
Given using server "LOCAL"
|
||||
And "Alice" has created the federation share invitation
|
||||
And using server "REMOTE"
|
||||
And "Brian" has accepted invitation
|
||||
And using server "LOCAL"
|
||||
And user "Alice" has created folder "folderToShare"
|
||||
And user "Alice" has uploaded file with content "ocm test" to "/textfile.txt"
|
||||
When user "Alice" sends the following resource share invitation to federated user using the Graph API:
|
||||
| resource | <resource> |
|
||||
| space | Personal |
|
||||
| sharee | Brian |
|
||||
| shareType | user |
|
||||
| permissionsRole | Viewer |
|
||||
| resource | folderToShare |
|
||||
| space | Personal |
|
||||
| sharee | Brian |
|
||||
| shareType | user |
|
||||
| permissionsRole | Viewer |
|
||||
Then the HTTP status code should be "200"
|
||||
When using server "REMOTE"
|
||||
And user "Brian" lists the shares shared with him without retry using the Graph API
|
||||
@@ -31,9 +30,7 @@ Feature: an user shares resources using ScienceMesh application
|
||||
"""
|
||||
{
|
||||
"type": "object",
|
||||
"required": [
|
||||
"value"
|
||||
],
|
||||
"required": ["value"],
|
||||
"properties": {
|
||||
"value": {
|
||||
"type": "array",
|
||||
@@ -45,48 +42,326 @@ Feature: an user shares resources using ScienceMesh application
|
||||
"@UI.Hidden",
|
||||
"@client.synchronize",
|
||||
"createdBy",
|
||||
"name"
|
||||
"eTag",
|
||||
"folder",
|
||||
"id",
|
||||
"lastModifiedDateTime",
|
||||
"name",
|
||||
"parentReference",
|
||||
"remoteItem"
|
||||
],
|
||||
"properties": {
|
||||
"@UI.Hidden": {
|
||||
"type": "boolean",
|
||||
"enum": [
|
||||
false
|
||||
]
|
||||
},
|
||||
"@client.synchronize": {
|
||||
"type": "boolean",
|
||||
"enum": [
|
||||
false
|
||||
]
|
||||
},
|
||||
"@UI.Hidden": { "const": false },
|
||||
"@client.synchronize": { "const": false },
|
||||
"createdBy": {
|
||||
"type": "object",
|
||||
"required": [
|
||||
"user"
|
||||
],
|
||||
"required": ["user"],
|
||||
"properties": {
|
||||
"user": {
|
||||
"type": "object",
|
||||
"required": [
|
||||
"displayName",
|
||||
"id"
|
||||
],
|
||||
"required": ["displayName", "id", "@libre.graph.userType"],
|
||||
"properties": {
|
||||
"displayName": {
|
||||
"type": "string",
|
||||
"const": "Alice Hansen"
|
||||
},
|
||||
"id": {
|
||||
"type": "string",
|
||||
"pattern": "^%federated_user_id_pattern%$"
|
||||
}
|
||||
"displayName": { "const": "Alice Hansen" },
|
||||
"id": { "pattern": "^%federated_user_id_pattern%$" },
|
||||
"@libre.graph.userType": { "const": "Federated" }
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"name": {
|
||||
"const": "<resource>"
|
||||
"eTag": { "pattern": "%etag_pattern%" },
|
||||
"folder": { "const": {} },
|
||||
"id": { "pattern": "^%file_id_pattern%$" },
|
||||
"name": { "const": "folderToShare" },
|
||||
"parentReference": {
|
||||
"type": "object",
|
||||
"required": ["driveId", "driveType", "id"],
|
||||
"properties": {
|
||||
"driveId": { "pattern": "^%space_id_pattern%$" },
|
||||
"driveType": { "const": "virtual" },
|
||||
"id": { "pattern": "^%file_id_pattern%$" }
|
||||
}
|
||||
},
|
||||
"remoteItem": {
|
||||
"type": "object",
|
||||
"required": [
|
||||
"createdBy",
|
||||
"eTag",
|
||||
"folder",
|
||||
"id",
|
||||
"lastModifiedDateTime",
|
||||
"name",
|
||||
"permissions"
|
||||
],
|
||||
"properties": {
|
||||
"createdBy": {
|
||||
"type": "object",
|
||||
"required": ["user"],
|
||||
"properties": {
|
||||
"user": {
|
||||
"type": "object",
|
||||
"required": ["id", "displayName", "@libre.graph.userType"],
|
||||
"properties": {
|
||||
"id": { "pattern": "^%federated_user_id_pattern%$" },
|
||||
"displayName": { "const": "Alice Hansen" },
|
||||
"@libre.graph.userType": { "const": "Federated" }
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"eTag": { "pattern": "%etag_pattern%" },
|
||||
"folder": { "const": {} },
|
||||
"id": { "pattern": "^%federated_file_id_pattern%$" },
|
||||
"name": { "const": "folderToShare" },
|
||||
"permissions": {
|
||||
"type": "array",
|
||||
"minItems": 1,
|
||||
"maxItems": 1,
|
||||
"items": {
|
||||
"type": "object",
|
||||
"required": [
|
||||
"createdDateTime",
|
||||
"grantedToV2",
|
||||
"id",
|
||||
"invitation",
|
||||
"roles"
|
||||
],
|
||||
"properties": {
|
||||
"grantedToV2": {
|
||||
"type": "object",
|
||||
"required": ["user"],
|
||||
"properties": {
|
||||
"user": {
|
||||
"type": "object",
|
||||
"required": ["displayName", "id", "@libre.graph.userType"],
|
||||
"properties": {
|
||||
"displayName": { "const": "Brian Murphy" },
|
||||
"id": { "pattern": "^%user_id_pattern%$" },
|
||||
"@libre.graph.userType": { "const": "Member" }
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"id": { "pattern": "^%uuidv4_pattern%$" },
|
||||
"invitation": {
|
||||
"type": "object",
|
||||
"required": ["invitedBy"],
|
||||
"properties": {
|
||||
"invitedBy": {
|
||||
"type": "object",
|
||||
"required": ["user"],
|
||||
"properties": {
|
||||
"user": {
|
||||
"type": "object",
|
||||
"required": ["displayName", "id", "@libre.graph.userType"],
|
||||
"properties": {
|
||||
"displayName": { "const": "Alice Hansen" },
|
||||
"id": { "pattern": "^%federated_user_id_pattern%$" },
|
||||
"@libre.graph.userType": { "const": "Federated" }
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"roles": {
|
||||
"type": "array",
|
||||
"minItems": 1,
|
||||
"maxItems": 1,
|
||||
"items": {
|
||||
"pattern": "^%role_id_pattern%$"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
"""
|
||||
|
||||
@issue-9534
|
||||
Scenario: local user shares a file to federation user
|
||||
Given using server "LOCAL"
|
||||
And "Alice" has created the federation share invitation
|
||||
And using server "REMOTE"
|
||||
And "Brian" has accepted invitation
|
||||
And using server "LOCAL"
|
||||
And user "Alice" has uploaded file with content "ocm test" to "textfile.txt"
|
||||
When user "Alice" sends the following resource share invitation to federated user using the Graph API:
|
||||
| resource | textfile.txt |
|
||||
| space | Personal |
|
||||
| sharee | Brian |
|
||||
| shareType | user |
|
||||
| permissionsRole | Viewer |
|
||||
Then the HTTP status code should be "200"
|
||||
When using server "REMOTE"
|
||||
And user "Brian" lists the shares shared with him without retry using the Graph API
|
||||
Then the HTTP status code should be "200"
|
||||
And the JSON data of the response should match
|
||||
"""
|
||||
{
|
||||
"type": "object",
|
||||
"required": ["value"],
|
||||
"properties": {
|
||||
"value": {
|
||||
"type": "array",
|
||||
"minItems": 1,
|
||||
"maxItems": 1,
|
||||
"items": {
|
||||
"type": "object",
|
||||
"required": [
|
||||
"@UI.Hidden",
|
||||
"@client.synchronize",
|
||||
"createdBy",
|
||||
"eTag",
|
||||
"file",
|
||||
"id",
|
||||
"lastModifiedDateTime",
|
||||
"name",
|
||||
"parentReference",
|
||||
"remoteItem"
|
||||
],
|
||||
"properties": {
|
||||
"@UI.Hidden": { "const": false },
|
||||
"@client.synchronize": { "const": false },
|
||||
"createdBy": {
|
||||
"type": "object",
|
||||
"required": ["user"],
|
||||
"properties": {
|
||||
"user": {
|
||||
"type": "object",
|
||||
"required": ["displayName", "id", "@libre.graph.userType"],
|
||||
"properties": {
|
||||
"displayName": { "const": "Alice Hansen" },
|
||||
"id": { "pattern": "^%federated_user_id_pattern%$" },
|
||||
"@libre.graph.userType": { "const": "Federated" }
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"eTag": { "pattern": "%etag_pattern%" },
|
||||
"file": {
|
||||
"type": "object",
|
||||
"required": ["mimeType"],
|
||||
"properties": {
|
||||
"mimeType": { "const": "text/plain" }
|
||||
}
|
||||
},
|
||||
"id": { "pattern": "^%file_id_pattern%$" },
|
||||
"name": { "const": "textfile.txt" },
|
||||
"parentReference": {
|
||||
"type": "object",
|
||||
"required": ["driveId", "driveType", "id"],
|
||||
"properties": {
|
||||
"driveId": { "pattern": "^%space_id_pattern%$" },
|
||||
"driveType": { "const": "virtual" },
|
||||
"id": { "pattern": "^%file_id_pattern%$" }
|
||||
}
|
||||
},
|
||||
"remoteItem": {
|
||||
"type": "object",
|
||||
"required": [
|
||||
"createdBy",
|
||||
"eTag",
|
||||
"file",
|
||||
"id",
|
||||
"lastModifiedDateTime",
|
||||
"name",
|
||||
"permissions"
|
||||
],
|
||||
"properties": {
|
||||
"createdBy": {
|
||||
"type": "object",
|
||||
"required": ["user"],
|
||||
"properties": {
|
||||
"user": {
|
||||
"type": "object",
|
||||
"required": ["id", "displayName", "@libre.graph.userType"],
|
||||
"properties": {
|
||||
"id": { "pattern": "^%federated_user_id_pattern%$" },
|
||||
"displayName": { "const": "Alice Hansen" },
|
||||
"@libre.graph.userType": { "const": "Federated" }
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"eTag": { "pattern": "%etag_pattern%" },
|
||||
"file": {
|
||||
"type": "object",
|
||||
"required": ["mimeType"],
|
||||
"properties": {
|
||||
"mimeType": { "const": "text/plain" }
|
||||
}
|
||||
},
|
||||
"id": { "pattern": "^%federated_file_id_pattern%$" },
|
||||
"name": { "const": "textfile.txt" },
|
||||
"permissions": {
|
||||
"type": "array",
|
||||
"minItems": 1,
|
||||
"maxItems": 1,
|
||||
"items": {
|
||||
"type": "object",
|
||||
"required": [
|
||||
"createdDateTime",
|
||||
"grantedToV2",
|
||||
"id",
|
||||
"invitation",
|
||||
"roles"
|
||||
],
|
||||
"properties": {
|
||||
"grantedToV2": {
|
||||
"type": "object",
|
||||
"required": ["user"],
|
||||
"properties": {
|
||||
"user": {
|
||||
"type": "object",
|
||||
"required": ["displayName", "id", "@libre.graph.userType"],
|
||||
"properties": {
|
||||
"displayName": { "const": "Brian Murphy" },
|
||||
"id": { "pattern": "^%user_id_pattern%$" },
|
||||
"@libre.graph.userType": { "const": "Member" }
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"id": { "pattern": "^%uuidv4_pattern%$" },
|
||||
"invitation": {
|
||||
"type": "object",
|
||||
"required": ["invitedBy"],
|
||||
"properties": {
|
||||
"invitedBy": {
|
||||
"type": "object",
|
||||
"required": ["user"],
|
||||
"properties": {
|
||||
"user": {
|
||||
"type": "object",
|
||||
"required": ["displayName", "id", "@libre.graph.userType"],
|
||||
"properties": {
|
||||
"displayName": { "const": "Alice Hansen" },
|
||||
"id": { "pattern": "^%federated_user_id_pattern%$" },
|
||||
"@libre.graph.userType": { "const": "Federated" }
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"roles": {
|
||||
"type": "array",
|
||||
"minItems": 1,
|
||||
"maxItems": 1,
|
||||
"items": {
|
||||
"pattern": "^%role_id_pattern%$"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -94,13 +369,9 @@ Feature: an user shares resources using ScienceMesh application
|
||||
}
|
||||
}
|
||||
"""
|
||||
Examples:
|
||||
| resource |
|
||||
| folderToShare |
|
||||
| textfile.txt |
|
||||
|
||||
|
||||
Scenario: local user shares resources from project space to federation user
|
||||
Scenario: local user shares a folder from project space to federation user
|
||||
Given using server "LOCAL"
|
||||
And "Alice" has created the federation share invitation
|
||||
And using server "REMOTE"
|
||||
@@ -124,7 +395,7 @@ Feature: an user shares resources using ScienceMesh application
|
||||
"""
|
||||
{
|
||||
"type": "object",
|
||||
"required": [ "value" ],
|
||||
"required": ["value"],
|
||||
"properties": {
|
||||
"value": {
|
||||
"type": "array",
|
||||
@@ -136,121 +407,139 @@ Feature: an user shares resources using ScienceMesh application
|
||||
"@UI.Hidden",
|
||||
"@client.synchronize",
|
||||
"createdBy",
|
||||
"name"
|
||||
"eTag",
|
||||
"folder",
|
||||
"id",
|
||||
"lastModifiedDateTime",
|
||||
"name",
|
||||
"parentReference",
|
||||
"remoteItem"
|
||||
],
|
||||
"properties": {
|
||||
"@UI.Hidden": {
|
||||
"const": false
|
||||
},
|
||||
"@client.synchronize": {
|
||||
"const": false
|
||||
},
|
||||
"@UI.Hidden": { "const": false },
|
||||
"@client.synchronize": { "const": false },
|
||||
"createdBy": {
|
||||
"type": "object",
|
||||
"required": [ "user" ],
|
||||
"required": ["user"],
|
||||
"properties": {
|
||||
"user": {
|
||||
"type": "object",
|
||||
"required": [ "displayName", "id" ],
|
||||
"required": ["displayName", "id", "@libre.graph.userType"],
|
||||
"properties": {
|
||||
"displayName": {
|
||||
"const": "Alice Hansen"
|
||||
},
|
||||
"id": {
|
||||
"type": "string",
|
||||
"pattern": "^%federated_user_id_pattern%$"
|
||||
}
|
||||
"displayName": { "const": "Alice Hansen" },
|
||||
"id": { "pattern": "^%federated_user_id_pattern%$" },
|
||||
"@libre.graph.userType": { "const": "Federated" }
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"name": {
|
||||
"const": "folderToShare"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
"""
|
||||
|
||||
@issue-9534
|
||||
Scenario Outline: federation user shares resource to local user after accepting invitation
|
||||
Given using server "LOCAL"
|
||||
And "Alice" has created the federation share invitation
|
||||
And using server "REMOTE"
|
||||
And "Brian" has accepted invitation
|
||||
And user "Brian" has created folder "folderToShare"
|
||||
And user "Brian" has uploaded file with content "ocm test" to "/textfile.txt"
|
||||
When user "Brian" sends the following resource share invitation to federated user using the Graph API:
|
||||
| resource | <resource> |
|
||||
| space | Personal |
|
||||
| sharee | Alice |
|
||||
| shareType | user |
|
||||
| permissionsRole | Viewer |
|
||||
Then the HTTP status code should be "200"
|
||||
When using server "LOCAL"
|
||||
And user "Alice" lists the shares shared with her without retry using the Graph API
|
||||
Then the HTTP status code should be "200"
|
||||
And the JSON data of the response should match
|
||||
"""
|
||||
{
|
||||
"type": "object",
|
||||
"required": [
|
||||
"value"
|
||||
],
|
||||
"properties": {
|
||||
"value": {
|
||||
"type": "array",
|
||||
"minItems": 1,
|
||||
"maxItems": 1,
|
||||
"items": {
|
||||
"type": "object",
|
||||
"required": [
|
||||
"@UI.Hidden",
|
||||
"@client.synchronize",
|
||||
"createdBy",
|
||||
"name"
|
||||
],
|
||||
"properties": {
|
||||
"@UI.Hidden": {
|
||||
"type": "boolean",
|
||||
"enum": [
|
||||
false
|
||||
]
|
||||
"eTag": { "pattern": "%etag_pattern%" },
|
||||
"folder": { "const": {} },
|
||||
"id": { "pattern": "^%file_id_pattern%$" },
|
||||
"name": { "const": "folderToShare" },
|
||||
"parentReference": {
|
||||
"type": "object",
|
||||
"required": ["driveId", "driveType", "id"],
|
||||
"properties": {
|
||||
"driveId": { "pattern": "^%space_id_pattern%$" },
|
||||
"driveType": { "const": "virtual" },
|
||||
"id": { "pattern": "^%file_id_pattern%$" }
|
||||
}
|
||||
},
|
||||
"@client.synchronize": {
|
||||
"type": "boolean",
|
||||
"enum": [
|
||||
false
|
||||
]
|
||||
},
|
||||
"createdBy": {
|
||||
"remoteItem": {
|
||||
"type": "object",
|
||||
"required": [
|
||||
"user"
|
||||
"createdBy",
|
||||
"eTag",
|
||||
"folder",
|
||||
"id",
|
||||
"lastModifiedDateTime",
|
||||
"name",
|
||||
"permissions"
|
||||
],
|
||||
"properties": {
|
||||
"user": {
|
||||
"createdBy": {
|
||||
"type": "object",
|
||||
"required": [
|
||||
"displayName",
|
||||
"id"
|
||||
],
|
||||
"required": ["user"],
|
||||
"properties": {
|
||||
"displayName": {
|
||||
"const": "Brian Murphy"
|
||||
},
|
||||
"id": {
|
||||
"type": "string",
|
||||
"pattern": "^%federated_user_id_pattern%$"
|
||||
"user": {
|
||||
"type": "object",
|
||||
"required": ["id", "displayName", "@libre.graph.userType"],
|
||||
"properties": {
|
||||
"id": { "pattern": "^%federated_user_id_pattern%$" },
|
||||
"displayName": { "const": "Alice Hansen" },
|
||||
"@libre.graph.userType": { "const": "Federated" }
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"eTag": { "pattern": "%etag_pattern%" },
|
||||
"folder": { "const": {} },
|
||||
"id": { "pattern": "^%federated_file_id_pattern%$" },
|
||||
"name": { "const": "folderToShare" },
|
||||
"permissions": {
|
||||
"type": "array",
|
||||
"minItems": 1,
|
||||
"maxItems": 1,
|
||||
"items": {
|
||||
"type": "object",
|
||||
"required": [
|
||||
"createdDateTime",
|
||||
"grantedToV2",
|
||||
"id",
|
||||
"invitation",
|
||||
"roles"
|
||||
],
|
||||
"properties": {
|
||||
"grantedToV2": {
|
||||
"type": "object",
|
||||
"required": ["user"],
|
||||
"properties": {
|
||||
"user": {
|
||||
"type": "object",
|
||||
"required": ["displayName", "id", "@libre.graph.userType"],
|
||||
"properties": {
|
||||
"displayName": { "const": "Brian Murphy" },
|
||||
"id": { "pattern": "^%user_id_pattern%$" },
|
||||
"@libre.graph.userType": { "const": "Member" }
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"id": { "pattern": "^%uuidv4_pattern%$" },
|
||||
"invitation": {
|
||||
"type": "object",
|
||||
"required": ["invitedBy"],
|
||||
"properties": {
|
||||
"invitedBy": {
|
||||
"type": "object",
|
||||
"required": ["user"],
|
||||
"properties": {
|
||||
"user": {
|
||||
"type": "object",
|
||||
"required": ["displayName", "id", "@libre.graph.userType"],
|
||||
"properties": {
|
||||
"displayName": { "const": "Alice Hansen" },
|
||||
"id": { "pattern": "^%federated_user_id_pattern%$" },
|
||||
"@libre.graph.userType": { "const": "Federated" }
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"roles": {
|
||||
"type": "array",
|
||||
"minItems": 1,
|
||||
"maxItems": 1,
|
||||
"items": {
|
||||
"pattern": "^%role_id_pattern%$"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"name": {
|
||||
"const": "<resource>"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -258,10 +547,6 @@ Feature: an user shares resources using ScienceMesh application
|
||||
}
|
||||
}
|
||||
"""
|
||||
Examples:
|
||||
| resource |
|
||||
| folderToShare |
|
||||
| textfile.txt |
|
||||
|
||||
@issue-10051
|
||||
Scenario Outline: try to add federated user as a member of a project space (permissions endpoint)
|
||||
@@ -399,6 +684,8 @@ Feature: an user shares resources using ScienceMesh application
|
||||
"parentReference",
|
||||
"permissions",
|
||||
"name",
|
||||
"eTag",
|
||||
"file",
|
||||
"size"
|
||||
],
|
||||
"properties": {
|
||||
@@ -489,6 +776,19 @@ Feature: an user shares resources using ScienceMesh application
|
||||
"name": {
|
||||
"const": "textfile.txt"
|
||||
},
|
||||
"eTag": {
|
||||
"type": "string",
|
||||
"pattern": "%etag_pattern%"
|
||||
},
|
||||
"file": {
|
||||
"type": "object",
|
||||
"required": ["mimeType"],
|
||||
"properties": {
|
||||
"mimeType": {
|
||||
"const": "text/plain"
|
||||
}
|
||||
}
|
||||
},
|
||||
"size": {
|
||||
"const": 8
|
||||
}
|
||||
@@ -691,9 +991,7 @@ Feature: an user shares resources using ScienceMesh application
|
||||
},
|
||||
"file": {
|
||||
"type": "object",
|
||||
"required": [
|
||||
"mimeType"
|
||||
],
|
||||
"required": ["mimeType"],
|
||||
"properties": {
|
||||
"mimeType": {
|
||||
"const": "image/jpeg"
|
||||
@@ -715,9 +1013,7 @@ Feature: an user shares resources using ScienceMesh application
|
||||
"properties": {
|
||||
"file": {
|
||||
"type": "object",
|
||||
"required": [
|
||||
"mimeType"
|
||||
],
|
||||
"required": ["mimeType"],
|
||||
"properties": {
|
||||
"mimeType": {
|
||||
"const": "image/jpeg"
|
||||
@@ -816,25 +1112,25 @@ Feature: an user shares resources using ScienceMesh application
|
||||
And for user "Alice" the content of the file "textfile.txt" of the space "Personal" should be "this is a new content"
|
||||
|
||||
@issue-10488
|
||||
Scenario Outline: local user shares a folder copied from an already shared folder to federation user
|
||||
Scenario: local user shares a folder copied from an already shared folder to federation user
|
||||
Given using server "REMOTE"
|
||||
And "Brian" has created the federation share invitation
|
||||
And using server "LOCAL"
|
||||
And "Alice" has accepted invitation
|
||||
And user "Alice" has created folder "folderToShare"
|
||||
And user "Alice" has sent the following resource share invitation to federated user:
|
||||
| resource | folderToShare |
|
||||
| space | Personal |
|
||||
| sharee | Brian |
|
||||
| shareType | user |
|
||||
| permissionsRole | <permissions-role-1> |
|
||||
| resource | folderToShare |
|
||||
| space | Personal |
|
||||
| sharee | Brian |
|
||||
| shareType | user |
|
||||
| permissionsRole | Editor |
|
||||
And user "Alice" has copied folder "folderToShare" to "folderToShareCopy"
|
||||
And user "Alice" has sent the following resource share invitation to federated user:
|
||||
| resource | folderToShareCopy |
|
||||
| space | Personal |
|
||||
| sharee | Brian |
|
||||
| shareType | user |
|
||||
| permissionsRole | <permissions-role-2> |
|
||||
| resource | folderToShareCopy |
|
||||
| space | Personal |
|
||||
| sharee | Brian |
|
||||
| shareType | user |
|
||||
| permissionsRole | Viewer |
|
||||
And using server "REMOTE"
|
||||
When user "Brian" lists the shares shared with him using the Graph API
|
||||
Then the HTTP status code should be "200"
|
||||
@@ -870,6 +1166,21 @@ Feature: an user shares resources using ScienceMesh application
|
||||
"properties": {
|
||||
"name": {
|
||||
"const": "folderToShare"
|
||||
},
|
||||
"remoteItem": {
|
||||
"type": "object",
|
||||
"required": ["permissions"],
|
||||
"properties": {
|
||||
"permissions": {
|
||||
"type": "array",
|
||||
"minItems": 1,
|
||||
"maxItems": 1,
|
||||
"items": {
|
||||
"type": "object",
|
||||
"required": ["@libre.graph.permissions.actions"]
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
@@ -890,6 +1201,25 @@ Feature: an user shares resources using ScienceMesh application
|
||||
"properties": {
|
||||
"name": {
|
||||
"const": "folderToShareCopy"
|
||||
},
|
||||
"remoteItem": {
|
||||
"type": "object",
|
||||
"required": ["permissions"],
|
||||
"properties": {
|
||||
"permissions": {
|
||||
"type": "array",
|
||||
"minItems": 1,
|
||||
"maxItems": 1,
|
||||
"items": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"@libre.graph.permissions.actions": {
|
||||
"type": "null"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -899,14 +1229,3 @@ Feature: an user shares resources using ScienceMesh application
|
||||
}
|
||||
}
|
||||
"""
|
||||
Examples:
|
||||
| permissions-role-1 | permissions-role-2 |
|
||||
| Editor | Viewer |
|
||||
| Editor | Uploader |
|
||||
| Editor | Editor |
|
||||
| Uploader | Editor |
|
||||
| Uploader | Viewer |
|
||||
| Uploader | Uploader |
|
||||
| Viewer | Uploader |
|
||||
| Viewer | Editor |
|
||||
| Viewer | Viewer |
|
||||
@@ -2392,3 +2392,194 @@ Feature: List a sharing permissions
|
||||
}
|
||||
}
|
||||
"""
|
||||
|
||||
@env-config
|
||||
Scenario: user lists permissions of a folder after enabling 'Denied' role
|
||||
Given the administrator has enabled the permissions role "Denied"
|
||||
And user "Alice" has created folder "folder"
|
||||
When user "Alice" gets permissions list for folder "folder" of the space "Personal" using the Graph API
|
||||
Then the HTTP status code should be "200"
|
||||
And the JSON data of the response should match
|
||||
"""
|
||||
{
|
||||
"type": "object",
|
||||
"required": [
|
||||
"@libre.graph.permissions.actions.allowedValues",
|
||||
"@libre.graph.permissions.roles.allowedValues"
|
||||
],
|
||||
"properties": {
|
||||
"@libre.graph.permissions.roles.allowedValues": {
|
||||
"type": "array",
|
||||
"minItems": 4,
|
||||
"maxItems": 4,
|
||||
"uniqueItems": true,
|
||||
"items": {
|
||||
"oneOf": [
|
||||
{
|
||||
"type": "object",
|
||||
"required": [
|
||||
"@libre.graph.weight",
|
||||
"description",
|
||||
"displayName",
|
||||
"id"
|
||||
],
|
||||
"properties": {
|
||||
"@libre.graph.weight": {
|
||||
"const": 1
|
||||
},
|
||||
"description": {
|
||||
"const": "Deny all access."
|
||||
},
|
||||
"displayName": {
|
||||
"const": "Cannot access"
|
||||
},
|
||||
"id": {
|
||||
"const": "63e64e19-8d43-42ec-a738-2b6af2610efa"
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "object",
|
||||
"required": [
|
||||
"@libre.graph.weight",
|
||||
"description",
|
||||
"displayName",
|
||||
"id"
|
||||
],
|
||||
"properties": {
|
||||
"displayName": {
|
||||
"const": "Can view"
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "object",
|
||||
"required": [
|
||||
"@libre.graph.weight",
|
||||
"description",
|
||||
"displayName",
|
||||
"id"
|
||||
],
|
||||
"properties": {
|
||||
"displayName": {
|
||||
"const": "Can upload"
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "object",
|
||||
"required": [
|
||||
"@libre.graph.weight",
|
||||
"description",
|
||||
"displayName",
|
||||
"id"
|
||||
],
|
||||
"properties": {
|
||||
"displayName": {
|
||||
"const": "Can edit"
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
"""
|
||||
|
||||
@env-config
|
||||
Scenario: user lists permissions of a folder inside a space after enabling 'Denied' role
|
||||
Given using spaces DAV path
|
||||
And the administrator has enabled the permissions role "Denied"
|
||||
And the administrator has assigned the role "Space Admin" to user "Alice" using the Graph API
|
||||
And user "Alice" has created a space "new-space" with the default quota using the Graph API
|
||||
And user "Alice" has created a folder "folder" in space "new-space"
|
||||
When user "Alice" gets permissions list for folder "folder" of the space "new-space" using the Graph API
|
||||
Then the HTTP status code should be "200"
|
||||
And the JSON data of the response should match
|
||||
"""
|
||||
{
|
||||
"type": "object",
|
||||
"required": [
|
||||
"@libre.graph.permissions.actions.allowedValues",
|
||||
"@libre.graph.permissions.roles.allowedValues"
|
||||
],
|
||||
"properties": {
|
||||
"@libre.graph.permissions.roles.allowedValues": {
|
||||
"type": "array",
|
||||
"minItems": 4,
|
||||
"maxItems": 4,
|
||||
"uniqueItems": true,
|
||||
"items": {
|
||||
"oneOf": [
|
||||
{
|
||||
"type": "object",
|
||||
"required": [
|
||||
"@libre.graph.weight",
|
||||
"description",
|
||||
"displayName",
|
||||
"id"
|
||||
],
|
||||
"properties": {
|
||||
"@libre.graph.weight": {
|
||||
"const": 1
|
||||
},
|
||||
"description": {
|
||||
"const": "Deny all access."
|
||||
},
|
||||
"displayName": {
|
||||
"const": "Cannot access"
|
||||
},
|
||||
"id": {
|
||||
"const": "63e64e19-8d43-42ec-a738-2b6af2610efa"
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "object",
|
||||
"required": [
|
||||
"@libre.graph.weight",
|
||||
"description",
|
||||
"displayName",
|
||||
"id"
|
||||
],
|
||||
"properties": {
|
||||
"displayName": {
|
||||
"const": "Can view"
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "object",
|
||||
"required": [
|
||||
"@libre.graph.weight",
|
||||
"description",
|
||||
"displayName",
|
||||
"id"
|
||||
],
|
||||
"properties": {
|
||||
"displayName": {
|
||||
"const": "Can upload"
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "object",
|
||||
"required": [
|
||||
"@libre.graph.weight",
|
||||
"description",
|
||||
"displayName",
|
||||
"id"
|
||||
],
|
||||
"properties": {
|
||||
"displayName": {
|
||||
"const": "Can edit"
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
"""
|
||||
@@ -123,18 +123,25 @@ Feature: propfind a shares
|
||||
When user "Brian" sends PROPFIND request from the space "Shares" to the resource "/" using the WebDAV API
|
||||
Then the HTTP status code should be "207"
|
||||
And as user "Brian" the PROPFIND response should contain a resource "folderToShare" with these key and value pairs:
|
||||
| key | value |
|
||||
| oc:fileid | <pattern> |
|
||||
| key | value |
|
||||
| oc:fileid | <pattern> |
|
||||
| oc:file-parent | %self::oc:spaceid%!%uuidv4_pattern% |
|
||||
When user "Brian" sends PROPFIND request from the space "Shares" to the resource "folderToShare" using the WebDAV API
|
||||
Then the HTTP status code should be "207"
|
||||
And as user "Brian" the PROPFIND response should contain a resource "folderToShare" with these key and value pairs:
|
||||
| key | value |
|
||||
| oc:fileid | <pattern> |
|
||||
| key | value |
|
||||
| oc:fileid | <pattern> |
|
||||
| oc:file-parent | %self::oc:spaceid%!%uuidv4_pattern% |
|
||||
And as user "Brian" the PROPFIND response should contain a resource "folderToShare/textfile.txt" with these key and value pairs:
|
||||
| key | value |
|
||||
| oc:fileid | %file_id_pattern% |
|
||||
| oc:file-parent | %self::oc:spaceid%!%uuidv4_pattern% |
|
||||
When user "Brian" sends PROPFIND request from the space "Shares" to the resource "folderToShare/textfile.txt" using the WebDAV API
|
||||
Then the HTTP status code should be "207"
|
||||
And as user "Brian" the PROPFIND response should contain a resource "folderToShare/textfile.txt" with these key and value pairs:
|
||||
| key | value |
|
||||
| oc:fileid | %file_id_pattern% |
|
||||
| key | value |
|
||||
| oc:fileid | %file_id_pattern% |
|
||||
| oc:file-parent | %self::oc:spaceid%!%uuidv4_pattern% |
|
||||
Examples:
|
||||
| dav-path-version | pattern |
|
||||
| old | %file_id_pattern% |
|
||||
|
||||
@@ -20,7 +20,7 @@ Feature: State of the quota
|
||||
|
||||
|
||||
Scenario Outline: quota information is returned in the list of spaces returned via the Graph API
|
||||
Given user "Alice" has created a space "<space-name>" of type "project" with quota "100"
|
||||
Given user "Alice" has created a space "<space-name>" of type "project" with quota "<quota>"
|
||||
When user "Alice" uploads a file inside space "<space-name>" with content "<file-content>" to "test.txt" using the WebDAV API
|
||||
And user "Alice" lists all available spaces via the Graph API
|
||||
Then the JSON response should contain space called "<space-name>" and match
|
||||
@@ -51,7 +51,7 @@ Feature: State of the quota
|
||||
},
|
||||
"total" : {
|
||||
"type": "number",
|
||||
"enum": [100]
|
||||
"enum": [<quota>]
|
||||
},
|
||||
"remaining" : {
|
||||
"type": "number",
|
||||
@@ -67,14 +67,15 @@ Feature: State of the quota
|
||||
}
|
||||
"""
|
||||
Examples:
|
||||
| space-name | file-content | state | remaining | used |
|
||||
| Quota1% | 1 | normal | 99 | 1 |
|
||||
| Quota75% | 123456789 123456789 123456789 123456789 123456789 123456789 123456789 12345 | normal | 25 | 75 |
|
||||
| Quota76% | 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456 | nearing | 24 | 76 |
|
||||
| Quota90% | 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 1234567890 | nearing | 10 | 90 |
|
||||
| Quota91% | 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 1 | critical | 9 | 91 |
|
||||
| Quota99% | 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 | critical | 1 | 99 |
|
||||
| Quota100% | 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 1234567890 | exceeded | 0 | 100 |
|
||||
| space-name | file-content | state | remaining | used | quota |
|
||||
| Quota1% | 1 | normal | 99 | 1 | 100 |
|
||||
| Quota75% | 123456789 123456789 123456789 123456789 123456789 123456789 123456789 12345 | normal | 25 | 75 | 100 |
|
||||
| Quota76% | 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456 | nearing | 24 | 76 | 100 |
|
||||
| Quota90% | 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 1234567890 | nearing | 10 | 90 | 100 |
|
||||
| Quota91% | 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 1 | critical | 9 | 91 | 100 |
|
||||
| Quota99% | 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 | critical | 1 | 99 | 100 |
|
||||
| Quota100% | 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 1234567890 | exceeded | 0 | 100 | 100 |
|
||||
| Quota1 | 0 | normal | 2499999999999 | 1 | 2500000000000 |
|
||||
|
||||
|
||||
Scenario: file cannot be uploaded if there is insufficient quota
|
||||
|
||||
@@ -20,13 +20,10 @@ Feature: dav-versions
|
||||
| spaces |
|
||||
|
||||
|
||||
Scenario Outline: upload file and no version is available using various chunking methods (except new chunking)
|
||||
Scenario Outline: no version is available while uploading a file with multiple chunks
|
||||
Given using <dav-path-version> DAV path
|
||||
When user "Alice" uploads file "filesForUpload/davtest.txt" to filenames based on "/davtest.txt" with all mechanisms except new chunking using the WebDAV API
|
||||
Then the HTTP status code of all upload responses should be "201"
|
||||
And the version folder of file "/davtest.txt-olddav-regular" for user "Alice" should contain "0" elements
|
||||
And the version folder of file "/davtest.txt-newdav-regular" for user "Alice" should contain "0" elements
|
||||
And the version folder of file "/davtest.txt-olddav-oldchunking" for user "Alice" should contain "0" elements
|
||||
When user "Alice" uploads file "filesForUpload/davtest.txt" to "lorem.txt" in 2 chunks using the WebDAV API
|
||||
Then the version folder of file "lorem.txt" for user "Alice" should contain "0" elements
|
||||
Examples:
|
||||
| dav-path-version |
|
||||
| old |
|
||||
@@ -48,14 +45,12 @@ Feature: dav-versions
|
||||
| spaces |
|
||||
|
||||
|
||||
Scenario Outline: upload a file twice and versions are available using various chunking methods (except new chunking)
|
||||
Scenario Outline: versions are available while uploading a file twice with multiple chunks
|
||||
Given using <dav-path-version> DAV path
|
||||
When user "Alice" uploads file "filesForUpload/davtest.txt" to filenames based on "/davtest.txt" with all mechanisms except new chunking using the WebDAV API
|
||||
And user "Alice" uploads file "filesForUpload/davtest.txt" to filenames based on "/davtest.txt" with all mechanisms except new chunking using the WebDAV API
|
||||
Then the HTTP status code of all upload responses should be between "201" and "204"
|
||||
And the version folder of file "/davtest.txt-olddav-regular" for user "Alice" should contain "1" element
|
||||
And the version folder of file "/davtest.txt-newdav-regular" for user "Alice" should contain "1" element
|
||||
And the version folder of file "/davtest.txt-olddav-oldchunking" for user "Alice" should contain "1" element
|
||||
When user "Alice" uploads file "filesForUpload/davtest.txt" to "lorem.txt" in 2 chunks using the WebDAV API
|
||||
And user "Alice" uploads file "filesForUpload/davtest.txt" to "lorem.txt" in 3 chunks using the WebDAV API
|
||||
Then the HTTP status code of responses on all endpoints should be "201"
|
||||
And the version folder of file "lorem.txt" for user "Alice" should contain "1" element
|
||||
Examples:
|
||||
| dav-path-version |
|
||||
| old |
|
||||
|
||||
@@ -165,7 +165,7 @@ Feature: create files and folder
|
||||
| spaces | "'single'.txt" |
|
||||
| spaces | '"double".txt' |
|
||||
|
||||
@issue-10339
|
||||
@issue-10339 @issue-9568
|
||||
Scenario Outline: try to create file with '.', '..' and 'empty'
|
||||
Given using <dav-path-version> DAV path
|
||||
When user "Alice" uploads file with content "some text" to "<file-name>" using the WebDAV API
|
||||
@@ -185,7 +185,7 @@ Feature: create files and folder
|
||||
| spaces | /../lorem | 400 |
|
||||
| spaces | | 400 |
|
||||
|
||||
@issue-10339
|
||||
@issue-10339 @issue-9568
|
||||
Scenario Outline: try to create folder with '.', '..' and 'empty'
|
||||
Given using <dav-path-version> DAV path
|
||||
When user "Alice" creates folder "<folder-name>" using the WebDAV API
|
||||
|
||||
Generated
Vendored
+21
@@ -23,6 +23,7 @@ import (
|
||||
|
||||
group "github.com/cs3org/go-cs3apis/cs3/identity/group/v1beta1"
|
||||
user "github.com/cs3org/go-cs3apis/cs3/identity/user/v1beta1"
|
||||
ocmcore "github.com/cs3org/go-cs3apis/cs3/ocm/core/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"
|
||||
@@ -191,6 +192,26 @@ func LinkRemoved(r *link.RemovePublicShareResponse, req *link.RemovePublicShareR
|
||||
}
|
||||
}
|
||||
|
||||
func OCMCoreShareCreated(r *ocmcore.CreateOCMCoreShareResponse, req *ocmcore.CreateOCMCoreShareRequest, executant *user.User) events.OCMCoreShareCreated {
|
||||
var permissions *provider.ResourcePermissions
|
||||
for _, p := range req.GetProtocols() {
|
||||
if p.GetWebdavOptions() != nil {
|
||||
permissions = p.GetWebdavOptions().GetPermissions().GetPermissions()
|
||||
break
|
||||
}
|
||||
}
|
||||
return events.OCMCoreShareCreated{
|
||||
ShareID: r.GetId(),
|
||||
Executant: executant.GetId(),
|
||||
Sharer: req.GetSender(),
|
||||
GranteeUserID: req.GetShareWith(),
|
||||
ItemID: req.GetResourceId(),
|
||||
ResourceName: req.GetName(),
|
||||
CTime: r.GetCreated(),
|
||||
Permissions: permissions,
|
||||
}
|
||||
}
|
||||
|
||||
// FileTouched converts the response to an event
|
||||
func FileTouched(r *provider.TouchFileResponse, req *provider.TouchFileRequest, spaceOwner *user.UserId, executant *user.User) events.FileTouched {
|
||||
return events.FileTouched{
|
||||
|
||||
Generated
Vendored
+5
@@ -23,6 +23,7 @@ import (
|
||||
"fmt"
|
||||
|
||||
user "github.com/cs3org/go-cs3apis/cs3/identity/user/v1beta1"
|
||||
ocmcore "github.com/cs3org/go-cs3apis/cs3/ocm/core/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"
|
||||
@@ -112,6 +113,10 @@ func NewUnary(m map[string]interface{}) (grpc.UnaryServerInterceptor, int, error
|
||||
} else {
|
||||
ev = LinkAccessFailed(v, req.(*link.GetPublicShareByTokenRequest), executant)
|
||||
}
|
||||
case *ocmcore.CreateOCMCoreShareResponse:
|
||||
if isSuccess(v) {
|
||||
ev = OCMCoreShareCreated(v, req.(*ocmcore.CreateOCMCoreShareRequest), executant)
|
||||
}
|
||||
case *provider.AddGrantResponse:
|
||||
// TODO: update CS3 APIs
|
||||
// FIXME these should be part of the RemoveGrantRequest object
|
||||
|
||||
Generated
Vendored
+26
@@ -85,11 +85,37 @@ func (s *svc) RemoveOCMShare(ctx context.Context, req *ocm.RemoveOCMShareRequest
|
||||
}, nil
|
||||
}
|
||||
|
||||
getShareRes, err := c.GetOCMShare(ctx, &ocm.GetOCMShareRequest{
|
||||
Ref: req.Ref,
|
||||
})
|
||||
if err != nil {
|
||||
return nil, errors.Wrap(err, "gateway: error calling GetOCMShare")
|
||||
}
|
||||
if getShareRes.Status.Code != rpc.Code_CODE_OK {
|
||||
res := &ocm.RemoveOCMShareResponse{
|
||||
Status: status.NewInternal(ctx,
|
||||
"error getting ocm share when committing to the storage"),
|
||||
}
|
||||
return res, nil
|
||||
}
|
||||
share := getShareRes.Share
|
||||
|
||||
res, err := c.RemoveOCMShare(ctx, req)
|
||||
if err != nil {
|
||||
return nil, errors.Wrap(err, "gateway: error calling RemoveOCMShare")
|
||||
}
|
||||
|
||||
// remove the grant from the storage provider
|
||||
status, err := s.removeGrant(ctx, share.GetResourceId(), share.GetGrantee(), share.GetAccessMethods()[0].GetWebdavOptions().GetPermissions(), nil)
|
||||
if err != nil {
|
||||
return nil, errors.Wrap(err, "gateway: error removing grant from storage")
|
||||
}
|
||||
if status.Code != rpc.Code_CODE_OK {
|
||||
return &ocm.RemoveOCMShareResponse{
|
||||
Status: status,
|
||||
}, err
|
||||
}
|
||||
|
||||
return res, nil
|
||||
}
|
||||
|
||||
|
||||
+46
@@ -0,0 +1,46 @@
|
||||
// Copyright 2018-2024 CERN
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
//
|
||||
// In applying this license, CERN does not waive the privileges and immunities
|
||||
// granted to it by virtue of its status as an Intergovernmental Organization
|
||||
// or submit itself to any jurisdiction.
|
||||
|
||||
package events
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
|
||||
user "github.com/cs3org/go-cs3apis/cs3/identity/user/v1beta1"
|
||||
provider "github.com/cs3org/go-cs3apis/cs3/storage/provider/v1beta1"
|
||||
types "github.com/cs3org/go-cs3apis/cs3/types/v1beta1"
|
||||
)
|
||||
|
||||
// OCMCoreShareCreated is emitted when an ocm share is received
|
||||
type OCMCoreShareCreated struct {
|
||||
ShareID string
|
||||
Executant *user.UserId
|
||||
Sharer *user.UserId
|
||||
GranteeUserID *user.UserId
|
||||
ItemID string
|
||||
ResourceName string
|
||||
Permissions *provider.ResourcePermissions
|
||||
CTime *types.Timestamp
|
||||
}
|
||||
|
||||
// Unmarshal to fulfill umarshaller interface
|
||||
func (OCMCoreShareCreated) Unmarshal(v []byte) (interface{}, error) {
|
||||
e := OCMCoreShareCreated{}
|
||||
err := json.Unmarshal(v, &e)
|
||||
return e, err
|
||||
}
|
||||
+2
-2
@@ -91,7 +91,7 @@ func parseLevel(v string) zerolog.Level {
|
||||
|
||||
func InitLoggerOrDie(v interface{}, logLevel string) *zerolog.Logger {
|
||||
conf := ParseLogConfOrDie(v, logLevel)
|
||||
log, err := FromConfig(conf)
|
||||
log, err := fromConfig(conf)
|
||||
if err != nil {
|
||||
fmt.Fprintf(os.Stderr, "error creating logger, exiting ...")
|
||||
os.Exit(1)
|
||||
@@ -125,7 +125,7 @@ type LogConf struct {
|
||||
Level string `mapstructure:"level"`
|
||||
}
|
||||
|
||||
func FromConfig(conf *LogConf) (*zerolog.Logger, error) {
|
||||
func fromConfig(conf *LogConf) (*zerolog.Logger, error) {
|
||||
if conf.Level == "" {
|
||||
conf.Level = zerolog.DebugLevel.String()
|
||||
}
|
||||
|
||||
+2
-3
@@ -33,7 +33,6 @@ import (
|
||||
|
||||
gateway "github.com/cs3org/go-cs3apis/cs3/gateway/v1beta1"
|
||||
userpb "github.com/cs3org/go-cs3apis/cs3/identity/user/v1beta1"
|
||||
userv1beta1 "github.com/cs3org/go-cs3apis/cs3/identity/user/v1beta1"
|
||||
rpc "github.com/cs3org/go-cs3apis/cs3/rpc/v1beta1"
|
||||
ocmpb "github.com/cs3org/go-cs3apis/cs3/sharing/ocm/v1beta1"
|
||||
provider "github.com/cs3org/go-cs3apis/cs3/storage/provider/v1beta1"
|
||||
@@ -539,7 +538,7 @@ func (d *driver) ListStorageSpaces(ctx context.Context, filters []*provider.List
|
||||
OpaqueId: storagespace.FormatResourceID(root),
|
||||
},
|
||||
SpaceType: "mountpoint",
|
||||
Owner: &userv1beta1.User{
|
||||
Owner: &userpb.User{
|
||||
Id: share.Grantee.GetUserId(),
|
||||
},
|
||||
Root: root,
|
||||
@@ -558,7 +557,7 @@ func (d *driver) ListStorageSpaces(ctx context.Context, filters []*provider.List
|
||||
OpaqueId: storagespace.FormatResourceID(root),
|
||||
},
|
||||
SpaceType: "mountpoint",
|
||||
Owner: &userv1beta1.User{
|
||||
Owner: &userpb.User{
|
||||
Id: share.Grantee.GetUserId(),
|
||||
},
|
||||
Root: root,
|
||||
|
||||
+1
-1
@@ -108,7 +108,7 @@ func New(lu node.PathLookup, bs Blobstore, um usermapper.Mapper, trashbin *trash
|
||||
trashbin: trashbin,
|
||||
options: o,
|
||||
idCache: cache,
|
||||
propagator: propagator.New(lu, &o.Options),
|
||||
propagator: propagator.New(lu, &o.Options, log),
|
||||
scanQueue: scanQueue,
|
||||
scanDebouncer: NewScanDebouncer(o.ScanDebounceDelay, func(item scanItem) {
|
||||
scanQueue <- item
|
||||
|
||||
-4
@@ -215,10 +215,6 @@ func FromGrant(g *provider.Grant) *ACE {
|
||||
}
|
||||
|
||||
func UserAce(id *userpb.UserId) string {
|
||||
if id.GetType() == userpb.UserType_USER_TYPE_FEDERATED {
|
||||
return "u:" + id.OpaqueId + "@" + id.Idp
|
||||
}
|
||||
|
||||
return "u:" + id.OpaqueId
|
||||
}
|
||||
|
||||
|
||||
+10
-2
@@ -132,6 +132,10 @@ type Decomposedfs struct {
|
||||
|
||||
// NewDefault returns an instance with default components
|
||||
func NewDefault(m map[string]interface{}, bs tree.Blobstore, es events.Stream, log *zerolog.Logger) (storage.FS, error) {
|
||||
if log == nil {
|
||||
log = &zerolog.Logger{}
|
||||
}
|
||||
|
||||
o, err := options.New(m)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
@@ -156,7 +160,7 @@ func NewDefault(m map[string]interface{}, bs tree.Blobstore, es events.Stream, l
|
||||
microstore.Table(o.IDCache.Table),
|
||||
store.DisablePersistence(o.IDCache.DisablePersistence),
|
||||
store.Authentication(o.IDCache.AuthUsername, o.IDCache.AuthPassword),
|
||||
))
|
||||
), log)
|
||||
|
||||
permissionsSelector, err := pool.PermissionsSelector(o.PermissionsSVC, pool.WithTLSMode(o.PermTLSMode))
|
||||
if err != nil {
|
||||
@@ -178,6 +182,10 @@ func NewDefault(m map[string]interface{}, bs tree.Blobstore, es events.Stream, l
|
||||
// New returns an implementation of the storage.FS interface that talks to
|
||||
// a local filesystem.
|
||||
func New(o *options.Options, aspects aspects.Aspects, log *zerolog.Logger) (storage.FS, error) {
|
||||
if log == nil {
|
||||
log = &zerolog.Logger{}
|
||||
}
|
||||
|
||||
err := aspects.Tree.Setup()
|
||||
if err != nil {
|
||||
log.Error().Err(err).Msg("could not setup tree")
|
||||
@@ -238,7 +246,7 @@ func New(o *options.Options, aspects aspects.Aspects, log *zerolog.Logger) (stor
|
||||
spaceTypeIndex: spaceTypeIndex,
|
||||
log: log,
|
||||
}
|
||||
fs.sessionStore = upload.NewSessionStore(fs, aspects, o.Root, o.AsyncFileUploads, o.Tokens)
|
||||
fs.sessionStore = upload.NewSessionStore(fs, aspects, o.Root, o.AsyncFileUploads, o.Tokens, log)
|
||||
if err = fs.trashbin.Setup(fs); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
Generated
Vendored
+3
-4
@@ -27,7 +27,6 @@ import (
|
||||
"time"
|
||||
|
||||
"github.com/cs3org/reva/v2/pkg/appctx"
|
||||
"github.com/cs3org/reva/v2/pkg/logger"
|
||||
"github.com/cs3org/reva/v2/pkg/storage/utils/decomposedfs/lookup"
|
||||
"github.com/cs3org/reva/v2/pkg/storage/utils/decomposedfs/metadata"
|
||||
"github.com/cs3org/reva/v2/pkg/storage/utils/decomposedfs/metadata/prefixes"
|
||||
@@ -49,6 +48,7 @@ type AsyncPropagator struct {
|
||||
treeTimeAccounting bool
|
||||
propagationDelay time.Duration
|
||||
lookup node.PathLookup
|
||||
log *zerolog.Logger
|
||||
}
|
||||
|
||||
// Change represents a change to the tree
|
||||
@@ -58,16 +58,15 @@ type Change struct {
|
||||
}
|
||||
|
||||
// NewAsyncPropagator returns a new AsyncPropagator instance
|
||||
func NewAsyncPropagator(treeSizeAccounting, treeTimeAccounting bool, o options.AsyncPropagatorOptions, lookup node.PathLookup) AsyncPropagator {
|
||||
func NewAsyncPropagator(treeSizeAccounting, treeTimeAccounting bool, o options.AsyncPropagatorOptions, lookup node.PathLookup, log *zerolog.Logger) AsyncPropagator {
|
||||
p := AsyncPropagator{
|
||||
treeSizeAccounting: treeSizeAccounting,
|
||||
treeTimeAccounting: treeTimeAccounting,
|
||||
propagationDelay: o.PropagationDelay,
|
||||
lookup: lookup,
|
||||
log: log,
|
||||
}
|
||||
|
||||
log := logger.New()
|
||||
|
||||
log.Info().Msg("async propagator starting up...")
|
||||
|
||||
// spawn a goroutine that watches for stale .processing dirs and fixes them
|
||||
|
||||
Generated
Vendored
+3
-2
@@ -30,6 +30,7 @@ import (
|
||||
"github.com/cs3org/reva/v2/pkg/storage/utils/decomposedfs/node"
|
||||
"github.com/cs3org/reva/v2/pkg/storage/utils/decomposedfs/options"
|
||||
"github.com/pkg/errors"
|
||||
"github.com/rs/zerolog"
|
||||
"go.opentelemetry.io/otel"
|
||||
"go.opentelemetry.io/otel/trace"
|
||||
)
|
||||
@@ -44,10 +45,10 @@ type Propagator interface {
|
||||
Propagate(ctx context.Context, node *node.Node, sizediff int64) error
|
||||
}
|
||||
|
||||
func New(lookup node.PathLookup, o *options.Options) Propagator {
|
||||
func New(lookup node.PathLookup, o *options.Options, log *zerolog.Logger) Propagator {
|
||||
switch o.Propagator {
|
||||
case "async":
|
||||
return NewAsyncPropagator(o.TreeSizeAccounting, o.TreeTimeAccounting, o.AsyncPropagatorOptions, lookup)
|
||||
return NewAsyncPropagator(o.TreeSizeAccounting, o.TreeTimeAccounting, o.AsyncPropagatorOptions, lookup, log)
|
||||
default:
|
||||
return NewSyncPropagator(o.TreeSizeAccounting, o.TreeTimeAccounting, lookup)
|
||||
}
|
||||
|
||||
+3
-2
@@ -42,6 +42,7 @@ import (
|
||||
"github.com/cs3org/reva/v2/pkg/utils"
|
||||
"github.com/google/uuid"
|
||||
"github.com/pkg/errors"
|
||||
"github.com/rs/zerolog"
|
||||
"go-micro.dev/v4/store"
|
||||
"go.opentelemetry.io/otel"
|
||||
"go.opentelemetry.io/otel/trace"
|
||||
@@ -76,13 +77,13 @@ type Tree struct {
|
||||
type PermissionCheckFunc func(rp *provider.ResourcePermissions) bool
|
||||
|
||||
// New returns a new instance of Tree
|
||||
func New(lu node.PathLookup, bs Blobstore, o *options.Options, cache store.Store) *Tree {
|
||||
func New(lu node.PathLookup, bs Blobstore, o *options.Options, cache store.Store, log *zerolog.Logger) *Tree {
|
||||
return &Tree{
|
||||
lookup: lu,
|
||||
blobstore: bs,
|
||||
options: o,
|
||||
idCache: cache,
|
||||
propagator: propagator.New(lu, o),
|
||||
propagator: propagator.New(lu, o, log),
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Generated
Vendored
+1
-21
@@ -27,7 +27,6 @@ import (
|
||||
"time"
|
||||
|
||||
"github.com/google/renameio/v2"
|
||||
"github.com/rogpeppe/go-internal/lockedfile"
|
||||
tusd "github.com/tus/tusd/v2/pkg/handler"
|
||||
|
||||
userpb "github.com/cs3org/go-cs3apis/cs3/identity/user/v1beta1"
|
||||
@@ -35,7 +34,6 @@ import (
|
||||
typespb "github.com/cs3org/go-cs3apis/cs3/types/v1beta1"
|
||||
"github.com/cs3org/reva/v2/pkg/appctx"
|
||||
ctxpkg "github.com/cs3org/reva/v2/pkg/ctx"
|
||||
"github.com/cs3org/reva/v2/pkg/logger"
|
||||
"github.com/cs3org/reva/v2/pkg/storage/utils/decomposedfs/node"
|
||||
"github.com/cs3org/reva/v2/pkg/utils"
|
||||
)
|
||||
@@ -49,12 +47,7 @@ type OcisSession struct {
|
||||
|
||||
// Context returns a context with the user, logger and lockid used when initiating the upload session
|
||||
func (s *OcisSession) Context(ctx context.Context) context.Context { // restore logger from file info
|
||||
log, _ := logger.FromConfig(&logger.LogConf{
|
||||
Output: "stderr", // TODO use config from decomposedfs
|
||||
Mode: "json", // TODO use config from decomposedfs
|
||||
Level: s.info.Storage["LogLevel"],
|
||||
})
|
||||
sub := log.With().Int("pid", os.Getpid()).Logger()
|
||||
sub := s.store.log.With().Int("pid", os.Getpid()).Logger()
|
||||
ctx = appctx.WithLogger(ctx, &sub)
|
||||
ctx = ctxpkg.ContextSetLockID(ctx, s.lockID())
|
||||
ctx = ctxpkg.ContextSetUser(ctx, s.executantUser())
|
||||
@@ -84,14 +77,6 @@ func (s *OcisSession) Purge(ctx context.Context) error {
|
||||
_, span := tracer.Start(ctx, "Purge")
|
||||
defer span.End()
|
||||
sessionPath := sessionPath(s.store.root, s.info.ID)
|
||||
f, err := lockedfile.OpenFile(sessionPath+".lock", os.O_RDWR|os.O_TRUNC|os.O_CREATE, 0600)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
defer func() {
|
||||
f.Close()
|
||||
os.Remove(sessionPath + ".lock")
|
||||
}()
|
||||
if err := os.Remove(sessionPath); err != nil {
|
||||
return err
|
||||
}
|
||||
@@ -127,11 +112,6 @@ func (s *OcisSession) Persist(ctx context.Context) error {
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
f, err := lockedfile.OpenFile(sessionPath+".lock", os.O_RDWR|os.O_TRUNC|os.O_CREATE, 0600)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
defer f.Close()
|
||||
return renameio.WriteFile(sessionPath, d, 0600)
|
||||
}
|
||||
|
||||
|
||||
+10
-11
@@ -28,6 +28,7 @@ import (
|
||||
"regexp"
|
||||
"strconv"
|
||||
"strings"
|
||||
"syscall"
|
||||
"time"
|
||||
|
||||
provider "github.com/cs3org/go-cs3apis/cs3/storage/provider/v1beta1"
|
||||
@@ -44,6 +45,7 @@ import (
|
||||
"github.com/google/uuid"
|
||||
"github.com/pkg/errors"
|
||||
"github.com/rogpeppe/go-internal/lockedfile"
|
||||
"github.com/rs/zerolog"
|
||||
tusd "github.com/tus/tusd/v2/pkg/handler"
|
||||
)
|
||||
|
||||
@@ -65,10 +67,11 @@ type OcisStore struct {
|
||||
async bool
|
||||
tknopts options.TokenOptions
|
||||
disableVersioning bool
|
||||
log *zerolog.Logger
|
||||
}
|
||||
|
||||
// NewSessionStore returns a new OcisStore
|
||||
func NewSessionStore(fs storage.FS, aspects aspects.Aspects, root string, async bool, tknopts options.TokenOptions) *OcisStore {
|
||||
func NewSessionStore(fs storage.FS, aspects aspects.Aspects, root string, async bool, tknopts options.TokenOptions, log *zerolog.Logger) *OcisStore {
|
||||
return &OcisStore{
|
||||
fs: fs,
|
||||
lu: aspects.Lookup,
|
||||
@@ -79,6 +82,7 @@ func NewSessionStore(fs storage.FS, aspects aspects.Aspects, root string, async
|
||||
tknopts: tknopts,
|
||||
disableVersioning: aspects.DisableVersioning,
|
||||
um: aspects.UserMapper,
|
||||
log: log,
|
||||
}
|
||||
}
|
||||
|
||||
@@ -129,24 +133,19 @@ func (store OcisStore) Get(ctx context.Context, id string) (*OcisSession, error)
|
||||
store: store,
|
||||
info: tusd.FileInfo{},
|
||||
}
|
||||
lock, err := lockedfile.Open(sessionPath + ".lock")
|
||||
if err != nil {
|
||||
if errors.Is(err, iofs.ErrNotExist) {
|
||||
// Interpret os.ErrNotExist as 404 Not Found
|
||||
err = tusd.ErrNotFound
|
||||
}
|
||||
return nil, err
|
||||
}
|
||||
defer lock.Close()
|
||||
data, err := os.ReadFile(sessionPath)
|
||||
if err != nil {
|
||||
// handle stale NFS file handles that can occur when the file is deleted betwenn the ATTR and FOPEN call of os.ReadFile
|
||||
if pathErr, ok := err.(*os.PathError); ok && pathErr.Err == syscall.ESTALE {
|
||||
appctx.GetLogger(ctx).Info().Str("session", id).Err(err).Msg("treating stale file handle as not found")
|
||||
err = tusd.ErrNotFound
|
||||
}
|
||||
if errors.Is(err, iofs.ErrNotExist) {
|
||||
// Interpret os.ErrNotExist as 404 Not Found
|
||||
err = tusd.ErrNotFound
|
||||
}
|
||||
return nil, err
|
||||
}
|
||||
lock.Close() // release lock asap
|
||||
|
||||
if err := json.Unmarshal(data, &session.info); err != nil {
|
||||
return nil, err
|
||||
|
||||
Vendored
+1
-1
@@ -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.26.8
|
||||
# github.com/cs3org/reva/v2 v2.27.0
|
||||
## explicit; go 1.22.0
|
||||
github.com/cs3org/reva/v2/cmd/revad/internal/grace
|
||||
github.com/cs3org/reva/v2/cmd/revad/runtime
|
||||
|
||||
Reference in new issue
Block a user