Compare commits

...
58 Commits
Author SHA1 Message Date
Michael Barz 1fa8c264f8 prepare changelog, bump version 2023-09-28 13:37:47 +02:00
Jörn Friedrich Dreyer c48b7e44ae Automated changelog update [skip ci] 2023-09-28 09:03:25 +00:00
Jörn Friedrich Dreyer 0fb8299e3d add reva bump changelog (#7379)
Signed-off-by: Jörn Friedrich Dreyer <jfd@butonic.de>
2023-09-28 11:02:51 +02:00
Michael Barz fbd3c5e7e6 Automated changelog update [skip ci] 2023-09-27 16:57:42 +00:00
Michael Barz bdc27766c8 Merge pull request #7374 from rhafer/backport/4.0/7351
[Backport/4.0] graph/education: Check school number for duplicates before adding a school
2023-09-27 18:54:42 +02:00
Jörn Friedrich Dreyer 5b62ed2882 bump reva to 2.16.1 (#7350)
Signed-off-by: Jörn Friedrich Dreyer <jfd@butonic.de>
2023-09-27 17:16:45 +02:00
Ralf Haferkamp 3141f4f659 graph/education: Fix issues reported by sonarcloud
(cherry picked from commit 4465c9385d)
2023-09-27 15:49:15 +02:00
Ralf Haferkamp 9a9dba7ca7 graph/education: slightly improve error handling and logging
- Use var for common errors
- Add the addition error message to the Error() output of errorcode.Error
- in PatchEducationSchool() use errorcode.RenderError() to turn the errorcode
  in to the right HTTP Status (instead of return 500 always)

(cherry picked from commit a34d467285)
2023-09-27 15:45:36 +02:00
Ralf Haferkamp cc5b0ee002 graph/education: Check school number for duplicates before adding a school
(cherry picked from commit 4f59de9c52)
2023-09-27 15:45:36 +02:00
Ralf Haferkamp 8f91c67603 graph/education: Add getSchoolByNumber helper
Sometimes we explicit need to lookup by number and not numberOrID

(cherry picked from commit e2849bf19d)
2023-09-27 15:45:36 +02:00
Ralf Haferkamp 852b8e07ec graph/education: Remove unreachable code
An LDAP Modify operation never returns LDAPResultEntryAlreadyExists errors.
That error can only happen for LDAPAdd or LDAPModifyDN.

(cherry picked from commit ce808eaa17)
2023-09-27 15:45:36 +02:00
Ralf Haferkamp 4d9d40e1ba graph/education: Use helper for creating attribute list
(cherry picked from commit 16debe6fa5)
2023-09-27 15:45:36 +02:00
Ralf Haferkamp b6ddfcccfb graph/education: Don't leak LDAP errors into the graph error message
(cherry picked from commit 164edd16c0)
2023-09-27 15:45:36 +02:00
Sagar Gurung 03926e6182 [tests-only][full-ci]Backport propfind by fileid (#7365)
* Added test for the propfind with file id

* Refactor the scenario title description

* Review address- refactor scenarios
2023-09-27 14:42:57 +05:45
Sagar Gurung 93521e5f55 Added test for the copy with file-id in url (#7364) 2023-09-27 12:30:04 +05:45
Karun Atreya cc794abb38 refactor given when then steps in settings and tus contexts (#7357)
set resource location from response

addressed the reviews

reset  spaceidfromocis

reset after scenario using after hook
2023-09-27 12:29:56 +05:45
Michael Barz 5ca6a98087 Automated changelog update [skip ci] 2023-09-25 12:32:03 +00:00
Michael Barz 02c31e2dab Merge pull request #7336 from aduffeck/backport-jsoncs3-rebuild-fix
Do not reset received share state to pending if there is a state already
2023-09-25 14:24:59 +02:00
Sagar Gurung 6a7f56d056 [tests-only][full-ci]Added documentation for running tika related tests (#7342)
* Added documentation to run tika service related tests

* Added documentation for docker compose as well

* Make tika service run only for tika
2023-09-25 15:36:12 +05:45
André Duffeck 14b1d62351 Add changelog 2023-09-25 09:28:44 +02:00
André Duffeck 5f1043d40b Do not reset received share state to pending if there is a state already 2023-09-22 10:53:55 +02:00
Ralf Haferkamp 920d39918b Automated changelog update [skip ci] 2023-09-21 14:55:59 +00:00
Ralf Haferkamp c8c1cc76d8 users: fixup LDAP_BIND_PASSWORD
LDAP_BIND_PASSWORD was accidently removed in previous commit

Partial: #7176
(cherry picked from commit 8f262c1dff)
2023-09-21 16:55:13 +02:00
Ralf Haferkamp 6bf4dc5e0e users: revive USERS_LDAP_USER_SCHEMA_ID variable
The config variable was accidently removed when cleaning up deprecated variables
for the 4.0.0 release

Fixes: #7312
(cherry picked from commit 7b9200ff5d)
2023-09-21 16:55:13 +02:00
Ralf Haferkamp 3f41dd7601 Add OCIS_LDAP_BIND_PASSWORD envvar and deprecate LDAP_BIND_PASSWORD
For some reason LDAP_BIND_PASSWORD was forgotten when all the other global LDAP_
variables got renamed.

Also marks LDAP_BIND_PASSWORD and LDAP_USER_SCHEMA_ID_IS_OCTETSTRING for removal with 5.0.0

Partial: #7176
(cherry picked from commit 8f284e7c2b)
2023-09-21 16:55:13 +02:00
Prarup Gurung f7fde6ee87 Merge pull request #7280 from owncloud/backport-refactor-step-search-result-should-contain-only-these-files
[tests-only][full-ci] Backport refactor step search result should contain only these files
2023-09-21 11:43:57 +05:45
Karun Atreya fe8c0c7de8 refactor given and when steps in trashbin context (#7302)
applied same type of change in tagContext

addressed the reviews

added a space in step regex
2023-09-21 11:27:45 +05:45
nabim777 2ca502e32d adding the path check 2023-09-21 09:38:58 +05:45
Willy Kloucek 48dc83f4cb don't run CD on stable-4.0 branch cronjob 2023-09-14 09:32:49 +02:00
Karun Atreya fa36fd4ec2 refacor given when and then steps in checksum and favorite context (#7268)
making helper function, checking and setting response in given step and when steo respectively

returning response and using in given/then steps as required in favoritesContext

set the returned response on SpaceContext

changed to inline variable in some lines as required

to check for the specific https response code
2023-09-13 16:25:00 +05:45
Karun Atreya 71daf3f6ba refactor given when then steps in fileversions context (#7269)
migrating set response from helper function to when step in preview feature

separate single when/then steps by converting to helper function

use of httpstatuscode check function in given step and rebased

change function name

remove use of setresponse in then step

set the returned response
2023-09-13 16:24:42 +05:45
Karun Atreya 9c533c54ac make httpresponse check function to accept response object to get status from (#7270) 2023-09-13 15:11:36 +05:45
Sabin PantaandSaw-jan 47eb710523 [tests-only][full-ci] refactoring user creation Given steps from provisioning into GraphContext (#7019) (#7259)
* refactored the user creation given statement from provisioning to graph api

added getUser steps that covers the steps for user with user light role

* added userlight step tests to check drive information and updated expected failure files

* added usercreation initiation code

* deleted seperate tests for user light role

* remove unnecesary changes

* add user not initialize step

* corrected the testcode

* moved the steps from graph to provisioning file

* fix creating single ldap user

* fix: user check method

* initialize user via graph

* addressing reviews

---------

Co-authored-by: Saw-jan <saw.jan.grg3e@gmail.com>
2023-09-11 15:02:06 +05:45
Amritaandprajwol 9b40810b21 [tests-only][full-ci] Add test coverage for file preview using space dav version (#7218)
* Add tests for preview using space dav~

* use makeDavRequest to get preview of resource

---------

Co-authored-by: prajwol <prajwolamatya11@gmail.com>
2023-09-11 12:27:18 +05:45
Jörn Friedrich Dreyer 7b76086116 Automated changelog update [skip ci] 2023-09-08 11:05:09 +00:00
Jörn Friedrich Dreyer 7867841f7f actually use skip user info config option (#7220)
Signed-off-by: Jörn Friedrich Dreyer <jfd@butonic.de>
2023-09-08 13:04:24 +02:00
Sagar Gurung 6d2d79ba1d Automated changelog update [skip ci] 2023-09-08 07:22:08 +00:00
Sagar Gurung b45b35014a Backport/server panic password set (#7251)
* Added test for server getting panic when adding password to a link

* Change test case
2023-09-08 13:06:37 +05:45
Karun Atreya 986e470075 Automated changelog update [skip ci] 2023-09-08 00:40:58 +00:00
Karun Atreya 5c1e7e69a4 refactor given/then step to remove setting response (#7244)
removing setting response in the given steps

use response interface

use the returned response

check success response

changed to inline variable

changed variable response_xml to responseXml
2023-09-07 12:47:24 +05:45
Prajwol Amatya 620b44c90a send X-Request-Id in header of every request (#7238) 2023-09-07 10:33:44 +05:45
Phil Davis ac5270b3c6 Automated changelog update [skip ci] 2023-09-06 13:16:19 +00:00
Phil Davis 9348f94992 Merge pull request #7230 from rhafer/backport/4.0/7226
Backport-4.0: deployment: Disable username validation for keycloak example
2023-09-06 19:00:20 +05:45
Prajwol Amatya 39758a04b9 [tests-only][full-ci] Backport added test to update file using file id (#7237)
* added test to update file using file id

* changed the datatype of body from Tablenode to string
2023-09-06 18:46:46 +05:45
Ralf Haferkamp 41c62b3777 deployment: Disable username validation for keycloak example
Set 'GRAPH_USERNAME_MATCH' to 'none'. To accept any username that is
also valid for keycloak.

(cherry picked from commit 48306cbef3)
2023-09-06 14:58:06 +02:00
Phil Davis 8c1e39e824 Merge pull request #7191 from owncloud/backport-move-search-related-file
[tests-only][full-ci] Backport move search related file
2023-09-03 11:27:18 +05:45
Sagar Gurung 117b990d5a Make test code better for CI (#7193) 2023-09-01 18:39:29 +05:45
nabim777 4cd05c8d06 move files in apiFullTextSearch 2023-09-01 16:49:47 +05:45
kobergj 245a172eb6 Merge pull request #7184 from owncloud/search-share-expose
[full-ci] fix: disallow sharee to search sharer files outside the share
2023-09-01 12:23:14 +02:00
Florian Schade a885c8ad5c fix: failing tests and filter out specific matches 2023-09-01 10:38:30 +02:00
Florian Schade b984c1ad01 fix: acceptance tests to include path resource 2023-09-01 09:15:10 +02:00
Florian Schade 8255d9ac1b fix: search mount point inclusion 2023-09-01 09:03:33 +02:00
Florian Schade 8cfecd8a97 fix: search share expost 2023-08-31 16:49:39 +02:00
jkoberg f47dda164f Automated changelog update [skip ci] 2023-08-31 00:41:40 +00:00
jkoberg 3733e735a3 Automated changelog update [skip ci] 2023-08-30 01:15:55 +00:00
jkoberg e6e1494e92 Automated changelog update [skip ci] 2023-08-28 13:17:44 +00:00
jkoberg 684c4ca23d Automated changelog update [skip ci] 2023-08-28 10:29:28 +00:00
jkoberg 672bb1a8a6 adjust drone.star
Signed-off-by: jkoberg <jkoberg@owncloud.com>
2023-08-24 14:27:18 +02:00
83 changed files with 2088 additions and 1347 deletions

No files matched your search

+29 -31
View File
@@ -150,9 +150,9 @@ config = {
"OCIS_ADD_RUN_SERVICES": "antivirus",
},
},
"apiFullTextSearch": {
"apiSearch": {
"suites": [
"apiFullTextSearch",
"apiSearch",
],
"skip": False,
"tikaNeeded": True,
@@ -320,7 +320,7 @@ def cachePipeline(name, steps):
"steps": steps,
"trigger": {
"ref": [
"refs/heads/master",
"refs/heads/stable-*",
"refs/tags/**",
"refs/pull/**",
],
@@ -381,7 +381,6 @@ def getGoBinForTesting(ctx):
cacheGoBin(),
"trigger": {
"ref": [
"refs/heads/master",
"refs/heads/stable-*",
"refs/pull/**",
],
@@ -525,7 +524,7 @@ def testOcisModule(ctx, module):
"steps": steps,
"trigger": {
"ref": [
"refs/heads/master",
"refs/heads/stable-*",
"refs/tags/%s/v*" % (module),
"refs/pull/**",
],
@@ -550,7 +549,7 @@ def buildOcisBinaryForTesting(ctx):
rebuildBuildArtifactCache(ctx, "ocis-binary-amd64", "ocis/bin"),
"trigger": {
"ref": [
"refs/heads/master",
"refs/heads/stable-*",
"refs/pull/**",
],
},
@@ -637,7 +636,7 @@ def uploadScanResults(ctx):
],
"trigger": {
"ref": [
"refs/heads/master",
"refs/heads/stable-*",
"refs/pull/**",
],
"status": [
@@ -730,7 +729,7 @@ def codestyle(ctx):
"depends_on": [],
"trigger": {
"ref": [
"refs/heads/master",
"refs/heads/stable-*",
"refs/pull/**",
"refs/tags/**",
],
@@ -783,7 +782,7 @@ def localApiTestPipeline(ctx):
"depends_on": getPipelineNames([buildOcisBinaryForTesting(ctx)]),
"trigger": {
"ref": [
"refs/heads/master",
"refs/heads/stable-*",
"refs/pull/**",
],
},
@@ -802,7 +801,7 @@ def localApiTests(suite, storage, extra_environment = {}):
"SEND_SCENARIO_LINE_REFERENCES": "true",
"STORAGE_DRIVER": storage,
"BEHAT_SUITE": suite,
"BEHAT_FILTER_TAGS": "~@skip&&~@skipOnGraph&&~@skipOnOcis-%s-Storage" % ("OC" if storage == "owncloud" else "OCIS"),
"BEHAT_FILTER_TAGS": "~@skip&&~@skipOnGraph&&~@skipOnOcis-%s-Storage&&~@skipOnStable4.0" % ("OC" if storage == "owncloud" else "OCIS"),
"EXPECTED_FAILURES_FILE": "%s/tests/acceptance/expected-failures-localAPI-on-%s-storage.md" % (dirs["base"], storage.upper()),
"UPLOAD_DELETE_WAIT_TIME": "1" if storage == "owncloud" else 0,
"OCIS_WRAPPER_URL": "http://ocis-server:5200",
@@ -845,7 +844,7 @@ def cs3ApiTests(ctx, storage, accounts_hash_difficulty = 4):
"depends_on": getPipelineNames([buildOcisBinaryForTesting(ctx)]),
"trigger": {
"ref": [
"refs/heads/master",
"refs/heads/stable-*",
"refs/pull/**",
],
},
@@ -952,7 +951,7 @@ def wopiValidatorTests(ctx, storage, accounts_hash_difficulty = 4):
"depends_on": getPipelineNames([buildOcisBinaryForTesting(ctx)]),
"trigger": {
"ref": [
"refs/heads/master",
"refs/heads/stable-*",
"refs/pull/**",
],
},
@@ -1001,7 +1000,7 @@ def coreApiTests(ctx, part_number = 1, number_of_parts = 1, storage = "ocis", ac
"depends_on": getPipelineNames([buildOcisBinaryForTesting(ctx)]),
"trigger": {
"ref": [
"refs/heads/master",
"refs/heads/stable-*",
"refs/pull/**",
],
},
@@ -1117,7 +1116,7 @@ def uiTestPipeline(ctx, filterTags, runPart = 1, numberOfParts = 1, storage = "o
"depends_on": getPipelineNames([buildOcisBinaryForTesting(ctx)] + buildWebCache(ctx)),
"trigger": {
"ref": [
"refs/heads/master",
"refs/heads/stable-*",
"refs/pull/**",
],
},
@@ -1137,7 +1136,7 @@ def e2eTests(ctx):
e2e_trigger = {
"ref": [
"refs/heads/master",
"refs/heads/stable-*",
"refs/tags/**",
"refs/pull/**",
],
@@ -1347,7 +1346,7 @@ def dockerRelease(ctx, arch):
"depends_on": depends_on,
"trigger": {
"ref": [
"refs/heads/master",
"refs/heads/stable-*",
"refs/tags/v*",
"refs/pull/**",
],
@@ -1422,7 +1421,7 @@ def binaryRelease(ctx, name):
],
"when": {
"ref": [
"refs/heads/master",
"refs/heads/stable-*",
"refs/tags/v*",
],
},
@@ -1433,7 +1432,7 @@ def binaryRelease(ctx, name):
"settings": settings,
"when": {
"ref": [
"refs/heads/master",
"refs/heads/stable-*",
"refs/tags/v*",
],
},
@@ -1475,7 +1474,7 @@ def binaryRelease(ctx, name):
"depends_on": depends_on,
"trigger": {
"ref": [
"refs/heads/master",
"refs/heads/stable-*",
"refs/tags/v*",
"refs/pull/**",
],
@@ -1565,7 +1564,7 @@ def licenseCheck(ctx):
"settings": settings,
"when": {
"ref": [
"refs/heads/master",
"refs/heads/stable-*",
"refs/tags/v*",
],
},
@@ -1606,7 +1605,7 @@ def licenseCheck(ctx):
],
"trigger": {
"ref": [
"refs/heads/master",
"refs/heads/stable-*",
"refs/tags/v*",
"refs/pull/**",
],
@@ -1685,7 +1684,7 @@ def releaseDockerManifest():
],
"trigger": {
"ref": [
"refs/heads/master",
"refs/heads/stable-*",
"refs/tags/v*",
],
},
@@ -1731,7 +1730,7 @@ def changelog():
"push",
],
"message": "Automated changelog update [skip ci]",
"branch": "master",
"branch": "stable-4.0",
"author_email": "devops@owncloud.com",
"author_name": "ownClouders",
"netrc_machine": "github.com",
@@ -1753,7 +1752,7 @@ def changelog():
],
"trigger": {
"ref": [
"refs/heads/master",
"refs/heads/stable-*",
"refs/pull/**",
],
},
@@ -1787,7 +1786,7 @@ def releaseDockerReadme(ctx):
],
"trigger": {
"ref": [
"refs/heads/master",
"refs/heads/stable-*",
"refs/tags/v*",
],
},
@@ -1834,7 +1833,7 @@ def docs():
},
"pages_directory": "docs/hugo/content/",
"copy_contents": "true",
"target_branch": "docs",
"target_branch": "docs-stable-4.0",
"delete": "true",
},
"when": {
@@ -1856,7 +1855,7 @@ def docs():
],
"trigger": {
"ref": [
"refs/heads/master",
"refs/heads/stable-*",
"refs/pull/**",
],
},
@@ -1929,7 +1928,7 @@ def notify():
"depends_on": [],
"trigger": {
"ref": [
"refs/heads/master",
"refs/heads/stable-*",
"refs/heads/release*",
"refs/tags/**",
],
@@ -2268,7 +2267,6 @@ def deploy(ctx, config, rebuild):
],
"trigger": {
"ref": [
"refs/heads/master",
"refs/tags/v*",
],
},
@@ -2373,7 +2371,7 @@ def genericCachePurge(flush_path):
],
"trigger": {
"ref": [
"refs/heads/master",
"refs/heads/stable-*",
"refs/pull/**",
],
"status": [
@@ -2625,7 +2623,7 @@ def litmus(ctx, storage):
"depends_on": getPipelineNames([buildOcisBinaryForTesting(ctx)]),
"trigger": {
"ref": [
"refs/heads/master",
"refs/heads/stable-*",
"refs/pull/**",
],
},
+255 -176
View File
@@ -2,190 +2,75 @@
The following sections list the changes for unreleased.
[unreleased]: https://github.com/owncloud/ocis/compare/v3.1.0...master
[unreleased]: https://github.com/owncloud/ocis/compare/v4.0.0...master
## Summary
* Bugfix - Graph service did not honor the OCIS_LDAP_GROUP_SCHEMA_MEMBER setting: [#7032](https://github.com/owncloud/ocis/issues/7032)
* Bugfix - Fix the search: [#6947](https://github.com/owncloud/ocis/pull/6947)
* Enhancement - Add command for rebuilding the jsoncs3 share manager indexes: [#6986](https://github.com/owncloud/ocis/pull/6986)
* Enhancement - Bump reva to latest edge: [#6979](https://github.com/owncloud/ocis/pull/6979)
* Enhancement - Bump sonarcloud: [#6961](https://github.com/owncloud/ocis/pull/6961)
* Enhancement - Extendable policy mimetype extension mapping: [#6869](https://github.com/owncloud/ocis/pull/6869)
* Enhancement - Add static secret to gn endpoints: [#6946](https://github.com/owncloud/ocis/pull/6946)
* Enhancement - Nats named connections: [#6979](https://github.com/owncloud/ocis/pull/6979)
* Enhancement - Remove deprecated environment variables: [#7099](https://github.com/owncloud/ocis/pull/7099)
* Enhancement - Update web to v7.1.0: [#7107](https://github.com/owncloud/ocis/pull/7107)
* Bugfix - Bump reva to 2.16.1: [#7350](https://github.com/owncloud/ocis/pull/7350)
* Bugfix - Do not reset received share state to pending: [#7319](https://github.com/owncloud/ocis/issues/7319)
* Bugfix - Check school number for duplicates before adding a school: [#7351](https://github.com/owncloud/ocis/pull/7351)
* Bugfix - Disable username validation for keycloak example: [#7230](https://github.com/owncloud/ocis/pull/7230)
* Bugfix - Actually pass PROXY_OIDC_SKIP_USER_INFO option to oidc client middleware: [#7220](https://github.com/owncloud/ocis/pull/7220)
* Bugfix - Bring back the USERS_LDAP_USER_SCHEMA_ID variable: [#7312](https://github.com/owncloud/ocis/issues/7312)
* Enhancement - Add OCIS_LDAP_BIND_PASSWORD as replacement for LDAP_BIND_PASSWORD: [#7176](https://github.com/owncloud/ocis/issues/7176)
## Details
* Bugfix - Graph service did not honor the OCIS_LDAP_GROUP_SCHEMA_MEMBER setting: [#7032](https://github.com/owncloud/ocis/issues/7032)
* Bugfix - Bump reva to 2.16.1: [#7350](https://github.com/owncloud/ocis/pull/7350)
We fixed issue when using a custom LDAP attribute for group members. The graph service did not
honor the OCIS_LDAP_GROUP_SCHEMA_MEMBER environment variable
* Bugfix [cs3org/reva#4194](https://github.com/cs3org/reva/pull/4194): Make appctx package compatible with go v1.21
* Bugfix [cs3org/reva#4214](https://github.com/cs3org/reva/pull/4214): Always pass adjusted default nats options
https://github.com/owncloud/ocis/issues/7032
https://github.com/owncloud/ocis/pull/7350
* Bugfix - Fix the search: [#6947](https://github.com/owncloud/ocis/pull/6947)
* Bugfix - Do not reset received share state to pending: [#7319](https://github.com/owncloud/ocis/issues/7319)
We fixed the issue when search using the current folder option shows the file/folders outside
the folder if search keyword is same as current folder
We fixed a problem where the states of received shares were reset to PENDING in the "ocis migrate
rebuild-jsoncs3-indexes" command
https://github.com/owncloud/ocis/issues/6935
https://github.com/owncloud/ocis/pull/6947
https://github.com/owncloud/ocis/issues/7319
* Enhancement - Add command for rebuilding the jsoncs3 share manager indexes: [#6986](https://github.com/owncloud/ocis/pull/6986)
* Bugfix - Check school number for duplicates before adding a school: [#7351](https://github.com/owncloud/ocis/pull/7351)
We added a command for rebuilding the jsoncs3 share manager indexes.
We fixed an issue that allowed to create two schools with the same school number
https://github.com/owncloud/ocis/pull/6986
https://github.com/owncloud/ocis/pull/6971
https://github.com/owncloud/enterprise/issues/6051
https://github.com/owncloud/ocis/pull/7351
* Enhancement - Bump reva to latest edge: [#6979](https://github.com/owncloud/ocis/pull/6979)
* Bugfix - Disable username validation for keycloak example: [#7230](https://github.com/owncloud/ocis/pull/7230)
Bumps reva to latest edge
Set 'GRAPH_USERNAME_MATCH' to 'none'. To accept any username that is also valid for keycloak.
https://github.com/owncloud/ocis/pull/6979
https://github.com/owncloud/ocis/pull/7230
* Enhancement - Bump sonarcloud: [#6961](https://github.com/owncloud/ocis/pull/6961)
* Bugfix - Actually pass PROXY_OIDC_SKIP_USER_INFO option to oidc client middleware: [#7220](https://github.com/owncloud/ocis/pull/7220)
Bump sonarcloud to `5.0` to avoid java errors
https://github.com/owncloud/ocis/pull/7220
https://github.com/owncloud/ocis/pull/6961
* Bugfix - Bring back the USERS_LDAP_USER_SCHEMA_ID variable: [#7312](https://github.com/owncloud/ocis/issues/7312)
* Enhancement - Extendable policy mimetype extension mapping: [#6869](https://github.com/owncloud/ocis/pull/6869)
We reintroduced the USERS_LDAP_USER_SCHEMA_ID variable which was accidently removed from
the users service with the 4.0.0 release.
The extension mimetype mappings known from rego can now be extended. To do this, ocis must be
informed where the mimetype file (apache mime.types file format) is located.
https://github.com/owncloud/ocis/issues/7312
https://github.com/owncloud/ocis-charts/issues/397
`export POLICIES_ENGINE_MIMES=OCIS_CONFIG_DIR/mime.types`
* Enhancement - Add OCIS_LDAP_BIND_PASSWORD as replacement for LDAP_BIND_PASSWORD: [#7176](https://github.com/owncloud/ocis/issues/7176)
https://github.com/owncloud/ocis/pull/6869
The enviroment variable `OCIS_LDAP_BIND_PASSWORD` was added to be more consistent with all
other global LDAP variables.
* Enhancement - Add static secret to gn endpoints: [#6946](https://github.com/owncloud/ocis/pull/6946)
`LDAP_BIND_PASSWORD` is deprecated now and scheduled for removal with the 5.0.0 release.
The global notifications POST and DELETE endpoints (used only for deprovision notifications
at the moment) can now be called by adding a static secret to the header. Admins can still call
this endpoint without knowing the secret
We also deprecated `LDAP_USER_SCHEMA_ID_IS_OCTETSTRING` for removal with 5.0.0. The
replacement for it is `OCIS_LDAP_USER_SCHEMA_ID_IS_OCTETSTRING`.
https://github.com/owncloud/ocis/pull/6946
https://github.com/owncloud/ocis/issues/7176
# Changelog for [4.0.0] (2023-08-21)
* Enhancement - Nats named connections: [#6979](https://github.com/owncloud/ocis/pull/6979)
The following sections list the changes for 4.0.0.
Names the nats connections for easier debugging
https://github.com/owncloud/ocis/pull/6979
* Enhancement - Remove deprecated environment variables: [#7099](https://github.com/owncloud/ocis/pull/7099)
We have removed all environment variables that have been marked as deprecated and marked for
removal for 4.0.0
https://github.com/owncloud/ocis/pull/7099
* Enhancement - Update web to v7.1.0: [#7107](https://github.com/owncloud/ocis/pull/7107)
Tags: web
We updated ownCloud Web to v7.1.0. Please refer to the changelog (linked) for details on the web
release.
## Summary * Bugfix [owncloud/web#9078](https://github.com/owncloud/web/pull/9078):
Favorites list update on removal * Bugfix
[owncloud/web#9213](https://github.com/owncloud/web/pull/9213): Space creation does
not block reoccurring event * Bugfix
[owncloud/web#9247](https://github.com/owncloud/web/issues/9247): Uploading to
folders that contain special characters * Bugfix
[owncloud/web#9259](https://github.com/owncloud/web/issues/9259): Relative user
quota display limited to two decimals * Bugfix
[owncloud/web#9261](https://github.com/owncloud/web/issues/9261): Remember
location after token invalidation * Bugfix
[owncloud/web#9299](https://github.com/owncloud/web/pull/9299): Authenticated
public links breaking uploads * Bugfix
[owncloud/web#9315](https://github.com/owncloud/web/issues/9315): Switch columns
displayed on small screens in "Shared with me" view * Bugfix
[owncloud/web#9351](https://github.com/owncloud/web/pull/9351): Media controls
overflow on mobile screens * Bugfix
[owncloud/web#9389](https://github.com/owncloud/web/pull/9389): Space editors see
empty trashbin and delete actions in space trashbin * Bugfix
[owncloud/web#9461](https://github.com/owncloud/web/issues/9461): Merging folders *
Enhancement [owncloud/web#7967](https://github.com/owncloud/web/pull/7967): Add
hasPriority property for editors per extension * Enhancement
[owncloud/web#8422](https://github.com/owncloud/web/issues/8422): Improve
extension app topbar * Enhancement
[owncloud/web#8445](https://github.com/owncloud/web/issues/8445): Open
individually shared file in dedicated view * Enhancement
[owncloud/web#8599](https://github.com/owncloud/web/issues/8599): Shrink table
columns * Enhancement
[owncloud/web#8921](https://github.com/owncloud/web/pull/8921): Add whitespace
context-menu * Enhancement
[owncloud/web#8983](https://github.com/owncloud/web/pull/8983): Deny share access *
Enhancement [owncloud/web#8984](https://github.com/owncloud/web/pull/8984): Long
breadcrumb strategy * Enhancement
[owncloud/web#9044](https://github.com/owncloud/web/pull/9044): Search tag filter *
Enhancement [owncloud/web#9046](https://github.com/owncloud/web/pull/9046): Single
file link open with default app * Enhancement
[owncloud/web#9052](https://github.com/owncloud/web/pull/9052): Drag & drop on parent
folder * Enhancement
[owncloud/web#9055](https://github.com/owncloud/web/pull/9055): Respect archiver
limits * Enhancement
[owncloud/web#9056](https://github.com/owncloud/web/issues/9056): Enable download
(archive) on spaces * Enhancement
[owncloud/web#9059](https://github.com/owncloud/web/pull/9059): Search full-text
filter * Enhancement
[owncloud/web#9077](https://github.com/owncloud/web/pull/9077): Advanced search
button * Enhancement
[owncloud/web#9077](https://github.com/owncloud/web/pull/9077): Search breadcrumb *
Enhancement [owncloud/web#9088](https://github.com/owncloud/web/pull/9088): Use app
icons for files * Enhancement
[owncloud/web#9140](https://github.com/owncloud/web/pull/9140): Upload file on paste
* Enhancement [owncloud/web#9151](https://github.com/owncloud/web/issues/9151):
Cloud import * Enhancement
[owncloud/web#9174](https://github.com/owncloud/web/issues/9174): Privacy
statement in account menu * Enhancement
[owncloud/web#9178](https://github.com/owncloud/web/pull/9178): Add login button to
top bar * Enhancement
[owncloud/web#9195](https://github.com/owncloud/web/pull/9195): Project spaces list
viewmode * Enhancement
[owncloud/web#9199](https://github.com/owncloud/web/pull/9199): Add pagination
options to admin settings * Enhancement
[owncloud/web#9200](https://github.com/owncloud/web/pull/9200): Add batch actions to
search result list * Enhancement
[owncloud/web#9216](https://github.com/owncloud/web/issues/9216): Restyle possible
sharees * Enhancement
[owncloud/web#9226](https://github.com/owncloud/web/pull/9226): Streamline URL
query names * Enhancement
[owncloud/web#9263](https://github.com/owncloud/web/pull/9263): Access denied page
update message * Enhancement
[owncloud/web#9280](https://github.com/owncloud/web/issues/9280): Hover tooltips in
topbar * Enhancement
[owncloud/web#9294](https://github.com/owncloud/web/pull/9294): Search list add
highlighted file content * Enhancement
[owncloud/web#9299](https://github.com/owncloud/web/pull/9299): Resolve pulic links
to their actual location * Enhancement
[owncloud/web#9304](https://github.com/owncloud/web/pull/9304): Add search location
filter * Enhancement
[owncloud/web#9344](https://github.com/owncloud/web/pull/9344): Ambiguation for URL
view mode params * Enhancement
[owncloud/web#9346](https://github.com/owncloud/web/pull/9346): Batch actions
redesign * Enhancement
[owncloud/web#9348](https://github.com/owncloud/web/pull/9348): Tag comma
separation on client side * Enhancement
[owncloud/web#9377](https://github.com/owncloud/web/issues/9377): User
notification for blocked pop-ups and redirects * Enhancement
[owncloud/web#9386](https://github.com/owncloud/web/pull/9386): Allow local storage
for auth token * Enhancement
[owncloud/web#9394](https://github.com/owncloud/web/pull/9394): Button styling *
Enhancement [owncloud/web#9436](https://github.com/owncloud/web/pull/9436): Add
error log to upload dialog
https://github.com/owncloud/ocis/pull/7107
https://github.com/owncloud/web/releases/tag/v7.1.0
# Changelog for [3.1.0] (2023-08-02)
The following sections list the changes for 3.1.0.
[3.1.0]: https://github.com/owncloud/ocis/compare/v3.0.0...v3.1.0
[4.0.0]: https://github.com/owncloud/ocis/compare/v3.0.0...v4.0.0
## Summary
@@ -198,16 +83,19 @@ The following sections list the changes for 3.1.0.
* Bugfix - Fix CORS issues: [#6912](https://github.com/owncloud/ocis/pull/6912)
* Bugfix - Handle the bad request status: [#6469](https://github.com/owncloud/ocis/pull/6469)
* Bugfix - Fix error message on 400 response for thumbnail requests: [#2064](https://github.com/owncloud/ocis/issues/2064)
* Bugfix - Graph service did not honor the OCIS_LDAP_GROUP_SCHEMA_MEMBER setting: [#7032](https://github.com/owncloud/ocis/issues/7032)
* Bugfix - Fix nats registry: [#6881](https://github.com/owncloud/ocis/pull/6881)
* Bugfix - Fix the oidc role assigner: [#6605](https://github.com/owncloud/ocis/pull/6605)
* Bugfix - Fix the default document language for OnlyOffice: [#6878](https://github.com/owncloud/ocis/pull/6878)
* Bugfix - Fix the routing capability: [#9367](https://github.com/owncloud/web/issues/9367)
* Bugfix - Fix the search: [#6947](https://github.com/owncloud/ocis/pull/6947)
* Bugfix - Fix search shares: [#6741](https://github.com/owncloud/ocis/pull/6741)
* Bugfix - Restart Postprocessing: [#6726](https://github.com/owncloud/ocis/pull/6726)
* Change - YAML configuration files are restricted to yaml-1.2: [#6510](https://github.com/owncloud/ocis/issues/6510)
* Enhancement - Add 'ocis decomposedfs check-treesize' command: [#6556](https://github.com/owncloud/ocis/pull/6556)
* Enhancement - Add IDs to graph resource logging: [#6593](https://github.com/owncloud/ocis/pull/6593)
* Enhancement - Add permissions to report: [#6528](https://github.com/owncloud/ocis/pull/6528)
* Enhancement - Add command for rebuilding the jsoncs3 share manager indexes: [#6986](https://github.com/owncloud/ocis/pull/6986)
* Enhancement - Add more metadata to the remote item: [#6300](https://github.com/owncloud/ocis/pull/6300)
* Enhancement - Add X-Request-Id to all responses: [#6715](https://github.com/owncloud/ocis/pull/6715)
* Enhancement - Add SSE Endpoint: [#5998](https://github.com/owncloud/ocis/pull/5998)
@@ -216,7 +104,8 @@ The following sections list the changes for 3.1.0.
* Enhancement - Make the app provider service name configurable: [#6482](https://github.com/owncloud/ocis/pull/6482)
* Enhancement - Add old & new values to audit logs: [#6537](https://github.com/owncloud/ocis/pull/6537)
* Enhancement - Bump Hugo: [#6787](https://github.com/owncloud/ocis/pull/6787)
* Enhancement - Bump reva to latest edge: [#6829](https://github.com/owncloud/ocis/pull/6829)
* Enhancement - Bump reva to 2.16.0: [#6829](https://github.com/owncloud/ocis/pull/6829)
* Enhancement - Bump sonarcloud: [#6961](https://github.com/owncloud/ocis/pull/6961)
* Enhancement - Clarify license text in the dev docs: [#6755](https://github.com/owncloud/ocis/pull/6755)
* Enhancement - Use reva client selectors: [#6452](https://github.com/owncloud/ocis/pull/6452)
* Enhancement - Configure max grpc message size: [#6849](https://github.com/owncloud/ocis/pull/6849)
@@ -230,17 +119,22 @@ The following sections list the changes for 3.1.0.
* Enhancement - Add search result content preview and term highlighting: [#6634](https://github.com/owncloud/ocis/pull/6634)
* Enhancement - Add WEB_OPTION_TOKEN_STORAGE_LOCAL env variable: [#6760](https://github.com/owncloud/ocis/pull/6760)
* Enhancement - Evaluate policy resource information on single file shares: [#6888](https://github.com/owncloud/ocis/pull/6888)
* Enhancement - Extendable policy mimetype extension mapping: [#6869](https://github.com/owncloud/ocis/pull/6869)
* Enhancement - Fix envvar defaults: [#6516](https://github.com/owncloud/ocis/pull/6516)
* Enhancement - Skip if the simulink is a directory: [#6574](https://github.com/owncloud/ocis/pull/6574)
* Enhancement - Fix the groupname validation: [#6490](https://github.com/owncloud/ocis/pull/6490)
* Enhancement - Fix the username validation: [#6437](https://github.com/owncloud/ocis/pull/6437)
* Enhancement - Add static secret to gn endpoints: [#6946](https://github.com/owncloud/ocis/pull/6946)
* Enhancement - Improve the notification logs: [#6862](https://github.com/owncloud/ocis/pull/6862)
* Enhancement - Move graph to service tracerprovider: [#6695](https://github.com/owncloud/ocis/pull/6695)
* Enhancement - Move proxy to service tracerprovider: [#6591](https://github.com/owncloud/ocis/pull/6591)
* Enhancement - Nats named connections: [#6979](https://github.com/owncloud/ocis/pull/6979)
* Enhancement - Remove deprecated environment variables: [#7099](https://github.com/owncloud/ocis/pull/7099)
* Enhancement - Add functionality to retry postprocessing: [#6500](https://github.com/owncloud/ocis/pull/6500)
* Enhancement - Update go-micro kubernetes registry: [#6457](https://github.com/owncloud/ocis/pull/6457)
* Enhancement - Update web to v7.0.1: [#6470](https://github.com/owncloud/ocis/pull/6470)
* Enhancement - Update web to v7.1.0-rc.5: [#6944](https://github.com/owncloud/ocis/pull/6944)
* Enhancement - Update web to v7.1.0: [#7107](https://github.com/owncloud/ocis/pull/7107)
* Enhancement - Allow disabling wopi chat: [#6544](https://github.com/owncloud/ocis/pull/6544)
## Details
@@ -308,6 +202,13 @@ The following sections list the changes for 3.1.0.
https://github.com/owncloud/ocis/issues/2064
https://github.com/owncloud/ocis/pull/6911
* Bugfix - Graph service did not honor the OCIS_LDAP_GROUP_SCHEMA_MEMBER setting: [#7032](https://github.com/owncloud/ocis/issues/7032)
We fixed issue when using a custom LDAP attribute for group members. The graph service did not
honor the OCIS_LDAP_GROUP_SCHEMA_MEMBER environment variable
https://github.com/owncloud/ocis/issues/7032
* Bugfix - Fix nats registry: [#6881](https://github.com/owncloud/ocis/pull/6881)
Using `nats` as service registry did work, but when a service would restart and gets a new ip it
@@ -338,6 +239,14 @@ The following sections list the changes for 3.1.0.
https://github.com/owncloud/web/issues/9367
* Bugfix - Fix the search: [#6947](https://github.com/owncloud/ocis/pull/6947)
We fixed the issue when search using the current folder option shows the file/folders outside
the folder if search keyword is same as current folder
https://github.com/owncloud/ocis/issues/6935
https://github.com/owncloud/ocis/pull/6947
* Bugfix - Fix search shares: [#6741](https://github.com/owncloud/ocis/pull/6741)
We fixed a problem where searching shares did not yield results when the resource was not shared
@@ -385,6 +294,13 @@ The following sections list the changes for 3.1.0.
https://github.com/owncloud/ocis/pull/6528
* Enhancement - Add command for rebuilding the jsoncs3 share manager indexes: [#6986](https://github.com/owncloud/ocis/pull/6986)
We added a command for rebuilding the jsoncs3 share manager indexes.
https://github.com/owncloud/ocis/pull/6986
https://github.com/owncloud/ocis/pull/6971
* Enhancement - Add more metadata to the remote item: [#6300](https://github.com/owncloud/ocis/pull/6300)
We added the drive alias, the space name and the relative path to the remote item. This is needed
@@ -439,7 +355,7 @@ The following sections list the changes for 3.1.0.
https://github.com/owncloud/ocis/pull/6787
* Enhancement - Bump reva to latest edge: [#6829](https://github.com/owncloud/ocis/pull/6829)
* Enhancement - Bump reva to 2.16.0: [#6829](https://github.com/owncloud/ocis/pull/6829)
* Bugfix [cs3org/reva#4086](https://github.com/cs3org/reva/pull/4086): Fix ocs status code for not enough permission response
* Bugfix [cs3org/reva#4078](https://github.com/cs3org/reva/pull/4078): fix the default document language for OnlyOffice
@@ -449,6 +365,22 @@ The following sections list the changes for 3.1.0.
* Bugfix [cs3org/reva#4076](https://github.com/cs3org/reva/pull/4076): Fix WebDAV permissions for space managers
* Bugfix [cs3org/reva#4078](https://github.com/cs3org/reva/pull/4078): fix the default document language for OnlyOffice
* Bugfix [cs3org/reva#4081](https://github.com/cs3org/reva/pull/4081): Propagate sizeDiff
* Bugfix [cs3org/reva#4051](https://github.com/cs3org/reva/pull/4051): Set treesize when creating a storage space
* Bugfix [cs3org/reva#4093](https://github.com/cs3org/reva/pull/4093): Fix the error handling
* Bugfix [cs3org/reva#4111](https://github.com/cs3org/reva/pull/4111): Return already exists error when child already exists
* Bugfix [cs3org/reva#4086](https://github.com/cs3org/reva/pull/4086): Fix ocs status code for not enough permission response
* Bugfix [cs3org/reva#4101](https://github.com/cs3org/reva/pull/4101): Make the jsoncs3 share manager indexes more robust
* Bugfix [cs3org/reva#4099](https://github.com/cs3org/reva/pull/4099): Fix logging upload errors
* Bugfix [cs3org/reva#4078](https://github.com/cs3org/reva/pull/4078): Fix the default document language for OnlyOffice
* Bugfix [cs3org/reva#4082](https://github.com/cs3org/reva/pull/4082): Fix propfind permissions
* Bugfix [cs3org/reva#4100](https://github.com/cs3org/reva/pull/4100): S3ng include md5 checksum on put
* Bugfix [cs3org/reva#4096](https://github.com/cs3org/reva/pull/4096): Fix the user shares list
* Bugfix [cs3org/reva#4076](https://github.com/cs3org/reva/pull/4076): Fix WebDAV permissions for space managers
* Bugfix [cs3org/reva#4117](https://github.com/cs3org/reva/pull/4117): Fix jsoncs3 atomic persistence
* Bugfix [cs3org/reva#4081](https://github.com/cs3org/reva/pull/4081): Propagate sizeDiff
* Bugfix [cs3org/reva#4091](https://github.com/cs3org/reva/pull/4091): Register WebDAV HTTP methods with chi
* Bugfix [cs3org/reva#4107](https://github.com/cs3org/reva/pull/4107): Return lock when requested
* Bugfix [cs3org/reva#4075](https://github.com/cs3org/reva/pull/4075): Revert 4065 - bypass proxy on upload
* Enhancement [cs3org/reva#4070](https://github.com/cs3org/reva/pull/4070): Selectable Propagators
* Enhancement [cs3org/reva#4074](https://github.com/cs3org/reva/pull/4074): Allow configuring the max size of grpc messages
* Enhancement [cs3org/reva#4085](https://github.com/cs3org/reva/pull/4085): Add registry refresh
@@ -456,10 +388,22 @@ The following sections list the changes for 3.1.0.
* Enhancement [cs3org/reva#4072](https://github.com/cs3org/reva/pull/4072): Allow to specify a shutdown timeout
* Enhancement [cs3org/reva#4083](https://github.com/cs3org/reva/pull/4083): Allow for rolling back migrations
* Enhancement [cs3org/reva#4014](https://github.com/cs3org/reva/pull/4014): En-/Disable DEPTH:inifinity in PROPFIND
* Enhancement [cs3org/reva#4089](https://github.com/cs3org/reva/pull/4089): Async propagation (experimental)
* Enhancement [cs3org/reva#4074](https://github.com/cs3org/reva/pull/4074): Allow configuring the max size of grpc messages
* Enhancement [cs3org/reva#4083](https://github.com/cs3org/reva/pull/4083): Allow for rolling back migrations
* Enhancement [cs3org/reva#4014](https://github.com/cs3org/reva/pull/4014): En-/Disable DEPTH:inifinity in PROPFIND
* Enhancement [cs3org/reva#4072](https://github.com/cs3org/reva/pull/4072): Allow to specify a shutdown timeout
* Enhancement [cs3org/reva#4103](https://github.com/cs3org/reva/pull/4103): Add .oform mimetype
* Enhancement [cs3org/reva#4098](https://github.com/cs3org/reva/pull/4098): Allow naming nats connections
* Enhancement [cs3org/reva#4085](https://github.com/cs3org/reva/pull/4085): Add registry refresh
* Enhancement [cs3org/reva#4097](https://github.com/cs3org/reva/pull/4097): Remove app ticker logs
* Enhancement [cs3org/reva#4090](https://github.com/cs3org/reva/pull/4090): Add Capability for sse
* Enhancement [cs3org/reva#4110](https://github.com/cs3org/reva/pull/4110): Tracing events propgation
Https://github.com/owncloud/ocis/pull/6899
https://github.com/owncloud/ocis/pull/6919
https://github.com/owncloud/ocis/pull/6928
https://github.com/owncloud/ocis/pull/6979
Update reva to v2.15.0
@@ -526,6 +470,12 @@ The following sections list the changes for 3.1.0.
https://github.com/owncloud/ocis/pull/6590
https://github.com/owncloud/ocis/pull/6812
* Enhancement - Bump sonarcloud: [#6961](https://github.com/owncloud/ocis/pull/6961)
Bump sonarcloud to `5.0` to avoid java errors
https://github.com/owncloud/ocis/pull/6961
* Enhancement - Clarify license text in the dev docs: [#6755](https://github.com/owncloud/ocis/pull/6755)
Explain the usage of the EULA for binary builds.
@@ -626,6 +576,15 @@ The following sections list the changes for 3.1.0.
https://github.com/owncloud/ocis/pull/6888
* Enhancement - Extendable policy mimetype extension mapping: [#6869](https://github.com/owncloud/ocis/pull/6869)
The extension mimetype mappings known from rego can now be extended. To do this, ocis must be
informed where the mimetype file (apache mime.types file format) is located.
`export POLICIES_ENGINE_MIMES=OCIS_CONFIG_DIR/mime.types`
https://github.com/owncloud/ocis/pull/6869
* Enhancement - Fix envvar defaults: [#6516](https://github.com/owncloud/ocis/pull/6516)
Defaults for the envvar OCIS_LDAP_DISABLE_USER_MECHANISM were not used consistently,
@@ -655,6 +614,14 @@ The following sections list the changes for 3.1.0.
https://github.com/owncloud/ocis/issues/6436
https://github.com/owncloud/ocis/pull/6437
* Enhancement - Add static secret to gn endpoints: [#6946](https://github.com/owncloud/ocis/pull/6946)
The global notifications POST and DELETE endpoints (used only for deprovision notifications
at the moment) can now be called by adding a static secret to the header. Admins can still call
this endpoint without knowing the secret
https://github.com/owncloud/ocis/pull/6946
* Enhancement - Improve the notification logs: [#6862](https://github.com/owncloud/ocis/pull/6862)
Improve the notification logs when the user has no email address
@@ -676,6 +643,19 @@ The following sections list the changes for 3.1.0.
https://github.com/owncloud/ocis/pull/6591
* Enhancement - Nats named connections: [#6979](https://github.com/owncloud/ocis/pull/6979)
Names the nats connections for easier debugging
https://github.com/owncloud/ocis/pull/6979
* Enhancement - Remove deprecated environment variables: [#7099](https://github.com/owncloud/ocis/pull/7099)
We have removed all environment variables that have been marked as deprecated and marked for
removal for 4.0.0
https://github.com/owncloud/ocis/pull/7099
* Enhancement - Add functionality to retry postprocessing: [#6500](https://github.com/owncloud/ocis/pull/6500)
Adds a ctl command to manually retry failed postprocessing on uploads
@@ -813,6 +793,105 @@ The following sections list the changes for 3.1.0.
https://github.com/owncloud/ocis/pull/6944
https://github.com/owncloud/web/releases/tag/v7.1.0-rc.5
* Enhancement - Update web to v7.1.0: [#7107](https://github.com/owncloud/ocis/pull/7107)
Tags: web
We updated ownCloud Web to v7.1.0. Please refer to the changelog (linked) for details on the web
release.
## Summary * Bugfix [owncloud/web#9078](https://github.com/owncloud/web/pull/9078):
Favorites list update on removal * Bugfix
[owncloud/web#9213](https://github.com/owncloud/web/pull/9213): Space creation does
not block reoccurring event * Bugfix
[owncloud/web#9247](https://github.com/owncloud/web/issues/9247): Uploading to
folders that contain special characters * Bugfix
[owncloud/web#9259](https://github.com/owncloud/web/issues/9259): Relative user
quota display limited to two decimals * Bugfix
[owncloud/web#9261](https://github.com/owncloud/web/issues/9261): Remember
location after token invalidation * Bugfix
[owncloud/web#9299](https://github.com/owncloud/web/pull/9299): Authenticated
public links breaking uploads * Bugfix
[owncloud/web#9315](https://github.com/owncloud/web/issues/9315): Switch columns
displayed on small screens in "Shared with me" view * Bugfix
[owncloud/web#9351](https://github.com/owncloud/web/pull/9351): Media controls
overflow on mobile screens * Bugfix
[owncloud/web#9389](https://github.com/owncloud/web/pull/9389): Space editors see
empty trashbin and delete actions in space trashbin * Bugfix
[owncloud/web#9461](https://github.com/owncloud/web/issues/9461): Merging folders *
Enhancement [owncloud/web#7967](https://github.com/owncloud/web/pull/7967): Add
hasPriority property for editors per extension * Enhancement
[owncloud/web#8422](https://github.com/owncloud/web/issues/8422): Improve
extension app topbar * Enhancement
[owncloud/web#8445](https://github.com/owncloud/web/issues/8445): Open
individually shared file in dedicated view * Enhancement
[owncloud/web#8599](https://github.com/owncloud/web/issues/8599): Shrink table
columns * Enhancement
[owncloud/web#8921](https://github.com/owncloud/web/pull/8921): Add whitespace
context-menu * Enhancement
[owncloud/web#8983](https://github.com/owncloud/web/pull/8983): Deny share access *
Enhancement [owncloud/web#8984](https://github.com/owncloud/web/pull/8984): Long
breadcrumb strategy * Enhancement
[owncloud/web#9044](https://github.com/owncloud/web/pull/9044): Search tag filter *
Enhancement [owncloud/web#9046](https://github.com/owncloud/web/pull/9046): Single
file link open with default app * Enhancement
[owncloud/web#9052](https://github.com/owncloud/web/pull/9052): Drag & drop on parent
folder * Enhancement
[owncloud/web#9055](https://github.com/owncloud/web/pull/9055): Respect archiver
limits * Enhancement
[owncloud/web#9056](https://github.com/owncloud/web/issues/9056): Enable download
(archive) on spaces * Enhancement
[owncloud/web#9059](https://github.com/owncloud/web/pull/9059): Search full-text
filter * Enhancement
[owncloud/web#9077](https://github.com/owncloud/web/pull/9077): Advanced search
button * Enhancement
[owncloud/web#9077](https://github.com/owncloud/web/pull/9077): Search breadcrumb *
Enhancement [owncloud/web#9088](https://github.com/owncloud/web/pull/9088): Use app
icons for files * Enhancement
[owncloud/web#9140](https://github.com/owncloud/web/pull/9140): Upload file on paste
* Enhancement [owncloud/web#9151](https://github.com/owncloud/web/issues/9151):
Cloud import * Enhancement
[owncloud/web#9174](https://github.com/owncloud/web/issues/9174): Privacy
statement in account menu * Enhancement
[owncloud/web#9178](https://github.com/owncloud/web/pull/9178): Add login button to
top bar * Enhancement
[owncloud/web#9195](https://github.com/owncloud/web/pull/9195): Project spaces list
viewmode * Enhancement
[owncloud/web#9199](https://github.com/owncloud/web/pull/9199): Add pagination
options to admin settings * Enhancement
[owncloud/web#9200](https://github.com/owncloud/web/pull/9200): Add batch actions to
search result list * Enhancement
[owncloud/web#9216](https://github.com/owncloud/web/issues/9216): Restyle possible
sharees * Enhancement
[owncloud/web#9226](https://github.com/owncloud/web/pull/9226): Streamline URL
query names * Enhancement
[owncloud/web#9263](https://github.com/owncloud/web/pull/9263): Access denied page
update message * Enhancement
[owncloud/web#9280](https://github.com/owncloud/web/issues/9280): Hover tooltips in
topbar * Enhancement
[owncloud/web#9294](https://github.com/owncloud/web/pull/9294): Search list add
highlighted file content * Enhancement
[owncloud/web#9299](https://github.com/owncloud/web/pull/9299): Resolve pulic links
to their actual location * Enhancement
[owncloud/web#9304](https://github.com/owncloud/web/pull/9304): Add search location
filter * Enhancement
[owncloud/web#9344](https://github.com/owncloud/web/pull/9344): Ambiguation for URL
view mode params * Enhancement
[owncloud/web#9346](https://github.com/owncloud/web/pull/9346): Batch actions
redesign * Enhancement
[owncloud/web#9348](https://github.com/owncloud/web/pull/9348): Tag comma
separation on client side * Enhancement
[owncloud/web#9377](https://github.com/owncloud/web/issues/9377): User
notification for blocked pop-ups and redirects * Enhancement
[owncloud/web#9386](https://github.com/owncloud/web/pull/9386): Allow local storage
for auth token * Enhancement
[owncloud/web#9394](https://github.com/owncloud/web/pull/9394): Button styling *
Enhancement [owncloud/web#9436](https://github.com/owncloud/web/pull/9436): Add
error log to upload dialog
https://github.com/owncloud/ocis/pull/7107
https://github.com/owncloud/web/releases/tag/v7.1.0
* Enhancement - Allow disabling wopi chat: [#6544](https://github.com/owncloud/ocis/pull/6544)
Add a configreva for the new reva disable-chat feature
@@ -4976,7 +5055,7 @@ The following sections list the changes for 2.0.0.
The following sections list the changes for 1.20.0.
[1.20.0]: https://github.com/owncloud/ocis/compare/v1.19.0...v1.20.0
[1.20.0]: https://github.com/owncloud/ocis/compare/v1.19.1...v1.20.0
## Summary
@@ -5144,11 +5223,28 @@ The following sections list the changes for 1.20.0.
Group member remove
https://github.com/owncloud/ocis/pull/3467
# Changelog for [1.19.1] (2022-03-29)
The following sections list the changes for 1.19.1.
[1.19.1]: https://github.com/owncloud/ocis/compare/v1.19.0...v1.19.1
## Summary
* Bugfix - Return correct special item urls: [#3419](https://github.com/owncloud/ocis/pull/3419)
## Details
* Bugfix - Return correct special item urls: [#3419](https://github.com/owncloud/ocis/pull/3419)
URLs for Special items (space image, readme) were broken.
https://github.com/owncloud/ocis/pull/3419
# Changelog for [1.19.0] (2022-03-29)
The following sections list the changes for 1.19.0.
[1.19.0]: https://github.com/owncloud/ocis/compare/v1.19.1...v1.19.0
[1.19.0]: https://github.com/owncloud/ocis/compare/v1.18.0...v1.19.0
## Summary
@@ -5317,23 +5413,6 @@ The following sections list the changes for 1.19.0.
https://github.com/owncloud/ocis/pull/3291
https://github.com/owncloud/ocis/pull/3375
https://github.com/owncloud/web/releases/tag/v5.3.0
# Changelog for [1.19.1] (2022-03-29)
The following sections list the changes for 1.19.1.
[1.19.1]: https://github.com/owncloud/ocis/compare/v1.18.0...v1.19.1
## Summary
* Bugfix - Return correct special item urls: [#3419](https://github.com/owncloud/ocis/pull/3419)
## Details
* Bugfix - Return correct special item urls: [#3419](https://github.com/owncloud/ocis/pull/3419)
URLs for Special items (space image, readme) were broken.
https://github.com/owncloud/ocis/pull/3419
# Changelog for [1.18.0] (2022-03-03)
The following sections list the changes for 1.18.0.
+6
View File
@@ -0,0 +1,6 @@
Bugfix: Bump reva to 2.16.1
* Bugfix [cs3org/reva#4194](https://github.com/cs3org/reva/pull/4194): Make appctx package compatible with go v1.21
* Bugfix [cs3org/reva#4214](https://github.com/cs3org/reva/pull/4214): Always pass adjusted default nats options
https://github.com/owncloud/ocis/pull/7350
@@ -0,0 +1,6 @@
Bugfix: Do not reset received share state to pending
We fixed a problem where the states of received shares were reset to PENDING
in the "ocis migrate rebuild-jsoncs3-indexes" command
https://github.com/owncloud/ocis/issues/7319
@@ -0,0 +1,6 @@
Bugfix: Check school number for duplicates before adding a school
We fixed an issue that allowed to create two schools with the same school number
https://github.com/owncloud/ocis/pull/7351
https://github.com/owncloud/enterprise/issues/6051
@@ -0,0 +1,6 @@
Bugfix: Disable username validation for keycloak example
Set 'GRAPH_USERNAME_MATCH' to 'none'. To accept any username that is
also valid for keycloak.
https://github.com/owncloud/ocis/pull/7230
@@ -0,0 +1,3 @@
Bugfix: actually pass PROXY_OIDC_SKIP_USER_INFO option to oidc client middleware
https://github.com/owncloud/ocis/pull/7220
@@ -0,0 +1,7 @@
Bugfix: Bring back the USERS_LDAP_USER_SCHEMA_ID variable
We reintroduced the USERS_LDAP_USER_SCHEMA_ID variable which was accidently removed from the users service
with the 4.0.0 release.
https://github.com/owncloud/ocis/issues/7312
https://github.com/owncloud/ocis-charts/issues/397
@@ -0,0 +1,11 @@
Enhancement: Add OCIS_LDAP_BIND_PASSWORD as replacement for LDAP_BIND_PASSWORD
The enviroment variable `OCIS_LDAP_BIND_PASSWORD` was added to be more consistent with all
other global LDAP variables.
`LDAP_BIND_PASSWORD` is deprecated now and scheduled for removal with the 5.0.0 release.
We also deprecated `LDAP_USER_SCHEMA_ID_IS_OCTETSTRING` for removal with 5.0.0.
The replacement for it is `OCIS_LDAP_USER_SCHEMA_ID_IS_OCTETSTRING`.
https://github.com/owncloud/ocis/issues/7176
@@ -76,6 +76,7 @@ services:
OCIS_ADMIN_USER_ID: ""
OCIS_EXCLUDE_RUN_SERVICES: "idp"
GRAPH_ASSIGN_DEFAULT_USER_ROLE: "false"
GRAPH_USERNAME_MATCH: "none"
volumes:
- ocis-config:/etc/ocis
- ocis-data:/var/lib/ocis
+54 -1
View File
@@ -80,6 +80,17 @@ make -C tests/acceptance/docker test-ocis-feature-ocis-storage
{{< /hint >}}
{{< hint info >}}
To run the tests that require tika service (tests tagged with `@tikaServiceNeeded`), you need to provide `START_TIKA=true` while running the tests.
```bash
START_TIKA=true \
BEHAT_FEATURE='tests/acceptance/features/apiSearch/contentSearch.feature' \
make -C tests/acceptance/docker test-ocis-feature-ocis-storage
```
{{< /hint >}}
{{< hint info >}}
To run the tests that require an antivirus service (tests tagged with `@antivirus`), you need to provide the following environment variables while running the tests.
@@ -376,6 +387,48 @@ BEHAT_FEATURE="tests/acceptance/features/apiNotification/emailNotification.featu
make test-acceptance-api
```
## Running Test Suite With Tika Service (@tikaServiceNeeded)
Test suites that are tagged with `@tikaServiceNeeded` require tika service.
### Setup Tika Service
Run the following docker command to setup tika service
```bash
docker run -d -p 127.0.0.1:9998:9998 apache/tika
```
### Run oCIS
Documentation related to the content based search and tika extractor can be found [here](https://doc.owncloud.com/ocis/next/deployment/services/s-list/search.html#content-extraction)
```bash
# init oCIS
IDM_ADMIN_PASSWORD=admin \
ocis/bin/ocis init --insecure true
# run oCIS
PROXY_ENABLE_BASIC_AUTH=true \
OCIS_INSECURE=true \
SEARCH_EXTRACTOR_TYPE=tika \
SEARCH_EXTRACTOR_TIKA_TIKA_URL=http://localhost:9998 \
SEARCH_EXTRACTOR_CS3SOURCE_INSECURE=true \
ocis/bin/ocis server
```
### Run the Acceptance Test
Run the acceptance test with the following command:
```bash
TEST_WITH_GRAPH_API=true \
TEST_OCIS=true \
TEST_SERVER_URL="https://localhost:9200" \
BEHAT_FEATURE="tests/acceptance/features/apiSearch/contentSearch.feature" \
make test-acceptance-api
```
## Running Tests for Parallel Deployment
### Setup the Parallel Deployment Environment
@@ -450,7 +503,7 @@ The commands are ubuntu specific and may differ according to your system. You ca
##### Mac OS user
Install ClamAV using [here](https://gist.github.com/mendozao/3ea393b91f23a813650baab9964425b9)
Start ClamAV daemon
Start ClamAV daemon
```bash
/your/location/to/brew/Cellar/clamav/1.1.0/sbin/clamd
```
+1 -1
View File
@@ -13,7 +13,7 @@ require (
github.com/coreos/go-oidc v2.2.1+incompatible
github.com/coreos/go-oidc/v3 v3.6.0
github.com/cs3org/go-cs3apis v0.0.0-20230516150832-730ac860c71d
github.com/cs3org/reva/v2 v2.16.0
github.com/cs3org/reva/v2 v2.16.1
github.com/disintegration/imaging v1.6.2
github.com/dutchcoders/go-clamd v0.0.0-20170520113014-b970184f4d9e
github.com/egirna/icap-client v0.1.1
+2 -4
View File
@@ -864,10 +864,8 @@ github.com/crewjam/httperr v0.2.0 h1:b2BfXR8U3AlIHwNeFFvZ+BV1LFvKLlzMjzaTnZMybNo
github.com/crewjam/httperr v0.2.0/go.mod h1:Jlz+Sg/XqBQhyMjdDiC+GNNRzZTD7x39Gu3pglZ5oH4=
github.com/crewjam/saml v0.4.13 h1:TYHggH/hwP7eArqiXSJUvtOPNzQDyQ7vwmwEqlFWhMc=
github.com/crewjam/saml v0.4.13/go.mod h1:igEejV+fihTIlHXYP8zOec3V5A8y3lws5bQBFsTm4gA=
github.com/cs3org/reva/v2 v2.15.1-0.20230816081257-e3a2be91bc4f h1:s0sBJbIB8atyhujVx/OaadujuRHer8ODPpWxyGWfw/s=
github.com/cs3org/reva/v2 v2.15.1-0.20230816081257-e3a2be91bc4f/go.mod h1:6GyXffmxluCqQxXaYuVC2Dg10gj0QW199iVlxV0EAJg=
github.com/cs3org/reva/v2 v2.16.0 h1:XBFoGhzKrcDqqRvYdicOpDOpQVIsRqALmEt8X0N+wm0=
github.com/cs3org/reva/v2 v2.16.0/go.mod h1:RvhuweTFqzezjUFU0SIdTXakrEx9vJlMvQ7znPXSP1g=
github.com/cs3org/reva/v2 v2.16.1 h1:mJA3Vg5nrrOXx1CcGUKrZ+gBR6bhRSqkVY2pqD3G55Q=
github.com/cs3org/reva/v2 v2.16.1/go.mod h1:RvhuweTFqzezjUFU0SIdTXakrEx9vJlMvQ7znPXSP1g=
github.com/cyberdelia/templates v0.0.0-20141128023046-ca7fffd4298c/go.mod h1:GyV+0YP4qX0UQ7r2MoYZ+AvYDp12OF5yg4q8rGnyNh4=
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
+1 -1
View File
@@ -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 = "4.0.0+dev"
LatestTag = "4.0.2+dev"
// Date indicates the build date.
// This has been removed, it looks like you can only replace static strings with recent go versions
+12 -6
View File
@@ -162,14 +162,20 @@ func RebuildJSONCS3Indexes(cfg *config.Config) *cli.Command {
switch share.Grantee.Type {
case provider.GranteeType_GRANTEE_TYPE_USER:
userid := share.Grantee.GetUserId().GetOpaqueId()
rs := &collaboration.ReceivedShare{
Share: share,
State: collaboration.ShareState_SHARE_STATE_PENDING,
}
err := mgr.UserReceivedStates.Add(ctx, userid, spaceId, rs)
existingState, err := mgr.UserReceivedStates.Get(ctx, userid, spaceId, share.Id.OpaqueId)
if err != nil {
fmt.Printf(" adding share '%s' to the user cache failed! (%s)\n", share.Id.OpaqueId, err.Error())
fmt.Printf(" retrieving current state of received share '%s' from the user cache failed! (%s)\n", share.Id.OpaqueId, err.Error())
errorsOccured = true
} else if existingState == nil {
rs := &collaboration.ReceivedShare{
Share: share,
State: collaboration.ShareState_SHARE_STATE_PENDING,
}
err := mgr.UserReceivedStates.Add(ctx, userid, spaceId, rs)
if err != nil {
fmt.Printf(" adding share '%s' to the user cache failed! (%s)\n", share.Id.OpaqueId, err.Error())
errorsOccured = true
}
}
case provider.GranteeType_GRANTEE_TYPE_GROUP:
groupid := share.Grantee.GetGroupId().GetOpaqueId()
+1 -1
View File
@@ -66,7 +66,7 @@ type LDAPProvider struct {
CACert string `yaml:"ca_cert" env:"OCIS_LDAP_CACERT;AUTH_BASIC_LDAP_CACERT" desc:"Path/File name for the root CA certificate (in PEM format) used to validate TLS server certificates of the LDAP service. If not defined, the root directory derives from $OCIS_BASE_DATA_PATH:/idm."`
Insecure bool `yaml:"insecure" env:"OCIS_LDAP_INSECURE;AUTH_BASIC_LDAP_INSECURE" desc:"Disable TLS certificate validation for the LDAP connections. Do not set this in production environments."`
BindDN string `yaml:"bind_dn" env:"OCIS_LDAP_BIND_DN;AUTH_BASIC_LDAP_BIND_DN" desc:"LDAP DN to use for simple bind authentication with the target LDAP server."`
BindPassword string `yaml:"bind_password" env:"LDAP_BIND_PASSWORD;AUTH_BASIC_LDAP_BIND_PASSWORD" desc:"Password to use for authenticating the 'bind_dn'."`
BindPassword string `yaml:"bind_password" env:"OCIS_LDAP_BIND_PASSWORD;LDAP_BIND_PASSWORD;AUTH_BASIC_LDAP_BIND_PASSWORD" desc:"Password to use for authenticating the 'bind_dn'." deprecationVersion:"4.0.2" removalVersion:"5.0.0" deprecationInfo:"LDAP_BIND_PASSWORD changing name for consistency" deprecationReplacement:"OCIS_LDAP_BIND_PASSWORD"`
UserBaseDN string `yaml:"user_base_dn" env:"OCIS_LDAP_USER_BASE_DN;AUTH_BASIC_LDAP_USER_BASE_DN" desc:"Search base DN for looking up LDAP users."`
GroupBaseDN string `yaml:"group_base_dn" env:"OCIS_LDAP_GROUP_BASE_DN;AUTH_BASIC_LDAP_GROUP_BASE_DN" desc:"Search base DN for looking up LDAP groups."`
UserScope string `yaml:"user_scope" env:"OCIS_LDAP_USER_SCOPE;AUTH_BASIC_LDAP_USER_SCOPE" desc:"LDAP search scope to use when looking up users. Supported values are 'base', 'one' and 'sub'."`
+1 -1
View File
@@ -50,7 +50,7 @@ type LDAP struct {
CACert string `yaml:"cacert" env:"OCIS_LDAP_CACERT;GRAPH_LDAP_CACERT" desc:"Path/File name for the root CA certificate (in PEM format) used to validate TLS server certificates of the LDAP service. If not defined, the root directory derives from $OCIS_BASE_DATA_PATH:/idm."`
Insecure bool `yaml:"insecure" env:"OCIS_LDAP_INSECURE;GRAPH_LDAP_INSECURE" desc:"Disable TLS certificate validation for the LDAP connections. Do not set this in production environments."`
BindDN string `yaml:"bind_dn" env:"OCIS_LDAP_BIND_DN;GRAPH_LDAP_BIND_DN" desc:"LDAP DN to use for simple bind authentication with the target LDAP server."`
BindPassword string `yaml:"bind_password" env:"LDAP_BIND_PASSWORD;GRAPH_LDAP_BIND_PASSWORD" desc:"Password to use for authenticating the 'bind_dn'."`
BindPassword string `yaml:"bind_password" env:"OCIS_LDAP_BIND_PASSWORD;LDAP_BIND_PASSWORD;GRAPH_LDAP_BIND_PASSWORD" desc:"Password to use for authenticating the 'bind_dn'." deprecationVersion:"4.0.2" removalVersion:"5.0.0" deprecationInfo:"LDAP_BIND_PASSWORD changing name for consistency" deprecationReplacement:"OCIS_LDAP_BIND_PASSWORD"`
UseServerUUID bool `yaml:"use_server_uuid" env:"GRAPH_LDAP_SERVER_UUID" desc:"If set to true, rely on the LDAP Server to generate a unique ID for users and groups, like when using 'entryUUID' as the user ID attribute."`
UsePasswordModExOp bool `yaml:"use_password_modify_exop" env:"GRAPH_LDAP_SERVER_USE_PASSWORD_MODIFY_EXOP" desc:"Use the 'Password Modify Extended Operation' for updating user passwords."`
WriteEnabled bool `yaml:"write_enabled" env:"OCIS_LDAP_SERVER_WRITE_ENABLED;GRAPH_LDAP_SERVER_WRITE_ENABLED" desc:"Allow creating, modifying and deleting LDAP users via the GRAPH API. This can only be set to 'true' when keeping default settings for the LDAP user and group attribute types (the 'OCIS_LDAP_USER_SCHEMA_* and 'OCIS_LDAP_GROUP_SCHEMA_* variables)."`
@@ -72,9 +72,7 @@ func TestGetEducationClasses(t *testing.T) {
lm.On("Search", mock.Anything).Return(nil, ldap.NewError(ldap.LDAPResultOperationsError, errors.New("mock")))
b, _ := getMockedBackend(lm, lconfig, &logger)
_, err := b.GetEducationClasses(context.Background())
if err == nil || err.Error() != "itemNotFound" {
t.Errorf("Expected 'itemNotFound' got '%s'", err.Error())
}
assert.ErrorContains(t, err, "itemNotFound:")
lm = &mocks.Client{}
lm.On("Search", mock.Anything).Return(&ldap.SearchResult{}, nil)
@@ -156,7 +154,7 @@ func TestGetEducationClass(t *testing.T) {
if tt.expectedItemNotFound {
assert.NotNil(t, err)
assert.Equal(t, "itemNotFound", err.Error())
assert.Equal(t, "itemNotFound: not found", err.Error())
} else {
assert.Nil(t, err)
assert.Equal(t, "Math", class.GetDisplayName())
@@ -228,7 +226,7 @@ func TestDeleteEducationClass(t *testing.T) {
if tt.expectedItemNotFound {
lm.AssertNumberOfCalls(t, "Del", 0)
assert.NotNil(t, err)
assert.Equal(t, "itemNotFound", err.Error())
assert.Equal(t, "itemNotFound: not found", err.Error())
} else {
assert.Nil(t, err)
}
@@ -301,7 +299,7 @@ func TestGetEducationClassMembers(t *testing.T) {
if tt.expectedItemNotFound {
lm.AssertNumberOfCalls(t, "Search", 1)
assert.NotNil(t, err)
assert.Equal(t, "itemNotFound", err.Error())
assert.Equal(t, "itemNotFound: not found", err.Error())
} else {
lm.AssertNumberOfCalls(t, "Search", 2)
assert.Nil(t, err)
@@ -49,7 +49,11 @@ const (
const ldapDateFormat = "20060102150405Z0700"
var errNotSet = errors.New("Attribute not set")
var (
errNotSet = errors.New("Attribute not set")
errSchoolNameExists = errorcode.New(errorcode.NameAlreadyExists, "A school with that name is already present")
errSchoolNumberExists = errorcode.New(errorcode.NameAlreadyExists, "A school with that number is already present")
)
func defaultEducationConfig() educationConfig {
return educationConfig{
@@ -116,7 +120,18 @@ func (i *LDAP) CreateEducationSchool(ctx context.Context, school libregraph.Educ
return nil, ErrReadOnly
}
// Here we should verify that the school number is not already used
// Check that the school number is not already used
_, err := i.getSchoolByNumber(school.GetSchoolNumber())
switch err {
case nil:
logger.Debug().Err(errSchoolNumberExists).Str("schoolNumber", school.GetSchoolNumber()).Msg("duplicate school number")
return nil, errSchoolNumberExists
case ErrNotFound:
break
default:
logger.Error().Err(err).Str("schoolNumber", school.GetSchoolNumber()).Msg("error looking up school by number")
return nil, errorcode.New(errorcode.GeneralException, "error looking up school by number")
}
attributeTypeAndValue := ldap.AttributeTypeAndValue{
Type: i.educationConfig.schoolAttributeMap.displayName,
@@ -141,7 +156,7 @@ func (i *LDAP) CreateEducationSchool(ctx context.Context, school libregraph.Educ
logger.Debug().Err(err).Msg("error adding school")
if errors.As(err, &lerr) {
if lerr.ResultCode == ldap.LDAPResultEntryAlreadyExists {
err = errorcode.New(errorcode.NameAlreadyExists, lerr.Error())
err = errSchoolNameExists
}
}
return nil, err
@@ -156,7 +171,7 @@ func (i *LDAP) CreateEducationSchool(ctx context.Context, school libregraph.Educ
}
// UpdateEducationSchoolOperation contains the logic for which update operation to apply to a school
func (i *LDAP) UpdateEducationSchoolOperation(
func (i *LDAP) updateEducationSchoolOperation(
schoolUpdate libregraph.EducationSchool,
currentSchool libregraph.EducationSchool,
) schoolUpdateOperation {
@@ -216,7 +231,7 @@ func (i *LDAP) updateDisplayName(ctx context.Context, dn string, providedDisplay
logger.Debug().Err(err).Msg("error updating school name")
if errors.As(err, &lerr) {
if lerr.ResultCode == ldap.LDAPResultEntryAlreadyExists {
err = errorcode.New(errorcode.NameAlreadyExists, lerr.Error())
err = errSchoolNameExists
}
}
return err
@@ -233,11 +248,9 @@ func (i *LDAP) updateSchoolProperties(ctx context.Context, dn string, currentSch
mr := ldap.NewModifyRequest(dn, nil)
if updatedSchoolNumber, ok := updatedSchool.GetSchoolNumberOk(); ok {
if *updatedSchoolNumber != "" && currentSchool.GetSchoolNumber() != *updatedSchoolNumber {
_, err := i.getSchoolByNumberOrID(*updatedSchoolNumber)
_, err := i.getSchoolByNumber(*updatedSchoolNumber)
if err == nil {
errmsg := fmt.Sprintf("school number '%s' already exists", *updatedSchoolNumber)
err = fmt.Errorf(errmsg)
return err
return errSchoolNumberExists
}
mr.Replace(i.educationConfig.schoolAttributeMap.schoolNumber, []string{*updatedSchoolNumber})
}
@@ -255,13 +268,7 @@ func (i *LDAP) updateSchoolProperties(ctx context.Context, dn string, currentSch
}
if err := i.conn.Modify(mr); err != nil {
var lerr *ldap.Error
logger.Debug().Err(err).Msg("error updating school number")
if errors.As(err, &lerr) {
if lerr.ResultCode == ldap.LDAPResultEntryAlreadyExists {
err = errorcode.New(errorcode.NameAlreadyExists, lerr.Error())
}
}
return err
}
@@ -282,7 +289,7 @@ func (i *LDAP) UpdateEducationSchool(ctx context.Context, numberOrID string, sch
}
currentSchool := i.createSchoolModelFromLDAP(e)
switch i.UpdateEducationSchoolOperation(school, *currentSchool) {
switch i.updateEducationSchoolOperation(school, *currentSchool) {
case tooManyValues:
return nil, fmt.Errorf("school name and school number cannot be updated in the same request")
case schoolUnchanged:
@@ -635,17 +642,12 @@ func (i *LDAP) RemoveClassFromEducationSchool(ctx context.Context, schoolNumberO
}
func (i *LDAP) getSchoolByDN(dn string) (*ldap.Entry, error) {
attrs := []string{
i.educationConfig.schoolAttributeMap.displayName,
i.educationConfig.schoolAttributeMap.id,
i.educationConfig.schoolAttributeMap.schoolNumber,
}
filter := fmt.Sprintf("(objectClass=%s)", i.educationConfig.schoolObjectClass)
if i.educationConfig.schoolFilter != "" {
filter = fmt.Sprintf("(&%s(%s))", filter, i.educationConfig.schoolFilter)
}
return i.getEntryByDN(dn, attrs, filter)
return i.getEntryByDN(dn, i.getEducationSchoolAttrTypes(), filter)
}
func (i *LDAP) getSchoolByNumberOrID(numberOrID string) (*ldap.Entry, error) {
@@ -660,6 +662,16 @@ func (i *LDAP) getSchoolByNumberOrID(numberOrID string) (*ldap.Entry, error) {
return i.getSchoolByFilter(filter)
}
func (i *LDAP) getSchoolByNumber(schoolNumber string) (*ldap.Entry, error) {
schoolNumber = ldap.EscapeFilter(schoolNumber)
filter := fmt.Sprintf(
"(%s=%s)",
i.educationConfig.schoolAttributeMap.schoolNumber,
schoolNumber,
)
return i.getSchoolByFilter(filter)
}
func (i *LDAP) getSchoolByFilter(filter string) (*ldap.Entry, error) {
filter = fmt.Sprintf("(&%s(objectClass=%s)%s)",
i.educationConfig.schoolFilter,
@@ -2,6 +2,7 @@ package identity
import (
"context"
"errors"
"testing"
"time"
@@ -9,6 +10,7 @@ import (
libregraph "github.com/owncloud/libre-graph-api-go"
"github.com/owncloud/ocis/v2/services/graph/mocks"
"github.com/owncloud/ocis/v2/services/graph/pkg/config"
"github.com/owncloud/ocis/v2/services/graph/pkg/service/v0/errorcode"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/mock"
)
@@ -67,45 +69,135 @@ var (
)
func TestCreateEducationSchool(t *testing.T) {
lm := &mocks.Client{}
ldapSchoolAddRequestMatcher := func(ar *ldap.AddRequest) bool {
if ar.DN != "ou=Test School," {
return false
}
for _, attr := range ar.Attributes {
if attr.Type == "ocEducationSchoolTerminationTimestamp" {
tests := []struct {
name string
schoolNumber string
schoolName string
expectedError error
}{
{
name: "Create a Education School succeeds",
schoolNumber: "0123",
schoolName: "Test School",
expectedError: nil,
}, {
name: "Create a Education School with a duplicated Schoolnumber fails with an error",
schoolNumber: "0666",
schoolName: "Test School",
expectedError: errorcode.New(errorcode.NameAlreadyExists, "A school with that number is already present"),
}, {
name: "Create a Education School with a duplicated Name fails with an error",
schoolNumber: "0123",
schoolName: "Existing Test School",
expectedError: errorcode.New(errorcode.NameAlreadyExists, "A school with that name is already present"),
}, {
name: "Create a Education School fails, when there is a backend error",
schoolNumber: "1111",
schoolName: "Test School",
expectedError: errorcode.New(errorcode.GeneralException, "error looking up school by number"),
},
}
for _, tt := range tests {
lm := &mocks.Client{}
ldapSchoolGoodAddRequestMatcher := func(ar *ldap.AddRequest) bool {
if ar.DN != "ou=Test School," {
return false
}
for _, attr := range ar.Attributes {
if attr.Type == "ocEducationSchoolTerminationTimestamp" {
return false
}
}
return true
}
lm.On("Add", mock.MatchedBy(ldapSchoolGoodAddRequestMatcher)).Return(nil)
ldapExistingSchoolAddRequestMatcher := func(ar *ldap.AddRequest) bool {
if ar.DN == "ou=Existing Test School," {
return true
}
return false
}
lm.On("Add", mock.MatchedBy(ldapExistingSchoolAddRequestMatcher)).Return(ldap.NewError(ldap.LDAPResultEntryAlreadyExists, errors.New("")))
schoolNumberSearchRequest := &ldap.SearchRequest{
BaseDN: "",
Scope: 2,
SizeLimit: 1,
Filter: "(&(objectClass=ocEducationSchool)(ocEducationSchoolNumber=0123))",
Attributes: []string{"ou", "owncloudUUID", "ocEducationSchoolNumber", "ocEducationSchoolTerminationTimestamp"},
Controls: []ldap.Control(nil),
}
lm.On("Search", schoolNumberSearchRequest).
Return(
&ldap.SearchResult{
Entries: []*ldap.Entry{},
},
nil)
existingSchoolNumberSearchRequest := &ldap.SearchRequest{
BaseDN: "",
Scope: 2,
SizeLimit: 1,
Filter: "(&(objectClass=ocEducationSchool)(ocEducationSchoolNumber=0666))",
Attributes: []string{"ou", "owncloudUUID", "ocEducationSchoolNumber", "ocEducationSchoolTerminationTimestamp"},
Controls: []ldap.Control(nil),
}
lm.On("Search", existingSchoolNumberSearchRequest).
Return(
&ldap.SearchResult{
Entries: []*ldap.Entry{schoolEntry},
},
nil)
schoolNumberSearchRequestError := &ldap.SearchRequest{
BaseDN: "",
Scope: 2,
SizeLimit: 1,
Filter: "(&(objectClass=ocEducationSchool)(ocEducationSchoolNumber=1111))",
Attributes: []string{"ou", "owncloudUUID", "ocEducationSchoolNumber", "ocEducationSchoolTerminationTimestamp"},
Controls: []ldap.Control(nil),
}
lm.On("Search", schoolNumberSearchRequestError).
Return(
&ldap.SearchResult{
Entries: []*ldap.Entry{},
},
ldap.NewError(ldap.LDAPResultOther, errors.New("some error")))
schoolLookupAfterCreate := &ldap.SearchRequest{
BaseDN: "ou=Test School,",
Scope: 0,
SizeLimit: 1,
Filter: "(objectClass=ocEducationSchool)",
Attributes: []string{"ou", "owncloudUUID", "ocEducationSchoolNumber", "ocEducationSchoolTerminationTimestamp"},
Controls: []ldap.Control(nil),
}
lm.On("Search", schoolLookupAfterCreate).
Return(
&ldap.SearchResult{
Entries: []*ldap.Entry{schoolEntry},
},
nil)
b, err := getMockedBackend(lm, eduConfig, &logger)
assert.Nil(t, err)
assert.NotEqual(t, "", b.educationConfig.schoolObjectClass)
school := libregraph.NewEducationSchool()
school.SetDisplayName(tt.schoolName)
school.SetSchoolNumber(tt.schoolNumber)
school.SetId("abcd-defg")
res_school, err := b.CreateEducationSchool(context.Background(), *school)
if tt.expectedError == nil {
assert.Nil(t, err)
lm.AssertNumberOfCalls(t, "Add", 1)
assert.NotNil(t, res_school)
assert.Equal(t, res_school.GetDisplayName(), school.GetDisplayName())
assert.Equal(t, res_school.GetId(), school.GetId())
assert.Equal(t, res_school.GetSchoolNumber(), school.GetSchoolNumber())
assert.False(t, res_school.HasTerminationDate())
} else {
assert.Equal(t, err, tt.expectedError)
assert.Nil(t, res_school)
}
return true
}
lm.On("Add", mock.MatchedBy(ldapSchoolAddRequestMatcher)).Return(nil)
lm.On("Search", mock.Anything).
Return(
&ldap.SearchResult{
Entries: []*ldap.Entry{schoolEntry},
},
nil)
b, err := getMockedBackend(lm, eduConfig, &logger)
assert.Nil(t, err)
assert.NotEqual(t, "", b.educationConfig.schoolObjectClass)
school := libregraph.NewEducationSchool()
school.SetDisplayName("Test School")
school.SetSchoolNumber("0123")
school.SetId("abcd-defg")
res_school, err := b.CreateEducationSchool(context.Background(), *school)
lm.AssertNumberOfCalls(t, "Add", 1)
lm.AssertNumberOfCalls(t, "Search", 1)
assert.Nil(t, err)
assert.NotNil(t, res_school)
assert.Equal(t, res_school.GetDisplayName(), school.GetDisplayName())
assert.Equal(t, res_school.GetId(), school.GetId())
assert.Equal(t, res_school.GetSchoolNumber(), school.GetSchoolNumber())
assert.False(t, res_school.HasTerminationDate())
}
func TestUpdateEducationSchoolTerminationDate(t *testing.T) {
@@ -218,7 +310,7 @@ func TestUpdateEducationSchoolOperation(t *testing.T) {
SchoolNumber: &tt.schoolNumber,
}
operation := b.UpdateEducationSchoolOperation(schoolUpdate, currentSchool)
operation := b.updateEducationSchoolOperation(schoolUpdate, currentSchool)
assert.Equal(t, tt.expectedOperation, operation)
}
}
@@ -285,7 +377,7 @@ func TestDeleteEducationSchool(t *testing.T) {
if tt.expectedItemNotFound {
lm.AssertNumberOfCalls(t, "Del", 0)
assert.NotNil(t, err)
assert.Equal(t, "itemNotFound", err.Error())
assert.Equal(t, "itemNotFound: not found", err.Error())
} else {
assert.Nil(t, err)
}
@@ -349,7 +441,7 @@ func TestGetEducationSchool(t *testing.T) {
if tt.expectedItemNotFound {
assert.NotNil(t, err)
assert.Equal(t, "itemNotFound", err.Error())
assert.Equal(t, "itemNotFound: not found", err.Error())
} else {
assert.Nil(t, err)
assert.Equal(t, "Test School", school.GetDisplayName())
@@ -502,7 +594,7 @@ func TestRemoveMemberFromEducationSchool(t *testing.T) {
err = b.RemoveUserFromEducationSchool(context.Background(), "abcd-defg", "does-not-exist")
lm.AssertNumberOfCalls(t, "Search", 2)
assert.NotNil(t, err)
assert.Equal(t, "itemNotFound", err.Error())
assert.Equal(t, "itemNotFound: not found", err.Error())
err = b.RemoveUserFromEducationSchool(context.Background(), "abcd-defg", "abcd-defg")
lm.AssertNumberOfCalls(t, "Search", 4)
lm.AssertNumberOfCalls(t, "Modify", 1)
@@ -613,7 +705,7 @@ func TestRemoveClassFromEducationSchool(t *testing.T) {
err = b.RemoveClassFromEducationSchool(context.Background(), "abcd-defg", "does-not-exist")
lm.AssertNumberOfCalls(t, "Search", 2)
assert.NotNil(t, err)
assert.Equal(t, "itemNotFound", err.Error())
assert.Equal(t, "itemNotFound: not found", err.Error())
err = b.RemoveClassFromEducationSchool(context.Background(), "abcd-defg", "abcd-defg")
lm.AssertNumberOfCalls(t, "Search", 4)
lm.AssertNumberOfCalls(t, "Modify", 1)
@@ -139,7 +139,7 @@ func TestDeleteEducationUser(t *testing.T) {
lm.AssertNumberOfCalls(t, "Search", 2)
lm.AssertNumberOfCalls(t, "Del", 1)
assert.NotNil(t, err)
assert.Equal(t, "itemNotFound", err.Error())
assert.Equal(t, "itemNotFound: not found", err.Error())
}
func TestGetEducationUser(t *testing.T) {
@@ -157,7 +157,7 @@ func TestGetEducationUser(t *testing.T) {
_, err = b.GetEducationUser(context.Background(), "xxxx-xxxx")
lm.AssertNumberOfCalls(t, "Search", 2)
assert.NotNil(t, err)
assert.Equal(t, "itemNotFound", err.Error())
assert.Equal(t, "itemNotFound: not found", err.Error())
}
func TestGetEducationUsers(t *testing.T) {
+10 -30
View File
@@ -59,34 +59,22 @@ func TestGetGroup(t *testing.T) {
b, _ := getMockedBackend(lm, lconfig, &logger)
_, err := b.GetGroup(context.Background(), "group", nil)
if err == nil || err.Error() != "itemNotFound" {
t.Errorf("Expected 'itemNotFound' got '%s'", err.Error())
}
assert.ErrorContains(t, err, "itemNotFound:")
_, err = b.GetGroup(context.Background(), "group", queryParamExpand)
if err == nil || err.Error() != "itemNotFound" {
t.Errorf("Expected 'itemNotFound' got '%s'", err.Error())
}
assert.ErrorContains(t, err, "itemNotFound:")
_, err = b.GetGroup(context.Background(), "group", queryParamSelect)
if err == nil || err.Error() != "itemNotFound" {
t.Errorf("Expected 'itemNotFound' got '%s'", err.Error())
}
assert.ErrorContains(t, err, "itemNotFound:")
// Mock an empty Search Result
lm = &mocks.Client{}
lm.On("Search", mock.Anything).Return(&ldap.SearchResult{}, nil)
b, _ = getMockedBackend(lm, lconfig, &logger)
_, err = b.GetGroup(context.Background(), "group", nil)
if err == nil || err.Error() != "itemNotFound" {
t.Errorf("Expected 'itemNotFound' got '%s'", err.Error())
}
assert.ErrorContains(t, err, "itemNotFound:")
_, err = b.GetGroup(context.Background(), "group", queryParamExpand)
if err == nil || err.Error() != "itemNotFound" {
t.Errorf("Expected 'itemNotFound' got '%s'", err.Error())
}
assert.ErrorContains(t, err, "itemNotFound:")
_, err = b.GetGroup(context.Background(), "group", queryParamSelect)
if err == nil || err.Error() != "itemNotFound" {
t.Errorf("Expected 'itemNotFound' got '%s'", err.Error())
}
assert.ErrorContains(t, err, "itemNotFound:")
// Mock an invalid Search Result
lm = &mocks.Client{}
@@ -95,17 +83,11 @@ func TestGetGroup(t *testing.T) {
}, nil)
b, _ = getMockedBackend(lm, lconfig, &logger)
g, err := b.GetGroup(context.Background(), "group", nil)
if err == nil || err.Error() != "itemNotFound" {
t.Errorf("Expected 'itemNotFound' got '%s'", err.Error())
}
assert.ErrorContains(t, err, "itemNotFound:")
g, err = b.GetGroup(context.Background(), "group", queryParamExpand)
if err == nil || err.Error() != "itemNotFound" {
t.Errorf("Expected 'itemNotFound' got '%s'", err.Error())
}
assert.ErrorContains(t, err, "itemNotFound:")
g, err = b.GetGroup(context.Background(), "group", queryParamSelect)
if err == nil || err.Error() != "itemNotFound" {
t.Errorf("Expected 'itemNotFound' got '%s'", err.Error())
}
assert.ErrorContains(t, err, "itemNotFound:")
// Mock a valid Search Result
lm = &mocks.Client{}
@@ -240,9 +222,7 @@ func TestGetGroups(t *testing.T) {
lm.On("Search", mock.Anything).Return(nil, ldap.NewError(ldap.LDAPResultOperationsError, errors.New("mock")))
b, _ := getMockedBackend(lm, lconfig, &logger)
_, err := b.GetGroups(context.Background(), url.Values{})
if err == nil || err.Error() != "itemNotFound" {
t.Errorf("Expected 'itemNotFound' got '%s'", err.Error())
}
assert.ErrorContains(t, err, "itemNotFound:")
lm = &mocks.Client{}
lm.On("Search", mock.Anything).Return(&ldap.SearchResult{}, nil)
+6 -18
View File
@@ -205,14 +205,10 @@ func TestGetUser(t *testing.T) {
}
_, err = b.GetUser(context.Background(), "fred", odataReqDefault)
if err == nil || err.Error() != "itemNotFound" {
t.Errorf("Expected 'itemNotFound' got '%s'", err.Error())
}
assert.ErrorContains(t, err, "itemNotFound:")
_, err = b.GetUser(context.Background(), "fred", odataReqExpand)
if err == nil || err.Error() != "itemNotFound" {
t.Errorf("Expected 'itemNotFound' got '%s'", err.Error())
}
assert.ErrorContains(t, err, "itemNotFound:")
// Mock an empty Search Result
lm = &mocks.Client{}
@@ -221,14 +217,10 @@ func TestGetUser(t *testing.T) {
&ldap.SearchResult{}, nil)
b, _ = getMockedBackend(lm, lconfig, &logger)
_, err = b.GetUser(context.Background(), "fred", odataReqDefault)
if err == nil || err.Error() != "itemNotFound" {
t.Errorf("Expected 'itemNotFound' got '%s'", err.Error())
}
assert.ErrorContains(t, err, "itemNotFound:")
_, err = b.GetUser(context.Background(), "fred", odataReqExpand)
if err == nil || err.Error() != "itemNotFound" {
t.Errorf("Expected 'itemNotFound' got '%s'", err.Error())
}
assert.ErrorContains(t, err, "itemNotFound:")
// Mock a valid Search Result
lm = &mocks.Client{}
@@ -265,9 +257,7 @@ func TestGetUser(t *testing.T) {
b, _ = getMockedBackend(lm, lconfig, &logger)
_, err = b.GetUser(context.Background(), "invalid", nil)
if err == nil || err.Error() != "itemNotFound" {
t.Errorf("Expected 'itemNotFound' got '%s'", err.Error())
}
assert.ErrorContains(t, err, "itemNotFound:")
}
func TestGetUsers(t *testing.T) {
@@ -283,9 +273,7 @@ func TestGetUsers(t *testing.T) {
b, _ := getMockedBackend(lm, lconfig, &logger)
_, err = b.GetUsers(context.Background(), odataReqDefault)
if err == nil || err.Error() != "generalException" {
t.Errorf("Expected 'generalException' got '%s'", err.Error())
}
assert.ErrorContains(t, err, "generalException:")
lm = &mocks.Client{}
lm.On("Search", mock.Anything).Return(&ldap.SearchResult{}, nil)
@@ -148,7 +148,7 @@ func (g Graph) PatchEducationSchool(w http.ResponseWriter, r *http.Request) {
if school, err = g.identityEducationBackend.UpdateEducationSchool(r.Context(), schoolID, *school); err != nil {
logger.Debug().Err(err).Interface("school", school).Msg("could not update school: backend error")
errorcode.GeneralException.Render(w, r, http.StatusInternalServerError, err.Error())
errorcode.RenderError(w, r, err)
return
}
@@ -1,3 +1,4 @@
// Package errorcode allows to deal with graph error codes
package errorcode
import (
@@ -13,6 +14,7 @@ import (
// ErrorCode defines code as used in MS Graph - see https://docs.microsoft.com/en-us/graph/errors?context=graph%2Fapi%2F1.0&view=graph-rest-1.0
type ErrorCode int
// Error defines a custom error struct, containing and MS Graph error code an a textual error message
type Error struct {
errorCode ErrorCode
msg string
@@ -75,6 +77,7 @@ var errorCodes = [...]string{
"preconditionFailed",
}
// New constructs a new errorcode.Error
func New(e ErrorCode, msg string) Error {
return Error{
errorCode: e,
@@ -82,7 +85,7 @@ func New(e ErrorCode, msg string) Error {
}
}
// Render writes an Graph ErrorObject to the response writer
// Render writes an Graph ErrorCode object to the response writer
func (e ErrorCode) Render(w http.ResponseWriter, r *http.Request, status int, msg string) {
innererror := map[string]interface{}{
"date": time.Now().UTC().Format(time.RFC3339),
@@ -100,6 +103,7 @@ func (e ErrorCode) Render(w http.ResponseWriter, r *http.Request, status int, ms
render.JSON(w, r, resp)
}
// Render writes an Graph Error object to the response writer
func (e Error) Render(w http.ResponseWriter, r *http.Request) {
var status int
switch e.errorCode {
@@ -115,12 +119,18 @@ func (e Error) Render(w http.ResponseWriter, r *http.Request) {
e.errorCode.Render(w, r, status, e.msg)
}
// String returns the string corresponding to the ErrorCode
func (e ErrorCode) String() string {
return errorCodes[e]
}
// Error return the concatenation of the error string and optinal message
func (e Error) Error() string {
return errorCodes[e.errorCode]
errString := errorCodes[e.errorCode]
if e.msg != "" {
errString += ": " + e.msg
}
return errString
}
// RenderError render the Graph Error based on a code or default one
+1 -1
View File
@@ -65,7 +65,7 @@ type LDAPDriver struct {
CACert string `yaml:"ca_cert" env:"OCIS_LDAP_CACERT;GROUPS_LDAP_CACERT" desc:"Path/File name for the root CA certificate (in PEM format) used to validate TLS server certificates of the LDAP service. If not defined, the root directory derives from $OCIS_BASE_DATA_PATH:/idm."`
Insecure bool `yaml:"insecure" env:"OCIS_LDAP_INSECURE;GROUPS_LDAP_INSECURE" desc:"Disable TLS certificate validation for the LDAP connections. Do not set this in production environments."`
BindDN string `yaml:"bind_dn" env:"OCIS_LDAP_BIND_DN;GROUPS_LDAP_BIND_DN" desc:"LDAP DN to use for simple bind authentication with the target LDAP server."`
BindPassword string `yaml:"bind_password" env:"LDAP_BIND_PASSWORD;GROUPS_LDAP_BIND_PASSWORD" desc:"Password to use for authenticating the 'bind_dn'."`
BindPassword string `yaml:"bind_password" env:"OCIS_LDAP_BIND_PASSWORD;LDAP_BIND_PASSWORD;GROUPS_LDAP_BIND_PASSWORD" desc:"Password to use for authenticating the 'bind_dn'." deprecationVersion:"4.0.2" removalVersion:"5.0.0" deprecationInfo:"LDAP_BIND_PASSWORD changing name for consistency" deprecationReplacement:"OCIS_LDAP_BIND_PASSWORD"`
UserBaseDN string `yaml:"user_base_dn" env:"OCIS_LDAP_USER_BASE_DN;GROUPS_LDAP_USER_BASE_DN" desc:"Search base DN for looking up LDAP users."`
GroupBaseDN string `yaml:"group_base_dn" env:"OCIS_LDAP_GROUP_BASE_DN;GROUPS_LDAP_GROUP_BASE_DN" desc:"Search base DN for looking up LDAP groups."`
UserScope string `yaml:"user_scope" env:"OCIS_LDAP_USER_SCOPE;GROUPS_LDAP_USER_SCOPE" desc:"LDAP search scope to use when looking up users. Supported scopes are 'base', 'one' and 'sub'."`
+1 -1
View File
@@ -36,7 +36,7 @@ type Ldap struct {
TLSCACert string `yaml:"cacert" env:"OCIS_LDAP_CACERT;IDP_LDAP_TLS_CACERT" desc:"Path/File name for the root CA certificate (in PEM format) used to validate TLS server certificates of the LDAP service. If not defined, the root directory derives from $OCIS_BASE_DATA_PATH:/idp."`
BindDN string `yaml:"bind_dn" env:"OCIS_LDAP_BIND_DN;IDP_LDAP_BIND_DN" desc:"LDAP DN to use for simple bind authentication with the target LDAP server."`
BindPassword string `yaml:"bind_password" env:"LDAP_BIND_PASSWORD;IDP_LDAP_BIND_PASSWORD" desc:"Password to use for authenticating the 'bind_dn'."`
BindPassword string `yaml:"bind_password" env:"OCIS_LDAP_BIND_PASSWORD;LDAP_BIND_PASSWORD;IDP_LDAP_BIND_PASSWORD" desc:"Password to use for authenticating the 'bind_dn'." deprecationVersion:"4.0.2" removalVersion:"5.0.0" deprecationInfo:"LDAP_BIND_PASSWORD changing name for consistency" deprecationReplacement:"OCIS_LDAP_BIND_PASSWORD"`
BaseDN string `yaml:"base_dn" env:"OCIS_LDAP_USER_BASE_DN;IDP_LDAP_BASE_DN" desc:"Search base DN for looking up LDAP users."`
Scope string `yaml:"scope" env:"OCIS_LDAP_USER_SCOPE;IDP_LDAP_SCOPE" desc:"LDAP search scope to use when looking up users. Supported scopes are 'base', 'one' and 'sub'."`
+1
View File
@@ -361,6 +361,7 @@ func loadMiddlewares(ctx context.Context, logger log.Logger, cfg *config.Config,
oidc.WithOidcIssuer(cfg.OIDC.Issuer),
oidc.WithJWKSOptions(cfg.OIDC.JWKS),
)),
middleware.SkipUserInfo(cfg.OIDC.SkipUserInfo),
))
authenticators = append(authenticators, middleware.SignedURLAuthenticator{
Logger: logger,
+6 -3
View File
@@ -24,6 +24,7 @@ import (
"github.com/cs3org/reva/v2/pkg/storagespace"
"github.com/cs3org/reva/v2/pkg/utils"
searchMessage "github.com/owncloud/ocis/v2/protogen/gen/ocis/messages/search/v0"
searchService "github.com/owncloud/ocis/v2/protogen/gen/ocis/services/search/v0"
"github.com/owncloud/ocis/v2/services/search/pkg/content"
@@ -165,9 +166,11 @@ func (b *Bleve) Search(_ context.Context, sir *searchService.SearchIndexRequest)
totalMatches := res.Total
for _, hit := range res.Hits {
if sir.Ref != nil {
path := strings.TrimSuffix(getFieldValue[string](hit.Fields, "Path"), "/")
relRefPath := utils.MakeRelativePath(sir.Ref.Path)
if relRefPath != "." && !strings.HasPrefix(path, relRefPath+"/") {
hitPath := strings.TrimSuffix(getFieldValue[string](hit.Fields, "Path"), "/")
requestedPath := utils.MakeRelativePath(sir.Ref.Path)
isRoot := hitPath == requestedPath
if !isRoot && requestedPath != "." && !strings.HasPrefix(hitPath, requestedPath+"/") {
totalMatches--
continue
}
+1 -1
View File
@@ -340,7 +340,7 @@ var _ = Describe("Bleve", func() {
It("search *doc* in a subfolder", func() {
res, err := doSearch(rootResource.ID, "Name:*doc*", "./doc")
Expect(err).ToNot(HaveOccurred())
Expect(res.TotalMatches).To(Equal(int32(1)))
Expect(res.TotalMatches).To(Equal(int32(2)))
})
It("search *file* in a root", func() {
res, err := doSearch(rootResource.ID, "Name:*file*", "")
+14 -5
View File
@@ -19,14 +19,15 @@ import (
"github.com/cs3org/reva/v2/pkg/storage/utils/walker"
"github.com/cs3org/reva/v2/pkg/storagespace"
"github.com/cs3org/reva/v2/pkg/utils"
"golang.org/x/sync/errgroup"
"google.golang.org/protobuf/types/known/fieldmaskpb"
"github.com/owncloud/ocis/v2/ocis-pkg/log"
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/search/pkg/config"
"github.com/owncloud/ocis/v2/services/search/pkg/content"
"github.com/owncloud/ocis/v2/services/search/pkg/engine"
"golang.org/x/sync/errgroup"
"google.golang.org/protobuf/types/known/fieldmaskpb"
)
//go:generate mockery --name=Searcher
@@ -332,9 +333,6 @@ func (s *Service) searchIndex(ctx context.Context, req *searchsvc.SearchRequest,
}
rootName = space.GetRootInfo().GetPath()
permissions = space.GetRootInfo().GetPermissionSet()
if req.Ref == nil && utils.MakeRelativePath(searchPathPrefix) == utils.MakeRelativePath(rootName) {
searchPathPrefix = "."
}
s.logger.Debug().Interface("grantSpace", space).Interface("mountpointRootId", mountpointRootID).Msg("searching a grant")
case _spaceTypePersonal, _spaceTypeProject:
permissions = space.GetRootInfo().GetPermissionSet()
@@ -361,6 +359,8 @@ func (s *Service) searchIndex(ctx context.Context, req *searchsvc.SearchRequest,
s.logger.Debug().Interface("searchRequest", searchRequest).Str("duration", fmt.Sprint(duration)).Str("space", space.Id.OpaqueId).Int("hits", len(res.Matches)).Msg("space search done")
}
var matches []*searchmsg.Match
for _, match := range res.Matches {
if mountpointPrefix != "" {
match.Entity.Ref.Path = utils.MakeRelativePath(strings.TrimPrefix(match.Entity.Ref.Path, mountpointPrefix))
@@ -374,7 +374,16 @@ func (s *Service) searchIndex(ctx context.Context, req *searchsvc.SearchRequest,
isMountpoint := isShared && match.GetEntity().GetRef().GetPath() == "."
isDir := match.GetEntity().GetMimeType() == "httpd/unix-directory"
match.Entity.Permissions = convertToWebDAVPermissions(isShared, isMountpoint, isDir, permissions)
if req.Ref != nil && searchPathPrefix == "/"+match.Entity.Name {
continue
}
matches = append(matches, match)
}
res.Matches = matches
return res, nil
}
+3 -3
View File
@@ -67,7 +67,7 @@ type LDAPDriver struct {
CACert string `yaml:"ca_cert" env:"OCIS_LDAP_CACERT;USERS_LDAP_CACERT" desc:"Path/File name for the root CA certificate (in PEM format) used to validate TLS server certificates of the LDAP service. If not defined, the root directory derives from $OCIS_BASE_DATA_PATH:/idm."`
Insecure bool `yaml:"insecure" env:"OCIS_LDAP_INSECURE;USERS_LDAP_INSECURE" desc:"Disable TLS certificate validation for the LDAP connections. Do not set this in production environments."`
BindDN string `yaml:"bind_dn" env:"OCIS_LDAP_BIND_DN;USERS_LDAP_BIND_DN" desc:"LDAP DN to use for simple bind authentication with the target LDAP server."`
BindPassword string `yaml:"bind_password" env:"LDAP_BIND_PASSWORD;USERS_LDAP_BIND_PASSWORD" desc:"Password to use for authenticating the 'bind_dn'."`
BindPassword string `yaml:"bind_password" env:"OCIS_LDAP_BIND_PASSWORD;LDAP_BIND_PASSWORD;USERS_LDAP_BIND_PASSWORD" desc:"Password to use for authenticating the 'bind_dn'." deprecationVersion:"4.0.2" removalVersion:"5.0.0" deprecationInfo:"LDAP_BIND_PASSWORD changing name for consistency" deprecationReplacement:"OCIS_LDAP_BIND_PASSWORD"`
UserBaseDN string `yaml:"user_base_dn" env:"OCIS_LDAP_USER_BASE_DN;USERS_LDAP_USER_BASE_DN" desc:"Search base DN for looking up LDAP users."`
GroupBaseDN string `yaml:"group_base_dn" env:"OCIS_LDAP_GROUP_BASE_DN;USERS_LDAP_GROUP_BASE_DN" desc:"Search base DN for looking up LDAP groups."`
UserScope string `yaml:"user_scope" env:"OCIS_LDAP_USER_SCOPE;USERS_LDAP_USER_SCOPE" desc:"LDAP search scope to use when looking up users. Supported values are 'base', 'one' and 'sub'."`
@@ -86,8 +86,8 @@ type LDAPDriver struct {
}
type LDAPUserSchema struct {
ID string `yaml:"id" env:"OCIS_LDAP_USER_SCHEMA_ID" desc:"LDAP Attribute to use as the unique ID for users. This should be a stable globally unique ID like a UUID."`
IDIsOctetString bool `yaml:"id_is_octet_string" env:"OCIS_LDAP_USER_SCHEMA_ID_IS_OCTETSTRING;LDAP_USER_SCHEMA_ID_IS_OCTETSTRING;USERS_LDAP_USER_SCHEMA_ID_IS_OCTETSTRING" desc:"Set this to true if the defined 'ID' attribute for users is of the 'OCTETSTRING' syntax. This is e.g. required when using the 'objectGUID' attribute of Active Directory for the user ID's."`
ID string `yaml:"id" env:"OCIS_LDAP_USER_SCHEMA_ID;USERS_LDAP_USER_SCHEMA_ID" desc:"LDAP Attribute to use as the unique ID for users. This should be a stable globally unique ID like a UUID."`
IDIsOctetString bool `yaml:"id_is_octet_string" env:"OCIS_LDAP_USER_SCHEMA_ID_IS_OCTETSTRING;LDAP_USER_SCHEMA_ID_IS_OCTETSTRING;USERS_LDAP_USER_SCHEMA_ID_IS_OCTETSTRING" desc:"Set this to true if the defined 'ID' attribute for users is of the 'OCTETSTRING' syntax. This is e.g. required when using the 'objectGUID' attribute of Active Directory for the user ID's." deprecationVersion:"4.0.2" removalVersion:"5.0.0" deprecationInfo:"LDAP_USER_SCHEMA_ID_IS_OCTETSTRING changing name for consistency" deprecationReplacement:"OCIS_LDAP_USER_SCHEMA_ID_IS_OCTETSTRING"`
Mail string `yaml:"mail" env:"OCIS_LDAP_USER_SCHEMA_MAIL;USERS_LDAP_USER_SCHEMA_MAIL" desc:"LDAP Attribute to use for the email address of users."`
DisplayName string `yaml:"display_name" env:"OCIS_LDAP_USER_SCHEMA_DISPLAYNAME;USERS_LDAP_USER_SCHEMA_DISPLAYNAME" desc:"LDAP Attribute to use for the displayname of users."`
Username string `yaml:"user_name" env:"OCIS_LDAP_USER_SCHEMA_USERNAME;USERS_LDAP_USER_SCHEMA_USERNAME" desc:"LDAP Attribute to use for username of users."`
+1 -1
View File
@@ -2,7 +2,7 @@
sonar.projectKey=owncloud_ocis
sonar.organization=owncloud-1
sonar.projectName=ocis
sonar.projectVersion=4.0.0
sonar.projectVersion=4.0.2
sonar.host.url=https://sonarcloud.io
# =====================================================
+1 -1
View File
@@ -133,7 +133,7 @@ class EmailHelper {
$endTime = $currentTime + $waitTimeSec;
$mailBox = self::getMailBoxFromEmail($emailAddress);
while ($currentTime <= $endTime) {
$mailboxResponse = self::getMailboxInformation($mailBox);
$mailboxResponse = self::getMailboxInformation($mailBox, $xRequestId);
if (!empty($mailboxResponse) && \sizeof($mailboxResponse) >= $emailNumber) {
$mailboxId = $mailboxResponse[\sizeof($mailboxResponse) - $emailNumber]->id;
$response = self::getBodyOfAnEmailById($mailBox, $mailboxId, $xRequestId);
+4 -2
View File
@@ -992,6 +992,7 @@ class GraphHelper {
* @param string $user
* @param string $password
* @param string $spaceId
* @param string $xRequestId
*
* @return ResponseInterface
* @throws GuzzleException
@@ -1000,13 +1001,14 @@ class GraphHelper {
string $baseUrl,
string $user,
string $password,
string $spaceId
string $spaceId,
string $xRequestId
): ResponseInterface {
$url = self::getFullUrl($baseUrl, 'drives/' . $spaceId);
$header = ["restore" => true];
$body = '{}';
return HttpRequestHelper::sendRequest($url, '', 'PATCH', $user, $password, $header, $body);
return HttpRequestHelper::sendRequest($url, $xRequestId, 'PATCH', $user, $password, $header, $body);
}
/**
+4 -5
View File
@@ -202,7 +202,6 @@ class WebDavHelper {
throw new InvalidArgumentException('Invalid depth value ' . $folderDepth);
}
$headers['Depth'] = $folderDepth;
$headers['X-Request-Id'] = WebDavHelper::generateUUIDv4();
return self::makeDavRequest(
$baseUrl,
$user,
@@ -739,10 +738,10 @@ class WebDavHelper {
return "remote.php/dav/";
}
if ($davPathVersionToUse === self::DAV_VERSION_SPACES) {
if (($spaceId === null) || (\strlen($spaceId) === 0)) {
throw new InvalidArgumentException(
__METHOD__ . " A spaceId must be passed when using DAV path version 3 (spaces)"
);
// return spaces root path if spaceid is null
// REPORT request uses spaces root path
if ($spaceId === null) {
return "/remote.php/dav/spaces/";
}
if ($type === "trash-bin") {
return "/remote.php/dav/spaces/trash-bin/" . $spaceId . '/';
+3 -6
View File
@@ -41,7 +41,6 @@ default:
- NotificationContext:
- OCSContext:
- PublicWebDavContext:
- SearchContext:
- TagContext:
- TUSContext:
- SpacesTUSContext:
@@ -62,7 +61,6 @@ default:
- FilesVersionsContext:
- OCSContext:
- PublicWebDavContext:
- SearchContext:
- TrashbinContext:
- WebDavPropertiesContext:
- TUSContext:
@@ -115,11 +113,9 @@ default:
- FilesVersionsContext:
- OCSContext:
- PublicWebDavContext:
- SearchContext:
- TUSContext:
- SpacesTUSContext:
- OcisConfigContext:
- TagContext:
- TrashbinContext:
apiCors:
@@ -195,9 +191,9 @@ default:
- PublicWebDavContext:
- ArchiverContext:
apiFullTextSearch:
apiSearch:
paths:
- '%paths.base%/../features/apiFullTextSearch'
- '%paths.base%/../features/apiSearch'
context: *common_ldap_suite_context
contexts:
- SettingsContext:
@@ -210,6 +206,7 @@ default:
- FilesVersionsContext:
- OCSContext:
- TrashbinContext:
- TagContext:
apiReshare:
paths:
+17
View File
@@ -30,6 +30,17 @@ OCIS_IMAGE_TAG ?= dev
WITH_WRAPPER ?= true
OCIS_WRAPPER := ../../ociswrapper/bin/ociswrapper
ifdef START_TIKA
ifeq ($(START_TIKA),true)
COMPOSE_FILE := $(COMPOSE_FILE):src/tika.yml
SEARCH_EXTRACTOR_TYPE := tika
else
SEARCH_EXTRACTOR_TYPE := basic
endif
else
SEARCH_EXTRACTOR_TYPE := basic
endif
# static
DIVIDE_INTO_NUM_PARTS := 10
PARTS = 1 2 3 4 5 6 7 8 9 10
@@ -190,6 +201,11 @@ testSuite: $(OCIS_WRAPPER) build-dev-image clean-docker-container ../../../vendo
COMPOSE_PROJECT_NAME=$(COMPOSE_PROJECT_NAME) \
COMPOSE_FILE=src/antivirus.yml \
docker-compose run start_antivirus; \
fi; \
if [ "${START_TIKA}" == "true" ]; then \
COMPOSE_PROJECT_NAME=$(COMPOSE_PROJECT_NAME) \
COMPOSE_FILE=src/tika.yml \
docker-compose run tika-service; \
fi; \
COMPOSE_PROJECT_NAME=$(COMPOSE_PROJECT_NAME) \
COMPOSE_FILE=$(COMPOSE_FILE) \
@@ -199,6 +215,7 @@ testSuite: $(OCIS_WRAPPER) build-dev-image clean-docker-container ../../../vendo
OCIS_ASYNC_UPLOADS=$(OCIS_ASYNC_UPLOADS) \
OCIS_ADD_RUN_SERVICES=$(OCIS_ADD_RUN_SERVICES) \
POSTPROCESSING_STEPS=$(POSTPROCESSING_STEPS) \
SEARCH_EXTRACTOR_TYPE=$(SEARCH_EXTRACTOR_TYPE) \
OCIS_IMAGE_TAG=$(OCIS_IMAGE_TAG) \
BEHAT_SUITE=$(BEHAT_SUITE) \
BEHAT_FEATURE=$(BEHAT_FEATURE) \
@@ -43,6 +43,11 @@ services:
# postprocessing step
POSTPROCESSING_STEPS: $POSTPROCESSING_STEPS
# tika
SEARCH_EXTRACTOR_TYPE: $SEARCH_EXTRACTOR_TYPE
SEARCH_EXTRACTOR_TIKA_TIKA_URL: "http://tika:9998"
SEARCH_EXTRACTOR_CS3SOURCE_INSECURE: "true"
# fonts map for txt thumbnails (including unicode support)
THUMBNAILS_TXT_FONTMAP_FILE: "/drone/src/tests/config/drone/fontsMap.json"
volumes:
+8
View File
@@ -0,0 +1,8 @@
services:
tika-service:
image: dadarek/wait-for-dependencies
depends_on:
- tika
command: tika:9998
tika:
image: apache/tika:2.8.0.0
@@ -205,10 +205,6 @@ cannot share a folder with create permission
- [coreApiSharePublicLink1/createPublicLinkShare.feature:327](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/coreApiSharePublicLink1/createPublicLinkShare.feature#L327)
#### [download previews of other users file](https://github.com/owncloud/ocis/issues/2071)
- [coreApiWebdavPreviews/previews.feature:98](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/coreApiWebdavPreviews/previews.feature#L98)
#### [copying a folder within a public link folder to folder with same name as an already existing file overwrites the parent file](https://github.com/owncloud/ocis/issues/1232)
- [coreApiSharePublicLink2/copyFromPublicLink.feature:65](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/coreApiSharePublicLink2/copyFromPublicLink.feature#L65)
@@ -71,7 +71,6 @@ The expected failures in this file are from features in the owncloud/ocis repo.
- [apiGraph/getUser.feature:91](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiGraph/getUser.feature#L91)
- [apiGraph/getUser.feature:92](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiGraph/getUser.feature#L92)
- [apiGraph/getUser.feature:93](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiGraph/getUser.feature#L93)
- [apiGraph/getUser.feature:606](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiGraph/getUser.feature#L606)
- [apiGraph/getUser.feature:607](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiGraph/getUser.feature#L607)
- [apiGraph/getUser.feature:608](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiGraph/getUser.feature#L608)
- [apiGraph/getUser.feature:609](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiGraph/getUser.feature#L609)
@@ -83,6 +82,7 @@ The expected failures in this file are from features in the owncloud/ocis repo.
- [apiGraph/getUser.feature:615](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiGraph/getUser.feature#L615)
- [apiGraph/getUser.feature:616](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiGraph/getUser.feature#L616)
- [apiGraph/getUser.feature:617](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiGraph/getUser.feature#L617)
- [apiGraph/getUser.feature:618](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiGraph/getUser.feature#L618)
#### [Normal user can get expanded members information of a group](https://github.com/owncloud/ocis/issues/5604)
@@ -90,7 +90,7 @@ The expected failures in this file are from features in the owncloud/ocis repo.
- [apiGraph/getGroup.feature:382](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiGraph/getGroup.feature#L382)
- [apiGraph/getGroup.feature:383](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiGraph/getGroup.feature#L383)
#### [Changing user with an uppercase name gives 404 error](https://github.com/owncloud/ocis/issues/5763)
#### [Changing user with an uppercase name gives 404 error](https://github.com/owncloud/ocis/issues/7044)
- [apiGraph/editUser.feature:67](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiGraph/editUser.feature#L67)
@@ -19,7 +19,7 @@ Feature: Copy test
When user "Alice" copies file "testfile.txt" from space "new-space" to "/new/testfile.txt" inside space "new-space" using the WebDAV API
Then the HTTP status code should be "201"
And the following headers should match these regular expressions
| Oc-Fileid | /^[a-f0-9!\$\-]{110}$/ |
| Access-Control-Allow-Origin | /^[*]{1}$/ |
| X-Request-Id | /^[a-f0-9!\-]{36}$/ |
| Oc-Fileid | /^[a-f0-9!\$\-]{110}$/ |
| Access-Control-Allow-Origin | /^[*]{1}$/ |
| X-Request-Id | /^[a-zA-Z]+\/[a-zA-Z]+\.feature:\d+(-\d+)?$/ |
@@ -18,7 +18,7 @@ Feature: Propfind test
When user "Alice" sends PROPFIND request to space "new-space" using the WebDAV API
Then the HTTP status code should be "207"
And the following headers should match these regular expressions
| X-Request-Id | /^[a-f0-9!\-]{36}$/ |
| X-Request-Id | /^[a-zA-Z]+\/[a-zA-Z]+\.feature:\d+(-\d+)?$/ |
And the "PROPFIND" response should contain a space "new-space" with these key and value pairs:
| key | value |
| oc:fileid | UUIDof:new-space |
@@ -36,7 +36,7 @@ Feature: Propfind test
When user "Brian" sends PROPFIND request to space "new-space" using the WebDAV API
Then the HTTP status code should be "207"
And the following headers should match these regular expressions
| X-Request-Id | /^[a-f0-9!\-]{36}$/ |
| X-Request-Id | /^[a-zA-Z]+\/[a-zA-Z]+\.feature:\d+(-\d+)?$/ |
And the "PROPFIND" response should contain a space "new-space" with these key and value pairs:
| key | value |
| oc:fileid | UUIDof:new-space |
@@ -20,7 +20,7 @@ Feature: REPORT request to Shares space
When user "Brian" searches for "SubFolder1" using the WebDAV API
Then the HTTP status code should be "207"
And the following headers should match these regular expressions
| X-Request-Id | /^[a-f0-9!\-]{36}$/ |
| X-Request-Id | /^[a-zA-Z]+\/[a-zA-Z]+\.feature:\d+(-\d+)?$/ |
And the "REPORT" response to user "Brian" should contain a mountpoint "folderMain" with these key and value pairs:
| key | value |
| oc:fileid | UUIDof:SubFolder1 |
@@ -42,7 +42,7 @@ Feature: REPORT request to Shares space
When user "Brian" searches for "frodo.txt" using the WebDAV API
Then the HTTP status code should be "207"
And the following headers should match these regular expressions
| X-Request-Id | /^[a-f0-9!\-]{36}$/ |
| X-Request-Id | /^[a-zA-Z]+\/[a-zA-Z]+\.feature:\d+(-\d+)?$/ |
And the "REPORT" response to user "Brian" should contain a mountpoint "folderMain" with these key and value pairs:
| key | value |
| oc:fileid | UUIDof:SubFolder1/subFOLDER2/frodo.txt |
@@ -63,7 +63,7 @@ Feature: REPORT request to Shares space
When user "Brian" searches for "folderMain" using the WebDAV API
Then the HTTP status code should be "207"
And the following headers should match these regular expressions
| X-Request-Id | /^[a-f0-9!\-]{36}$/ |
| X-Request-Id | /^[a-zA-Z]+\/[a-zA-Z]+\.feature:\d+(-\d+)?$/ |
And the search result should contain "0" entries
Examples:
| dav-path-version |
@@ -18,8 +18,10 @@ Feature: REPORT request to project space
And using new DAV path
When user "Alice" searches for "testFile.txt" using the WebDAV API
Then the HTTP status code should be "207"
And the search result of user "Alice" should contain only these entries:
| /testFile.txt |
And the following headers should match these regular expressions
| X-Request-Id | /^[a-f0-9!\-]{36}$/ |
| X-Request-Id | /^[a-zA-Z]+\/[a-zA-Z]+\.feature:\d+(-\d+)?$/ |
And the "REPORT" response to user "Alice" should contain a mountpoint "findData" with these key and value pairs:
| key | value |
| oc:fileid | UUIDof:testFile.txt |
@@ -36,8 +38,10 @@ Feature: REPORT request to project space
And using new DAV path
When user "Alice" searches for "insideTheFolder.txt" using the WebDAV API
Then the HTTP status code should be "207"
And the search result of user "Alice" should contain only these entries:
| /folderMain/SubFolder1/subFOLDER2/insideTheFolder.txt |
And the following headers should match these regular expressions
| X-Request-Id | /^[a-f0-9!\-]{36}$/ |
| X-Request-Id | /^[a-zA-Z]+\/[a-zA-Z]+\.feature:\d+(-\d+)?$/ |
And the "REPORT" response to user "Alice" should contain a mountpoint "findData" with these key and value pairs:
| key | value |
| oc:fileid | UUIDof:folderMain/SubFolder1/subFOLDER2/insideTheFolder.txt |
@@ -53,8 +57,10 @@ Feature: REPORT request to project space
And using new DAV path
When user "Alice" searches for "folderMain" using the WebDAV API
Then the HTTP status code should be "207"
And the search result of user "Alice" should contain only these entries:
| /folderMain |
And the following headers should match these regular expressions
| X-Request-Id | /^[a-f0-9!\-]{36}$/ |
| X-Request-Id | /^[a-zA-Z]+\/[a-zA-Z]+\.feature:\d+(-\d+)?$/ |
And the "REPORT" response to user "Alice" should contain a mountpoint "findData" with these key and value pairs:
| key | value |
| oc:fileid | UUIDof:folderMain |
@@ -69,8 +75,11 @@ Feature: REPORT request to project space
Given user "Alice" has created a folder "folderMain/sub-folder" in space "findData"
And using new DAV path
When user "Alice" searches for "sub" using the WebDAV API
Then the HTTP status code should be "207"
And the search result of user "Alice" should contain only these entries:
| /folderMain/sub-folder |
And the following headers should match these regular expressions
| X-Request-Id | /^[a-f0-9!\-]{36}$/ |
| X-Request-Id | /^[a-zA-Z]+\/[a-zA-Z]+\.feature:\d+(-\d+)?$/ |
Then the HTTP status code should be "207"
And the "REPORT" response to user "Alice" should contain a mountpoint "findData" with these key and value pairs:
| key | value |
@@ -28,7 +28,7 @@ Feature: Report test
When user "Brian" searches for "SubFolder1" using the WebDAV API
Then the HTTP status code should be "207"
And the following headers should match these regular expressions
| X-Request-Id | /^[a-f0-9!\-]{36}$/ |
| X-Request-Id | /^[a-zA-Z]+\/[a-zA-Z]+\.feature:\d+(-\d+)?$/ |
And the "REPORT" response to user "Brian" should contain a mountpoint "folderMain" with these key and value pairs:
| key | value |
| oc:fileid | UUIDof:SubFolder1 |
@@ -49,7 +49,7 @@ Feature: Report test
When user "Brian" searches for "insideTheFolder.txt" using the WebDAV API
Then the HTTP status code should be "207"
And the following headers should match these regular expressions
| X-Request-Id | /^[a-f0-9!\-]{36}$/ |
| X-Request-Id | /^[a-zA-Z]+\/[a-zA-Z]+\.feature:\d+(-\d+)?$/ |
And the "REPORT" response to user "Brian" should contain a mountpoint "folderMain" with these key and value pairs:
| key | value |
| oc:fileid | UUIDof:SubFolder1/subFOLDER2/insideTheFolder.txt |
@@ -69,5 +69,5 @@ Feature: Report test
When user "Brian" searches for "folderMain" using the WebDAV API
Then the HTTP status code should be "207"
And the following headers should match these regular expressions
| X-Request-Id | /^[a-f0-9!\-]{36}$/ |
| X-Request-Id | /^[a-zA-Z]+\/[a-zA-Z]+\.feature:\d+(-\d+)?$/ |
And the search result should contain "0" entries
@@ -42,7 +42,7 @@ Feature: edit user
| empty mail | | 400 | brian@example.com |
| change to a invalid email | invalidEmail | 400 | brian@example.com |
@issue-5763
@issue-7044
Scenario Outline: admin user can edit another user's name
Given user "Carol" has been created with default attributes and without skeleton files
When the user "Alice" changes the user name of user "Carol" to "<userName>" using the Graph API
@@ -381,7 +381,7 @@ Feature: get users
"""
Scenario Outline: non-admin user gets his/her own drive information
Scenario Outline: user gets his/her own information along with drive information
Given the administrator has assigned the role "<userRole>" to user "Brian" using the Graph API
When the user "Brian" gets his drive information using Graph API
Then the HTTP status code should be "200"
@@ -504,6 +504,7 @@ Feature: get users
"""
Examples:
| userRole |
| Admin |
| Space Admin |
| User |
| User Light |
@@ -750,7 +751,6 @@ Feature: get users
And the JSON data of the response should not contain the user "Alice Hansen" in the item 'value'
Scenario: admin user gets all users of two groups
Given the administrator has assigned the role "Admin" to user "Alice" using the Graph API
And user "Carol" has been created with default attributes and without skeleton files
@@ -52,9 +52,9 @@ Feature: Search
Then the HTTP status code should be "207"
And the search result should contain "4" entries
And the search result of user "Brian" should contain these entries:
| /SubFolder1 |
| /SubFolder1/subFOLDER2 |
| /SubFolder1/subFOLDER2/insideTheFolder.txt |
| folderMain/SubFolder1 |
| folderMain/SubFolder1/subFOLDER2 |
| folderMain/SubFolder1/subFOLDER2/insideTheFolder.txt |
And for user "Brian" the search result should contain space "mountpoint/folderMain"
@@ -115,9 +115,9 @@ Feature: Search
Then the HTTP status code should be "207"
And the search result should contain "3" entries
And the search result of user "Alice" should contain only these entries:
| /SubFolder1 |
| /SubFolder1/subFOLDER2 |
| /SubFolder1/subFOLDER2/insideTheFolder.txt |
| folderMain/SubFolder1 |
| folderMain/SubFolder1/subFOLDER2 |
| folderMain/SubFolder1/subFOLDER2/insideTheFolder.txt |
But the search result of user "Alice" should not contain these entries:
| /folderMain |
@@ -131,8 +131,8 @@ Feature: Search
When user "Brian" searches for "folder" inside folder "/folderMain" in space "Shares" using the WebDAV API
Then the HTTP status code should be "207"
And the search result of user "Brian" should contain only these entries:
| /SubFolder1 |
| /SubFolder1/subFOLDER2 |
| /SubFolder1/subFOLDER2/insideTheFolder.txt |
| folderMain/SubFolder1 |
| folderMain/SubFolder1/subFOLDER2 |
| folderMain/SubFolder1/subFOLDER2/insideTheFolder.txt |
But the search result of user "Brian" should not contain these entries:
| /folderMain |
@@ -1,6 +1,6 @@
Feature: full text search
Feature: content search
As a user
I want to do full text search
I want to do search resources by content
So that I can find the files with the content I am looking for
Background:
@@ -39,9 +39,9 @@ Feature: full text search
When user "Brian" searches for "Content:hello" using the WebDAV API
Then the HTTP status code should be "207"
And the search result of user "Brian" should contain only these files:
| keywordAtStart.txt |
| keywordAtMiddle.txt |
| keywordAtLast.txt |
| uploadFolder/keywordAtStart.txt |
| uploadFolder/keywordAtMiddle.txt |
| uploadFolder/keywordAtLast.txt |
Examples:
| dav-path-version |
| old |
@@ -63,8 +63,8 @@ Feature: full text search
When user "Alice" searches for "Content:hello" using the WebDAV API
Then the HTTP status code should be "207"
And the search result of user "Alice" should contain only these files:
| keywordAtStart.txt |
| keywordAtMiddle.txt |
| uploadFolder/keywordAtStart.txt |
| keywordAtMiddle.txt |
Examples:
| dav-path-version |
| old |
@@ -118,9 +118,9 @@ Feature: full text search
When user "Alice" searches for "Content:hello" using the WebDAV API
Then the HTTP status code should be "207"
And the search result of user "Alice" should contain only these files:
| keywordAtStart.txt |
| keywordAtMiddle.txt |
| keywordAtLast.txt |
| keywordAtStart.txt |
| spacesFolderWithFile/keywordAtMiddle.txt |
| spacesFolderWithFile/spacesSubFolder/keywordAtLast.txt |
Examples:
| dav-path-version |
| old |
@@ -1,7 +1,7 @@
Feature: full text search
Feature: tag search
As a user
I want to do full text search
So that I can find the files with the content I am looking for
I want to do search resources by tag
So that I can find the files with the tag I am looking for
Background:
Given user "Alice" has been created with default attributes and without skeleton files
@@ -26,9 +26,9 @@ Feature: full text search
When user "Alice" searches for "Tags:tag1" using the WebDAV API
Then the HTTP status code should be "207"
And the search result of user "Alice" should contain only these files:
| fileInRootLevel.txt |
| fileInsideFolder.txt |
| fileInsideSubFolder.txt |
| fileInRootLevel.txt |
| folderWithFile/fileInsideFolder.txt |
| folderWithFile/subFolder/fileInsideSubFolder.txt |
Examples:
| dav-path-version |
| old |
@@ -54,9 +54,9 @@ Feature: full text search
When user "Alice" searches for "Tags:tag1" using the WebDAV API
Then the HTTP status code should be "207"
And the search result of user "Alice" should contain only these files:
| spacesFile.txt |
| spacesFileInsideFolder.txt |
| spacesFileInsideSubFolder.txt |
| spacesFile.txt |
| spacesFolderWithFile/spacesFileInsideFolder.txt |
| spacesFolderWithFile/spacesSubFolder/spacesFileInsideSubFolder.txt |
Examples:
| dav-path-version |
| old |
@@ -103,8 +103,8 @@ Feature: full text search
When user "Alice" searches for "Tags:tag1" using the WebDAV API
Then the HTTP status code should be "207"
And the search result of user "Alice" should contain only these files:
| spacesFolder |
| spacesSubFolder |
| spacesFolder |
| spacesFolder/spacesSubFolder |
Examples:
| dav-path-version |
| old |
@@ -132,8 +132,8 @@ Feature: full text search
When user "Brian" searches for "Tags:tag1" using the WebDAV API
Then the HTTP status code should be "207"
And the search result of user "Brian" should contain only these files:
| file1.txt |
| file2.txt |
| uploadFolder/file1.txt |
| uploadFolder/file2.txt |
Examples:
| dav-path-version |
| old |
@@ -246,8 +246,8 @@ Feature: full text search
When user "Alice" searches for "file" inside folder "/Folder" using the WebDAV API
Then the HTTP status code should be "207"
And the search result of user "Alice" should contain only these entries:
| file2.txt |
| file3.txt |
| /Folder/file2.txt |
| /Folder/SubFolder/file3.txt |
But the search result of user "Alice" should not contain these entries:
| file1.txt |
Examples:
@@ -0,0 +1,70 @@
Feature: copying file using file id
As a user
I want to copy the file using file id
So that I can manage my resource
Background:
Given using spaces DAV path
And user "Alice" has been created with default attributes and without skeleton files
Scenario Outline: copy a file into a folder in personal space
Given user "Alice" has created folder "/folder"
And user "Alice" has uploaded file with content "some data" to "/textfile.txt"
And we save it into "FILEID"
When user "Alice" copies a file "/textfile.txt" into "/folder" inside space "Personal" using file-id path "<dav-path>"
Then the HTTP status code should be "201"
And for user "Alice" the space "Personal" should contain these entries:
| folder/textfile.txt |
| textfile.txt |
Examples:
| dav-path |
| /remote.php/dav/spaces/<<FILEID>> |
| /dav/spaces/<<FILEID>> |
Scenario Outline: copy a file into a sub-folder in personal space
Given user "Alice" has created folder "/folder"
And user "Alice" has created folder "folder/sub-folder"
And user "Alice" has uploaded file with content "some data" to "/textfile.txt"
And we save it into "FILEID"
When user "Alice" copies a file "/textfile.txt" into "/folder/sub-folder" inside space "Personal" using file-id path "<dav-path>"
Then the HTTP status code should be "201"
And for user "Alice" the space "Personal" should contain these entries:
| folder/sub-folder/textfile.txt |
| textfile.txt |
Examples:
| dav-path |
| /remote.php/dav/spaces/<<FILEID>> |
| /dav/spaces/<<FILEID>> |
Scenario Outline: copy a file from a folder into root of personal space
Given user "Alice" has created folder "/folder"
And user "Alice" has uploaded file with content "some data" to "folder/textfile.txt"
And we save it into "FILEID"
When user "Alice" copies a file "folder/textfile.txt" into "/" inside space "Personal" using file-id path "<dav-path>"
Then the HTTP status code should be "201"
And for user "Alice" the space "Personal" should contain these entries:
| textfile.txt |
| folder/textfile.txt |
Examples:
| dav-path |
| /remote.php/dav/spaces/<<FILEID>> |
| /dav/spaces/<<FILEID>> |
Scenario Outline: copy a file from sub-folder into root of personal space
Given user "Alice" has created folder "/folder"
And user "Alice" has created folder "folder/sub-folder"
And user "Alice" has uploaded file with content "some data" to "folder/sub-folder/textfile.txt"
And we save it into "FILEID"
When user "Alice" copies a file "folder/sub-folder/textfile.txt" into "/" inside space "Personal" using file-id path "<dav-path>"
Then the HTTP status code should be "201"
And for user "Alice" the space "Personal" should contain these entries:
| textfile.txt |
| folder/sub-folder/textfile.txt |
Examples:
| dav-path |
| /remote.php/dav/spaces/<<FILEID>> |
| /dav/spaces/<<FILEID>> |
@@ -0,0 +1,137 @@
Feature: propfind a file using file id
As a user
I want to check the PROPFIND response of file using their file id
So that I can make sure that the response contains all the relevant values
Background:
Given using spaces DAV path
And user "Alice" has been created with default attributes and without skeleton files
Scenario Outline: send a PROPFIND request to a file inside root of personal space
Given user "Alice" has uploaded file with content "some data" to "/textfile.txt"
And we save it into "FILEID"
When user "Alice" sends HTTP method "PROPFIND" to URL "<dav-path>"
Then the HTTP status code should be "207"
And the "PROPFIND" response to user "Alice" should contain a mountpoint "Alice Hansen" with these key and value pairs:
| key | value |
| oc:name | textfile.txt |
| oc:permissions | RDNVWZP |
Examples:
| dav-path |
| /remote.php/dav/spaces/<<FILEID>> |
| /dav/spaces/<<FILEID>> |
Scenario Outline: send a PROPFIND request to a file inside a folder of personal space
Given user "Alice" has created folder "folder"
And user "Alice" has uploaded file with content "some data" to "folder/textfile.txt"
And we save it into "FILEID"
When user "Alice" sends HTTP method "PROPFIND" to URL "<dav-path>"
Then the HTTP status code should be "207"
And the "PROPFIND" response to user "Alice" should contain a mountpoint "Alice Hansen" with these key and value pairs:
| key | value |
| oc:name | textfile.txt |
| oc:permissions | RDNVWZP |
Examples:
| dav-path |
| /remote.php/dav/spaces/<<FILEID>> |
| /dav/spaces/<<FILEID>> |
Scenario Outline: send a PROPFIND request to a file in personal space owned by another user
Given user "Brian" has been created with default attributes and without skeleton files
And user "Alice" has uploaded file with content "some data" to "textfile.txt"
And we save it into "FILEID"
When user "Brian" sends HTTP method "PROPFIND" to URL "<dav-path>"
Then the HTTP status code should be "404"
Examples:
| dav-path |
| /remote.php/dav/spaces/<<FILEID>> |
| /dav/spaces/<<FILEID>> |
Scenario Outline: send a PROPFIND request to a file of inside project space
Given 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 GraphApi
And user "Alice" has uploaded a file inside space "new-space" with content "some content" to "textfile.txt"
And we save it into "FILEID"
When user "Alice" sends HTTP method "PROPFIND" to URL "<dav-path>"
Then the HTTP status code should be "207"
And the "PROPFIND" response should contain a space "new-space" with these key and value pairs:
| key | value |
| oc:name | textfile.txt |
| oc:permissions | RDNVWZP |
Examples:
| dav-path |
| /remote.php/dav/spaces/<<FILEID>> |
| /dav/spaces/<<FILEID>> |
Scenario Outline: send a PROPFIND request to a file inside a folder of project space
Given 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 GraphApi
And user "Alice" has created a folder "folder" in space "new-space"
And user "Alice" has uploaded a file inside space "new-space" with content "some content" to "/folder/textfile.txt"
And we save it into "FILEID"
When user "Alice" sends HTTP method "PROPFIND" to URL "<dav-path>"
Then the HTTP status code should be "207"
And the "PROPFIND" response should contain a space "new-space" with these key and value pairs:
| key | value |
| oc:name | textfile.txt |
| oc:permissions | RDNVWZP |
Examples:
| dav-path |
| /remote.php/dav/spaces/<<FILEID>> |
| /dav/spaces/<<FILEID>> |
Scenario Outline: send a PROPFIND request to a file inside project space owned by another user
Given user "Brian" has been created with default attributes and without skeleton files
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 GraphApi
And user "Alice" has uploaded a file inside space "new-space" with content "some content" to "textfile.txt"
And we save it into "FILEID"
When user "Brian" sends HTTP method "PROPFIND" to URL "<dav-path>"
Then the HTTP status code should be "404"
Examples:
| dav-path |
| /remote.php/dav/spaces/<<FILEID>> |
| /dav/spaces/<<FILEID>> |
Scenario Outline: send a PROPFIND request to a shared file
Given user "Brian" has been created with default attributes and without skeleton files
And user "Alice" has uploaded file with content "some data" to "/textfile.txt"
And we save it into "FILEID"
And user "Alice" has shared file "/textfile.txt" with user "Brian"
And user "Brian" has accepted share "/textfile.txt" offered by user "Alice"
When user "Brian" sends HTTP method "PROPFIND" to URL "<dav-path>"
Then the HTTP status code should be "207"
And the "PROPFIND" response to user "Alice" should contain a mountpoint "Brian Murphy" with these key and value pairs:
| key | value |
| oc:name | textfile.txt |
| oc:permissions | SRNVW |
Examples:
| dav-path |
| /remote.php/dav/spaces/<<FILEID>> |
| /dav/spaces/<<FILEID>> |
Scenario Outline: sharee sends a PROPFIND request to a file inside of a shared folder
Given user "Brian" has been created with default attributes and without skeleton files
And user "Alice" has created folder "/folder"
And user "Alice" has shared folder "/folder" with user "Brian"
And user "Brian" has accepted share "/folder" offered by user "Alice"
And user "Alice" has uploaded file with content "some data" to "/folder/textfile.txt"
And we save it into "FILEID"
When user "Brian" sends HTTP method "PROPFIND" to URL "<dav-path>"
Then the HTTP status code should be "207"
And the "PROPFIND" response to user "Alice" should contain a mountpoint "Brian Murphy" with these key and value pairs:
| key | value |
| oc:name | textfile.txt |
| oc:permissions | RDNVWZP |
Examples:
| dav-path |
| /remote.php/dav/spaces/<<FILEID>> |
| /dav/spaces/<<FILEID>> |
@@ -0,0 +1,112 @@
Feature: update files using file id
As a user
I want to update the files using file id
So that I can make changes on the content of a file
Background:
Given using spaces DAV path
And user "Alice" has been created with default attributes and without skeleton files
Scenario Outline: update content of a file
Given user "Alice" has uploaded file with content "some data" to "/textfile.txt"
And we save it into "FILEID"
When user "Alice" sends HTTP method "PUT" to URL "<dav-path>" with content "updated content"
Then the HTTP status code should be "204"
And for user "Alice" the content of the file "/textfile.txt" of the space "Personal" should be "updated content"
Examples:
| dav-path |
| /remote.php/dav/spaces/<<FILEID>> |
| /dav/spaces/<<FILEID>> |
Scenario Outline: update content of a file inside a folder
Given user "Alice" has created folder "uploadFolder"
And user "Alice" has uploaded file with content "some data" to "uploadFolder/textfile.txt"
And we save it into "FILEID"
When user "Alice" sends HTTP method "PUT" to URL "<dav-path>" with content "updated content"
Then the HTTP status code should be "204"
And for user "Alice" the content of the file "/uploadFolder/textfile.txt" of the space "Personal" should be "updated content"
Examples:
| dav-path |
| /remote.php/dav/spaces/<<FILEID>> |
| /dav/spaces/<<FILEID>> |
Scenario Outline: update content of a file inside a project space
Given 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 GraphApi
And user "Alice" has uploaded a file inside space "new-space" with content "some data" to "/textfile.txt"
And we save it into "FILEID"
When user "Alice" sends HTTP method "PUT" to URL "<dav-path>" with content "updated content"
Then the HTTP status code should be "204"
And for user "Alice" the content of the file "/textfile.txt" of the space "new-space" should be "updated content"
Examples:
| dav-path |
| /remote.php/dav/spaces/<<FILEID>> |
| /dav/spaces/<<FILEID>> |
Scenario Outline: sharee updates content of a shared file
Given user "Brian" has been created with default attributes and without skeleton files
And user "Alice" has uploaded file with content "some data" to "/textfile.txt"
And we save it into "FILEID"
And user "Alice" has shared file "/textfile.txt" with user "Brian"
And user "Brian" has accepted share "/textfile.txt" offered by user "Alice"
When user "Brian" sends HTTP method "PUT" to URL "<dav-path>" with content "updated content"
Then the HTTP status code should be "204"
And for user "Alice" the content of the file "/textfile.txt" of the space "Personal" should be "updated content"
And for user "Brian" the content of the file "textfile.txt" of the space "Shares" should be "updated content"
Examples:
| dav-path |
| /remote.php/dav/spaces/<<FILEID>> |
| /dav/spaces/<<FILEID>> |
Scenario Outline: sharee updates content of a file inside a shared folder
Given user "Brian" has been created with default attributes and without skeleton files
And user "Alice" has created folder "uploadFolder"
And user "Alice" has uploaded file with content "some data" to "uploadFolder/textfile.txt"
And we save it into "FILEID"
And user "Alice" has shared folder "/uploadFolder" with user "Brian"
And user "Brian" has accepted share "/uploadFolder" offered by user "Alice"
When user "Brian" sends HTTP method "PUT" to URL "<dav-path>" with content "updated content"
Then the HTTP status code should be "204"
And for user "Alice" the content of the file "uploadFolder/textfile.txt" of the space "Personal" should be "updated content"
And for user "Brian" the content of the file "uploadFolder/textfile.txt" of the space "Shares" should be "updated content"
Examples:
| dav-path |
| /remote.php/dav/spaces/<<FILEID>> |
| /dav/spaces/<<FILEID>> |
Scenario Outline: sharee with different role tries to update content of a file inside a shared space
Given user "Brian" has been created with default attributes and without skeleton files
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 GraphApi
And user "Alice" has uploaded a file inside space "new-space" with content "some data" to "/textfile.txt"
And we save it into "FILEID"
And user "Alice" has shared a space "new-space" with settings:
| shareWith | Brian |
| role | <role> |
When user "Brian" sends HTTP method "PUT" to URL "<dav-path>" with content "updated content"
Then the HTTP status code should be "<http_status_code>"
And for user "Alice" the content of the file "/textfile.txt" of the space "new-space" should be "<file-content>"
And for user "Brian" the content of the file "/textfile.txt" of the space "new-space" should be "<file-content>"
Examples:
| dav-path | role | http_status_code | file-content |
| /remote.php/dav/spaces/<<FILEID>> | viewer | 403 | some data |
| /dav/spaces/<<FILEID>> | editor | 204 | updated content |
Scenario Outline: user tries to update content of a file owned by others
Given user "Brian" has been created with default attributes and without skeleton files
And user "Alice" has uploaded file with content "some data" to "/textfile.txt"
And we save it into "FILEID"
When user "Brian" sends HTTP method "PUT" to URL "<dav-path>" with content "updated content"
Then the HTTP status code should be "404"
And for user "Alice" the content of the file "/textfile.txt" of the space "Personal" should be "some data"
Examples:
| dav-path |
| /remote.php/dav/spaces/<<FILEID>> |
| /dav/spcaes/<<FILEID>> |
@@ -29,6 +29,7 @@ use TestHelpers\AppConfigHelper;
use TestHelpers\OcsApiHelper;
use Behat\Gherkin\Node\TableNode;
use Behat\Behat\Context\Context;
use Psr\Http\Message\ResponseInterface;
/**
* AppConfiguration trait
@@ -110,7 +111,7 @@ class AppConfigurationContext implements Context {
*/
public function userRetrievesCapabilities(string $username): void {
$user = $this->featureContext->getActualUsername($username);
$this->userGetsCapabilities($user, true);
$this->featureContext->setResponse($this->userGetsCapabilities($user, true));
}
/**
@@ -118,24 +119,22 @@ class AppConfigurationContext implements Context {
* @param string $username
* @param boolean $formatJson // if true then formats the response in json
*
* @return void
* @return ResponseInterface
* @throws GuzzleException
* @throws JsonException
*/
public function userGetsCapabilities(string $username, ?bool $formatJson = false):void {
public function userGetsCapabilities(string $username, ?bool $formatJson = false):ResponseInterface {
$user = $this->featureContext->getActualUsername($username);
$password = $this->featureContext->getPasswordForUser($user);
$this->featureContext->setResponse(
OcsApiHelper::sendRequest(
$this->featureContext->getBaseUrl(),
$user,
$password,
'GET',
'/cloud/capabilities' . ($formatJson ? '?format=json' : ''),
$this->featureContext->getStepLineRef(),
[],
$this->featureContext->getOcsApiVersion()
)
return OcsApiHelper::sendRequest(
$this->featureContext->getBaseUrl(),
$user,
$password,
'GET',
'/cloud/capabilities' . ($formatJson ? '?format=json' : ''),
$this->featureContext->getStepLineRef(),
[],
$this->featureContext->getOcsApiVersion()
);
}
@@ -148,14 +147,7 @@ class AppConfigurationContext implements Context {
* @throws Exception
*/
public function userGetsCapabilitiesCheckResponse(string $username):void {
$this->userGetsCapabilities($username);
$statusCode = $this->featureContext->getResponse()->getStatusCode();
if ($statusCode !== 200) {
throw new \Exception(
__METHOD__
. " user $username returned unexpected status $statusCode"
);
}
$this->featureContext->theHTTPStatusCodeShouldBe(200, '', $this->userGetsCapabilities($username));
}
/**
@@ -164,7 +156,7 @@ class AppConfigurationContext implements Context {
* @return void
*/
public function theUserGetsCapabilities():void {
$this->userGetsCapabilities($this->featureContext->getCurrentUser());
$this->featureContext->setResponse($this->userGetsCapabilities($this->featureContext->getCurrentUser()));
}
/**
@@ -179,7 +171,7 @@ class AppConfigurationContext implements Context {
/**
* @return string
* @throws Exception
* @throws Exception|GuzzleException
*/
public function getAdminUsernameForCapabilitiesCheck():string {
if (\TestHelpers\OcisHelper::isTestingOnReva()) {
@@ -190,7 +182,7 @@ class AppConfigurationContext implements Context {
$adminUsername = "PseudoAdminForRevaTest";
$createdUsers = $this->featureContext->getCreatedUsers();
if (!\array_key_exists($adminUsername, $createdUsers)) {
$this->featureContext->createUser($adminUsername);
$this->featureContext->userHasBeenCreated(["userName" => $adminUsername]);
}
} else {
$adminUsername = $this->featureContext->getAdminUsername();
@@ -205,7 +197,7 @@ class AppConfigurationContext implements Context {
*/
public function theAdministratorGetsCapabilities():void {
$user = $this->getAdminUsernameForCapabilitiesCheck();
$this->userGetsCapabilities($user, true);
$this->featureContext->setResponse($this->userGetsCapabilities($user, true));
}
/**
@@ -166,7 +166,7 @@ class ArchiverContext implements Context {
$queryString = $this->getArchiverQueryString($owner, $resource, $addressType);
return HttpRequestHelper::get(
$this->featureContext->getBaseUrl() . '/archiver?' . $queryString,
'',
$this->featureContext->getStepLineRef(),
$downloader,
$this->featureContext->getPasswordForUser($downloader),
$headers
@@ -199,7 +199,7 @@ class ArchiverContext implements Context {
$this->featureContext->setResponse(
HttpRequestHelper::get(
$this->featureContext->getBaseUrl() . '/archiver?' . $queryString,
'',
$this->featureContext->getStepLineRef(),
$user,
$this->featureContext->getPasswordForUser($user),
)
@@ -24,6 +24,7 @@ use TestHelpers\HttpRequestHelper;
use Behat\Gherkin\Node\TableNode;
use Behat\Behat\Context\Context;
use TestHelpers\SetupHelper;
use \Psr\Http\Message\ResponseInterface;
/**
* Authentication functions
@@ -98,7 +99,7 @@ class AuthContext implements Context {
* @return void
*/
public function userRequestsURLWith(string $url, string $method):void {
$this->sendRequest($url, $method);
$this->featureContext->setResponse($this->sendRequest($url, $method));
}
/**
@@ -114,7 +115,7 @@ class AuthContext implements Context {
public function userRequestsURLWithNoAuth(string $user, string $url, string $method):void {
$userRenamed = $this->featureContext->getActualUsername($user);
$url = $this->featureContext->substituteInLineCodes($url, $userRenamed);
$this->sendRequest($url, $method);
$this->featureContext->setResponse($this->sendRequest($url, $method));
}
/**
@@ -126,8 +127,7 @@ class AuthContext implements Context {
* @return void
*/
public function userHasRequestedURLWith(string $url, string $method):void {
$this->sendRequest($url, $method);
$this->featureContext->theHTTPStatusCodeShouldBeSuccess();
$this->featureContext->theHTTPStatusCodeShouldBeBetween(200, 299, $this->sendRequest($url, $method));
}
/**
@@ -174,7 +174,7 @@ class AuthContext implements Context {
$row['endpoint'],
$ofUser
);
$this->sendRequest($row['endpoint'], $method, null, false, $body);
$this->featureContext->setResponse($this->sendRequest($row['endpoint'], $method, null, false, $body));
$this->featureContext->pushToLastStatusCodesArrays();
}
}
@@ -212,7 +212,7 @@ class AuthContext implements Context {
$this->featureContext->emptyLastOCSStatusCodesArray();
$this->featureContext->emptyLastHTTPStatusCodesArray();
foreach ($table->getHash() as $row) {
$this->sendRequest($row['endpoint'], $method);
$this->featureContext->setResponse($this->sendRequest($row['endpoint'], $method));
$this->featureContext->pushToLastStatusCodesArrays();
}
}
@@ -578,7 +578,7 @@ class AuthContext implements Context {
* @param string|null $body
* @param array|null $headers
*
* @return void
* @return ResponseInterface
*/
public function sendRequest(
string $url,
@@ -587,7 +587,7 @@ class AuthContext implements Context {
bool $useCookies = false,
?string $body = null,
?array $headers = []
):void {
):ResponseInterface {
// reset responseXml
$this->featureContext->setResponseXml([]);
@@ -605,18 +605,16 @@ class AuthContext implements Context {
if (isset($this->requestToken)) {
$headers['requesttoken'] = $this->featureContext->getRequestToken();
}
$this->featureContext->setResponse(
HttpRequestHelper::sendRequest(
$fullUrl,
$this->featureContext->getStepLineRef(),
$method,
null,
null,
$headers,
$body,
null,
$cookies
)
return HttpRequestHelper::sendRequest(
$fullUrl,
$this->featureContext->getStepLineRef(),
$method,
null,
null,
$headers,
$body,
null,
$cookies
);
}
@@ -781,13 +779,15 @@ class AuthContext implements Context {
} else {
$authString = $userRenamed . ":" . $this->featureContext->getActualPassword($password);
}
$this->sendRequest(
$url,
$method,
'basic ' . \base64_encode($authString),
false,
$body,
$header
$this->featureContext->setResponse(
$this->sendRequest(
$url,
$method,
'basic ' . \base64_encode($authString),
false,
$body,
$header
)
);
}
@@ -817,13 +817,15 @@ class AuthContext implements Context {
foreach ($headersTable as $row) {
$headers[$row['header']] = $row ['value'];
}
$this->sendRequest(
$url,
$method,
'basic ' . \base64_encode($authString),
false,
null,
$headers
$this->featureContext->setResponse(
$this->sendRequest(
$url,
$method,
'basic ' . \base64_encode($authString),
false,
null,
$headers
)
);
}
@@ -884,10 +886,12 @@ class AuthContext implements Context {
*/
public function userRequestsURLWithUsingBasicTokenAuth(string $user, string $url, string $method):void {
$user = $this->featureContext->getActualUsername($user);
$this->sendRequest(
$url,
$method,
'basic ' . \base64_encode("$user:" . $this->clientToken)
$this->featureContext->setResponse(
$this->sendRequest(
$url,
$method,
'basic ' . \base64_encode("$user:" . $this->clientToken)
)
);
}
@@ -914,7 +918,7 @@ class AuthContext implements Context {
* @return void
*/
public function userRequestsURLWithUsingAClientToken(string $url, string $method):void {
$this->sendRequest($url, $method, 'token ' . $this->clientToken);
$this->featureContext->setResponse($this->sendRequest($url, $method, 'token ' . $this->clientToken));
}
/**
@@ -939,7 +943,7 @@ class AuthContext implements Context {
* @return void
*/
public function userRequestsURLWithUsingAppPassword(string $url, string $method):void {
$this->sendRequest($url, $method, 'token ' . $this->appToken);
$this->featureContext->setResponse($this->sendRequest($url, $method, 'token ' . $this->appToken));
}
/**
@@ -952,7 +956,7 @@ class AuthContext implements Context {
* @return void
*/
public function theUserRequestsWithUsingAppPasswordNamed(string $url, string $method, string $tokenName):void {
$this->sendRequest($url, $method, 'token ' . $this->appTokens[$tokenName]['token']);
$this->featureContext->setResponse($this->sendRequest($url, $method, 'token ' . $this->appTokens[$tokenName]['token']));
}
/**
@@ -977,7 +981,7 @@ class AuthContext implements Context {
* @return void
*/
public function userRequestsURLWithBrowserSession(string $url, string $method):void {
$this->sendRequest($url, $method, null, true);
$this->featureContext->setResponse($this->sendRequest($url, $method, null, true));
}
/**
@@ -23,6 +23,7 @@ use Behat\Behat\Context\Context;
use Behat\Behat\Hook\Scope\BeforeScenarioScope;
use PHPUnit\Framework\Assert;
use TestHelpers\WebDavHelper;
use Psr\Http\Message\ResponseInterface;
require_once 'bootstrap.php';
@@ -32,6 +33,32 @@ require_once 'bootstrap.php';
class ChecksumContext implements Context {
private FeatureContext $featureContext;
/**
* @param string $user
* @param string $source
* @param string $destination
* @param string $checksum
*
* @return ResponseInterface
*/
public function uploadFileToWithChecksumUsingTheAPI(
string $user,
string $source,
string $destination,
string $checksum
):ResponseInterface {
$file = \file_get_contents(
$this->featureContext->acceptanceTestsDirLocation() . $source
);
return $this->featureContext->makeDavRequest(
$user,
'PUT',
$destination,
['OC-Checksum' => $checksum],
$file
);
}
/**
* @When user :user uploads file :source to :destination with checksum :checksum using the WebDAV API
*
@@ -48,17 +75,7 @@ class ChecksumContext implements Context {
string $destination,
string $checksum
):void {
$file = \file_get_contents(
$this->featureContext->acceptanceTestsDirLocation() . $source
);
$response = $this->featureContext->makeDavRequest(
$user,
'PUT',
$destination,
['OC-Checksum' => $checksum],
$file
);
$this->featureContext->setResponse($response);
$this->featureContext->setResponse($this->uploadFileToWithChecksumUsingTheAPI($user, $source, $destination, $checksum));
}
/**
@@ -78,13 +95,36 @@ class ChecksumContext implements Context {
string $checksum
):void {
$user = $this->featureContext->getActualUsername($user);
$this->userUploadsFileToWithChecksumUsingTheAPI(
$response = $this->uploadFileToWithChecksumUsingTheAPI(
$user,
$source,
$destination,
$checksum
);
$this->featureContext->theHTTPStatusCodeShouldBeSuccess();
$this->featureContext->theHTTPStatusCodeShouldBe([201,204], '', $response);
}
/**
* @param string $user
* @param string $content
* @param string $checksum
* @param string $destination
*
* @return ResponseInterface
*/
public function uploadFileWithContentAndChecksumToUsingTheAPI(
string $user,
string $content,
string $checksum,
string $destination
):ResponseInterface {
return $this->featureContext->makeDavRequest(
$user,
'PUT',
$destination,
['OC-Checksum' => $checksum],
$content
);
}
/**
@@ -103,14 +143,7 @@ class ChecksumContext implements Context {
string $checksum,
string $destination
):void {
$response = $this->featureContext->makeDavRequest(
$user,
'PUT',
$destination,
['OC-Checksum' => $checksum],
$content
);
$this->featureContext->setResponse($response);
$this->featureContext->setResponse($this->uploadFileWithContentAndChecksumToUsingTheAPI($user, $content, $checksum, $destination));
}
/**
@@ -130,13 +163,8 @@ class ChecksumContext implements Context {
string $destination
):void {
$user = $this->featureContext->getActualUsername($user);
$this->userUploadsFileWithContentAndChecksumToUsingTheAPI(
$user,
$content,
$checksum,
$destination
);
$this->featureContext->theHTTPStatusCodeShouldBeSuccess();
$response = $this->uploadFileWithContentAndChecksumToUsingTheAPI($user, $content, $checksum, $destination);
$this->featureContext->theHTTPStatusCodeShouldBe(201, '', $response);
}
/**
@@ -374,6 +402,36 @@ class ChecksumContext implements Context {
);
}
/**
* @param string $user
* @param int $num
* @param int $total
* @param string $data
* @param string $destination
* @param string $expectedChecksum
*
* @return ResponseInterface
*/
public function uploadChunkFileOfWithToWithChecksum(
string $user,
int $num,
int $total,
string $data,
string $destination,
string $expectedChecksum
):ResponseInterface {
$user = $this->featureContext->getActualUsername($user);
$num -= 1;
$file = "$destination-chunking-42-$total-$num";
return $this->featureContext->makeDavRequest(
$user,
'PUT',
$file,
['OC-Checksum' => $expectedChecksum, 'OC-Chunked' => '1'],
$data
);
}
/**
* @When user :user uploads chunk file :num of :total with :data to :destination with checksum :expectedChecksum using the WebDAV API
*
@@ -394,16 +452,7 @@ class ChecksumContext implements Context {
string $destination,
string $expectedChecksum
):void {
$user = $this->featureContext->getActualUsername($user);
$num -= 1;
$file = "$destination-chunking-42-$total-$num";
$response = $this->featureContext->makeDavRequest(
$user,
'PUT',
$file,
['OC-Checksum' => $expectedChecksum, 'OC-Chunked' => '1'],
$data
);
$response = $this->uploadChunkFileOfWithToWithChecksum($user, $num, $total, $data, $destination, $expectedChecksum);
$this->featureContext->setResponse($response);
}
@@ -427,15 +476,12 @@ class ChecksumContext implements Context {
string $destination,
string $expectedChecksum
):void {
$this->userUploadsChunkFileOfWithToWithChecksum(
$user,
$num,
$total,
$data,
$destination,
$expectedChecksum
$response = $this->uploadChunkFileOfWithToWithChecksum($user, $num, $total, $data, $destination, $expectedChecksum);
$this->featureContext->theHTTPStatusCodeShouldBe(
[201, 206],
'',
$response
);
$this->featureContext->theHTTPStatusCodeShouldBeOr(201, 206);
}
/**
@@ -39,15 +39,14 @@ class FavoritesContext implements Context {
* @param string$user
* @param string $path
*
* @return void
* @return ResponseInterface
*/
public function userFavoritesElement(string $user, string $path):void {
$response = $this->changeFavStateOfAnElement(
public function userFavoritesElement(string $user, string $path):ResponseInterface {
return $this->changeFavStateOfAnElement(
$user,
$path,
1
);
$this->featureContext->setResponse($response);
}
/**
@@ -59,7 +58,7 @@ class FavoritesContext implements Context {
* @return void
*/
public function userFavoritesElementUsingWebDavApi(string $user, string $path):void {
$this->userFavoritesElement($user, $path);
$this->featureContext->setResponse($this->userFavoritesElement($user, $path));
}
/**
@@ -71,8 +70,7 @@ class FavoritesContext implements Context {
* @return void
*/
public function userHasFavoritedElementUsingWebDavApi(string $user, string $path):void {
$this->userFavoritesElement($user, $path);
$this->featureContext->theHTTPStatusCodeShouldBeSuccess();
$this->featureContext->theHTTPStatusCodeShouldBe(207, '', $this->userFavoritesElement($user, $path));
}
/**
@@ -83,10 +81,11 @@ class FavoritesContext implements Context {
* @return void
*/
public function theUserFavoritesElement(string $path):void {
$this->userFavoritesElement(
$response = $this->userFavoritesElement(
$this->featureContext->getCurrentUser(),
$path
);
$this->featureContext->setResponse($response);
}
/**
@@ -97,13 +96,14 @@ class FavoritesContext implements Context {
* @return void
*/
public function theUserHasFavoritedElement(string $path):void {
$this->userFavoritesElement(
$response = $this->userFavoritesElement(
$this->featureContext->getCurrentUser(),
$path
);
$this->featureContext->theHTTPStatusCodeShouldBe(
207,
"Expected response status code to be 207 (Multi-status), but not found! "
"Expected response status code to be 207 (Multi-status), but not found! ",
$response
);
}
@@ -111,15 +111,14 @@ class FavoritesContext implements Context {
* @param string $user
* @param string $path
*
* @return void
* @return ResponseInterface
*/
public function userUnfavoritesElement(string $user, string $path):void {
$response = $this->changeFavStateOfAnElement(
public function userUnfavoritesElement(string $user, string $path):ResponseInterface {
return $this->changeFavStateOfAnElement(
$user,
$path,
0
);
$this->featureContext->setResponse($response);
}
/**
@@ -131,7 +130,7 @@ class FavoritesContext implements Context {
* @return void
*/
public function userUnfavoritesElementUsingWebDavApi(string $user, string $path):void {
$this->userUnfavoritesElement($user, $path);
$this->featureContext->setResponse($this->userUnfavoritesElement($user, $path));
}
/**
@@ -143,8 +142,7 @@ class FavoritesContext implements Context {
* @return void
*/
public function userHasUnfavoritedElementUsingWebDavApi(string $user, string $path):void {
$this->userUnfavoritesElement($user, $path);
$this->featureContext->theHTTPStatusCodeShouldBeSuccess();
$this->featureContext->theHTTPStatusCodeShouldBe(207, '', $this->userUnfavoritesElement($user, $path));
}
/**
@@ -212,10 +210,10 @@ class FavoritesContext implements Context {
/**
* @param string $path
*
* @return void
* @return ResponseInterface
*/
public function theUserUnfavoritesElement(string $path):void {
$this->userUnfavoritesElement(
public function theUserUnfavoritesElement(string $path):ResponseInterface {
return $this->userUnfavoritesElement(
$this->featureContext->getCurrentUser(),
$path
);
@@ -229,7 +227,7 @@ class FavoritesContext implements Context {
* @return void
*/
public function theUserUnfavoritesElementUsingWebDavApi(string $path):void {
$this->theUserUnfavoritesElement($path);
$this->featureContext->setResponse($this->theUserUnfavoritesElement($path));
}
/**
@@ -240,8 +238,7 @@ class FavoritesContext implements Context {
* @return void
*/
public function theUserHasUnfavoritedElementUsingWebDavApi(string $path):void {
$this->theUserUnfavoritesElement($path);
$this->featureContext->theHTTPStatusCodeShouldBeSuccess();
$this->featureContext->theHTTPStatusCodeShouldBe(207, '', $this->theUserUnfavoritesElement($path));
}
/**
@@ -1156,7 +1156,7 @@ class FeatureContext extends BehatVariablesContext {
*/
public function userSendsHTTPMethodToUrl(string $user, string $verb, string $url): void {
$user = $this->getActualUsername($user);
$this->sendingToWithDirectUrl($user, $verb, $url, null);
$this->setResponse($this->sendingToWithDirectUrl($user, $verb, $url, null));
}
/**
@@ -1173,6 +1173,20 @@ class FeatureContext extends BehatVariablesContext {
$this->theHTTPStatusCodeShouldBeSuccess();
}
/**
* @When user :user sends HTTP method :method to URL :davPath with content :content
*
* @param string $user
* @param string $method
* @param string $davPath
* @param string $content
*
* @return void
*/
public function userSendsHttpMethodToUrlWithContent(string $user, string $method, string $davPath, string $content): void {
$this->setResponse($this->sendingToWithDirectUrl($user, $method, $davPath, $content));
}
/**
* @When /^user "([^"]*)" sends HTTP method "([^"]*)" to URL "([^"]*)" with password "([^"]*)"$/
*
@@ -1184,7 +1198,7 @@ class FeatureContext extends BehatVariablesContext {
* @return void
*/
public function userSendsHTTPMethodToUrlWithPassword(string $user, string $verb, string $url, string $password): void {
$this->sendingToWithDirectUrl($user, $verb, $url, null, $password);
$this->setResponse($this->sendingToWithDirectUrl($user, $verb, $url, null, $password));
}
/**
@@ -1206,13 +1220,13 @@ class FeatureContext extends BehatVariablesContext {
* @param string|null $user
* @param string|null $verb
* @param string|null $url
* @param TableNode|null $body
* @param string|null $body
* @param string|null $password
*
* @return void
* @return ResponseInterface
* @throws GuzzleException
*/
public function sendingToWithDirectUrl(?string $user, ?string $verb, ?string $url, ?TableNode $body, ?string $password = null): void {
public function sendingToWithDirectUrl(?string $user, ?string $verb, ?string $url, string $body = null, ?string $password = null): ResponseInterface {
$fullUrl = $this->getBaseUrl() . $url;
if ($password === null) {
@@ -1235,23 +1249,18 @@ class FeatureContext extends BehatVariablesContext {
$cookies = $this->cookieJar;
}
$bodyRows = null;
if ($body instanceof TableNode) {
$bodyRows = $body->getRowsHash();
}
if (isset($this->requestToken)) {
$headers['requesttoken'] = $this->requestToken;
}
$this->response = HttpRequestHelper::sendRequest(
return HttpRequestHelper::sendRequest(
$fullUrl,
$this->getStepLineRef(),
$verb,
$user,
$password,
$headers,
$bodyRows,
$body,
$config,
$cookies
);
@@ -1289,11 +1298,13 @@ class FeatureContext extends BehatVariablesContext {
*
* @param int|int[]|string|string[] $expectedStatusCode
* @param string|null $message
* @param ResponseInterface|null $response
*
* @return void
*/
public function theHTTPStatusCodeShouldBe($expectedStatusCode, ?string $message = ""): void {
$actualStatusCode = $this->response->getStatusCode();
public function theHTTPStatusCodeShouldBe($expectedStatusCode, ?string $message = "", ?ResponseInterface $response = null): void {
$response = $response ?? $this->response;
$actualStatusCode = $response->getStatusCode();
if (\is_array($expectedStatusCode)) {
if ($message === "") {
$message = "HTTP status code $actualStatusCode is not one of the expected values " . \implode(" or ", $expectedStatusCode);
@@ -1415,14 +1426,17 @@ class FeatureContext extends BehatVariablesContext {
*
* @param int|string $minStatusCode
* @param int|string $maxStatusCode
* @param ResponseInterface|null $response
*
* @return void
*/
public function theHTTPStatusCodeShouldBeBetween(
$minStatusCode,
$maxStatusCode
$maxStatusCode,
?ResponseInterface $response= null
): void {
$statusCode = $this->response->getStatusCode();
$response = $response ?? $this->response;
$statusCode = $response->getStatusCode();
$message = "The HTTP status code $statusCode is not between $minStatusCode and $maxStatusCode";
Assert::assertGreaterThanOrEqual(
$minStatusCode,
@@ -2288,9 +2302,11 @@ class FeatureContext extends BehatVariablesContext {
$jsonExpectedDecoded = \json_decode($jsonExpected->getRaw(), true);
$jsonRespondedDecoded = $this->getJsonDecodedResponse();
$this->appConfigurationContext->theAdministratorGetsCapabilitiesCheckResponse();
$response = $this->appConfigurationContext->userGetsCapabilities($this->appConfigurationContext->getAdminUsernameForCapabilitiesCheck());
$this->theHTTPStatusCodeShouldBe(200, '', $response);
$responseXml = $this->getResponseXml($response)->data->capabilities;
$edition = $this->appConfigurationContext->getParameterValueFromXml(
$this->appConfigurationContext->getCapabilitiesXml(__METHOD__),
$responseXml,
'core',
'status@@@edition'
);
@@ -2302,7 +2318,7 @@ class FeatureContext extends BehatVariablesContext {
}
$product = $this->appConfigurationContext->getParameterValueFromXml(
$this->appConfigurationContext->getCapabilitiesXml(__METHOD__),
$responseXml,
'core',
'status@@@product'
);
@@ -2313,7 +2329,7 @@ class FeatureContext extends BehatVariablesContext {
}
$productName = $this->appConfigurationContext->getParameterValueFromXml(
$this->appConfigurationContext->getCapabilitiesXml(__METHOD__),
$responseXml,
'core',
'status@@@productname'
);
@@ -2331,7 +2347,7 @@ class FeatureContext extends BehatVariablesContext {
// We are on oCIS or reva or some other implementation. We cannot do "occ status".
// So get the expected version values by looking in the capabilities response.
$version = $this->appConfigurationContext->getParameterValueFromXml(
$this->appConfigurationContext->getCapabilitiesXml(__METHOD__),
$responseXml,
'core',
'status@@@version'
);
@@ -2343,7 +2359,7 @@ class FeatureContext extends BehatVariablesContext {
}
$versionString = $this->appConfigurationContext->getParameterValueFromXml(
$this->appConfigurationContext->getCapabilitiesXml(__METHOD__),
$responseXml,
'core',
'status@@@versionstring'
);
@@ -3375,6 +3391,7 @@ class FeatureContext extends BehatVariablesContext {
if (\count(WebDavHelper::$spacesIdRef) > 0) {
WebDavHelper::$spacesIdRef = [];
}
WebDavHelper::$SPACE_ID_FROM_OCIS = '';
}
/**
@@ -134,17 +134,14 @@ class FilesVersionsContext implements Context {
}
/**
* @When user :user restores version index :versionIndex of file :path using the WebDAV API
* @Given user :user has restored version index :versionIndex of file :path
*
* @param string $user
* @param int $versionIndex
* @param string $path
*
* @return void
* @return ResponseInterface
* @throws Exception
*/
public function userRestoresVersionIndexOfFile(string $user, int $versionIndex, string $path):void {
public function restoreVersionIndexOfFile(string $user, int $versionIndex, string $path):ResponseInterface {
$user = $this->featureContext->getActualUsername($user);
$fileId = $this->featureContext->getFileIdForPath($user, $path);
Assert::assertNotNull($fileId, __METHOD__ . " fileid of file $path user $user not found (the file may not exist)");
@@ -155,7 +152,7 @@ class FilesVersionsContext implements Context {
WebDavHelper::getDavPath($user, 2) . \trim($path, "/");
$fullUrl = $this->featureContext->getBaseUrlWithoutPath() .
$xmlPart[$versionIndex];
$response = HttpRequestHelper::sendRequest(
return HttpRequestHelper::sendRequest(
$fullUrl,
$this->featureContext->getStepLineRef(),
'COPY',
@@ -163,6 +160,35 @@ class FilesVersionsContext implements Context {
$this->featureContext->getPasswordForUser($user),
['Destination' => $destinationUrl]
);
}
/**
* @Given user :user has restored version index :versionIndex of file :path
*
* @param string $user
* @param int $versionIndex
* @param string $path
*
* @return void
* @throws Exception
*/
public function userHasRestoredVersionIndexOfFile(string $user, int $versionIndex, string $path):void {
$response = $this->restoreVersionIndexOfFile($user, $versionIndex, $path);
$this->featureContext->theHTTPStatusCodeShouldBe(204, "", $response);
}
/**
* @When user :user restores version index :versionIndex of file :path using the WebDAV API
*
* @param string $user
* @param int $versionIndex
* @param string $path
*
* @return void
* @throws Exception
*/
public function userRestoresVersionIndexOfFile(string $user, int $versionIndex, string $path):void {
$response = $this->restoreVersionIndexOfFile($user, $versionIndex, $path);
$this->featureContext->setResponse($response, $user);
}
@@ -280,16 +306,14 @@ class FilesVersionsContext implements Context {
}
/**
* @When user :user downloads the version of file :path with the index :index
*
* @param string $user
* @param string $path
* @param string $index
*
* @return void
* @return ResponseInterface
* @throws Exception
*/
public function downloadVersion(string $user, string $path, string $index):void {
public function downloadVersion(string $user, string $path, string $index):ResponseInterface {
$user = $this->featureContext->getActualUsername($user);
$fileId = $this->featureContext->getFileIdForPath($user, $path);
Assert::assertNotNull($fileId, __METHOD__ . " fileid of file $path user $user not found (the file may not exist)");
@@ -305,13 +329,26 @@ class FilesVersionsContext implements Context {
$url = WebDavHelper::sanitizeUrl(
$this->featureContext->getBaseUrlWithoutPath() . $xmlPart[$index]
);
$response = HttpRequestHelper::get(
return HttpRequestHelper::get(
$url,
$this->featureContext->getStepLineRef(),
$user,
$this->featureContext->getPasswordForUser($user)
);
$this->featureContext->setResponse($response, $user);
}
/**
* @When user :user downloads the version of file :path with the index :index
*
* @param string $user
* @param string $path
* @param string $index
*
* @return void
* @throws Exception
*/
public function userDownloadsVersion(string $user, string $path, string $index):void {
$this->featureContext->setResponse($this->downloadVersion($user, $path, $index), $user);
}
/**
@@ -331,9 +368,9 @@ class FilesVersionsContext implements Context {
string $user,
string $content
): void {
$this->downloadVersion($user, $path, $index);
$this->featureContext->theHTTPStatusCodeShouldBe("200");
$this->featureContext->downloadedContentShouldBe($content);
$response = $this->downloadVersion($user, $path, $index);
$this->featureContext->theHTTPStatusCodeShouldBe("200", '', $response);
$this->featureContext->checkDownloadedContentMatches($content, '', $response);
}
/**
@@ -724,41 +724,6 @@ class GraphContext implements Context {
return $this->getArrayOfUsersResponded($this->listGroupMembers($group));
}
/**
* creates a user with provided data
* actor: the administrator
*
* @param string $user
* @param string $password
* @param string $email
* @param string $displayName
*
* @return void
* @throws Exception|GuzzleException
*/
public function theAdminHasCreatedUser(
string $user,
string $password,
string $email,
string $displayName
): void {
$response = GraphHelper::createUser(
$this->featureContext->getBaseUrl(),
$this->featureContext->getStepLineRef(),
$this->featureContext->getAdminUsername(),
$this->featureContext->getAdminPassword(),
$user,
$password,
$email,
$displayName
);
if ($response->getStatusCode() !== 200) {
$this->throwHttpException($response, "Could not create user $user");
} else {
$this->featureContext->setResponse($response);
}
}
/**
* @When /^the user "([^"]*)" creates a new user using GraphAPI with the following settings:$/
*
@@ -795,28 +760,6 @@ class GraphContext implements Context {
$this->featureContext->setResponse($response);
}
/**
* @Given /^the user "([^"]*)" has created a new user using the Graph API with the following settings:$/
*
* @param string $user
* @param TableNode $table
*
* @return void
* @throws Exception|GuzzleException
*/
public function theUserHasCreatedANewUserUsingGraphapiWithTheFollowingSettings(string $user, TableNode $table): void {
$this->theUserCreatesNewUser(
$user,
$table
);
$rows = $table->getRowsHash();
$response = $this->featureContext->getResponse();
if ($response->getStatusCode() !== 200) {
$this->throwHttpException($response, "Could not create user '$rows[userName]'");
}
}
/**
* adds a user to a group
*
@@ -432,7 +432,9 @@ class NotificationContext implements Context {
GraphHelper::getMySpaces(
$this->featureContext->getBaseUrl(),
$user,
$this->featureContext->getPasswordForUser($user)
$this->featureContext->getPasswordForUser($user),
'',
$this->featureContext->getStepLineRef()
)
);
$expectedEmailBodyContent = $this->featureContext->substituteInLineCodes(
@@ -541,7 +543,7 @@ class NotificationContext implements Context {
$user ? $this->featureContext->getPasswordForUser($user) : $this->featureContext->getAdminPassword(),
'POST',
$this->globalNotificationEndpointPath,
'',
$this->featureContext->getStepLineRef(),
json_encode($payload),
2
);
@@ -608,7 +610,7 @@ class NotificationContext implements Context {
$user ? $this->featureContext->getPasswordForUser($user) : $this->featureContext->getAdminPassword(),
'DELETE',
$this->globalNotificationEndpointPath,
'',
$this->featureContext->getStepLineRef(),
json_encode($payload),
2
);
@@ -29,6 +29,7 @@ use TestHelpers\UserHelper;
use TestHelpers\HttpRequestHelper;
use TestHelpers\OcisHelper;
use TestHelpers\WebDavHelper;
use TestHelpers\GraphHelper;
use Laminas\Ldap\Exception\LdapException;
use Laminas\Ldap\Ldap;
@@ -361,6 +362,65 @@ trait Provisioning {
);
}
/**
* @Given user :user has been created with default attributes and without skeleton files
*
* @param string $user
*
* @return void
* @throws Exception|GuzzleException
*/
public function userHasBeenCreatedWithDefaultAttributes(
string $user
):void {
$this->userHasBeenCreated(["userName" => $user]);
}
/**
* @Given these users have been created without skeleton files and not initialized:
*
* @param TableNode $table
*
* @return void
* @throws Exception|GuzzleException
*/
public function userHasBeenCreatedWithDefaultAttributesAndNotInitialized(
TableNode $table
):void {
$this->usersHaveBeenCreated($table, true, false);
}
/**
* @Given these users have been created with default attributes and without skeleton files:
* expects a table of users with the heading
* "|username|"
*
* @param TableNode $table
*
* @return void
* @throws Exception|GuzzleException
*/
public function theseUsersHaveBeenCreatedWithDefaultAttributesAndWithoutSkeletonFiles(TableNode $table):void {
$this->usersHaveBeenCreated($table);
}
/**
* @Given the user :byUser has created a new user using the Graph API with the following settings:
*
* @param string $byUser
* @param TableNode $table
*
* @return void
* @throws Exception|GuzzleException
*/
public function theAdministratorHasCreatedANewUserWithFollowingSettings(string $byUser, TableNode $table): void {
$rows = $table->getRowsHash();
$this->userHasBeenCreated(
$rows,
$byUser
);
}
/**
*
* @param string $groupname
@@ -383,125 +443,6 @@ trait Provisioning {
);
}
/**
* @When /^the administrator creates user "([^"]*)" using the provisioning API$/
*
* @param string|null $user
*
* @return void
* @throws Exception
*/
public function adminCreatesUserUsingTheProvisioningApi(?string $user):void {
$this->createUser(
$user,
null,
null,
null,
true,
'api'
);
$this->pushToLastStatusCodesArrays();
}
/**
* @Given /^user "([^"]*)" has been created with default attributes in the database user backend$/
*
* @param string|null $user
*
* @return void
* @throws Exception
*/
public function userHasBeenCreatedOnDatabaseBackend(?string $user):void {
$this->adminCreatesUserUsingTheProvisioningApi($user);
$this->userShouldExist($user);
}
/**
* @Given /^user "([^"]*)" has been created with default attributes and (tiny|small|large)\s?skeleton files$/
*
* @param string $user
* @param string $skeletonType
* @param boolean $skeleton
*
* @return void
* @throws Exception
*/
public function userHasBeenCreatedWithDefaultAttributes(
string $user,
string $skeletonType = "",
bool $skeleton = true
):void {
if ($skeletonType === "") {
$skeletonType = $this->getSmallestSkeletonDirName();
}
$originalSkeletonPath = $this->setSkeletonDirByType($skeletonType);
try {
$this->createUser(
$user,
null,
null,
null,
true,
null,
true,
$skeleton
);
$this->userShouldExist($user);
} finally {
$this->setSkeletonDir($originalSkeletonPath);
}
}
/**
* @Given /^user "([^"]*)" has been created with default attributes and without skeleton files$/
*
* @param string $user
*
* @return void
* @throws Exception
*/
public function userHasBeenCreatedWithDefaultAttributesAndWithoutSkeletonFiles(string $user):void {
$this->userHasBeenCreatedWithDefaultAttributes($user);
}
/**
* @Given these users have been created with default attributes and without skeleton files:
* expects a table of users with the heading
* "|username|"
*
* @param TableNode $table
*
* @return void
* @throws Exception|GuzzleException
*/
public function theseUsersHaveBeenCreatedWithDefaultAttributesAndWithoutSkeletonFiles(TableNode $table):void {
$originalSkeletonPath = $this->setSkeletonDirByType($this->getSmallestSkeletonDirName());
try {
$this->createTheseUsers(true, true, true, $table);
} finally {
// restore skeleton directory even if user creation failed
$this->setSkeletonDir($originalSkeletonPath);
}
}
/**
* @Given /^these users have been created without skeleton files ?(and not initialized|):$/
* expects a table of users with the heading
* "|username|password|displayname|email|"
* password, displayname & email are optional
*
* @param TableNode $table
* @param string $doNotInitialize
*
* @return void
* @throws Exception
*/
public function theseUsersHaveBeenCreatedWithoutSkeletonFiles(TableNode $table, string $doNotInitialize):void {
$this->theseUsersHaveBeenCreated("", "", $doNotInitialize, $table);
}
/**
*
* @param string $path
@@ -837,43 +778,36 @@ trait Provisioning {
}
/**
* Creates multiple users
*
* This function will allow us to send user creation requests in parallel.
* This will be faster in comparison to waiting for each request to complete before sending another request.
*
* @param boolean $initialize
* @param array|null $usersAttributes
* @param string|null $method create the user with "ldap" or "api"
* @param boolean $skeleton
* @param TableNode $table
* @param bool $useDefault
* @param bool $initialize
*
* @return void
* @throws Exception
* @throws GuzzleException
*/
public function usersHaveBeenCreated(
bool $initialize,
?array $usersAttributes,
?string $method = null,
?bool $skeleton = true
TableNode $table,
bool $useDefault=true,
bool $initialize=true
) {
$this->verifyTableNodeColumns($table, ['username'], ['displayname', 'email', 'password']);
$table = $table->getColumnsHash();
$users = $this->buildUsersAttributesArray($useDefault, $table);
$requests = [];
$client = HttpRequestHelper::createClient(
$this->getAdminUsername(),
$this->getAdminPassword()
);
$useLdap = false;
$useGraph = false;
if ($method === null) {
$useLdap = $this->isTestingWithLdap();
$useGraph = OcisHelper::isTestingWithGraphApi();
} elseif ($method === "ldap") {
$useLdap = true;
} elseif ($method === "graph") {
$useGraph = true;
}
foreach ($usersAttributes as $userAttributes) {
if ($useLdap) {
foreach ($users as $userAttributes) {
if ($this->isTestingWithLdap()) {
$this->createLdapUser($userAttributes);
} else {
$attributesToCreateUser['userid'] = $userAttributes['userid'];
@@ -890,75 +824,50 @@ trait Provisioning {
} else {
$attributesToCreateUser['email'] = $userAttributes['email'];
}
if ($useGraph) {
$body = \TestHelpers\GraphHelper::prepareCreateUserPayload(
$attributesToCreateUser['userid'],
$attributesToCreateUser['password'],
$attributesToCreateUser['email'],
$attributesToCreateUser['displayname']
);
$request = \TestHelpers\GraphHelper::createRequest(
$this->getBaseUrl(),
$this->getStepLineRef(),
"POST",
'users',
$body,
);
} else {
// Create an OCS request for creating the user. The request is not sent to the server yet.
$request = OcsApiHelper::createOcsRequest(
$this->getBaseUrl(),
'POST',
"/cloud/users",
$this->stepLineRef,
$attributesToCreateUser
);
}
$body = GraphHelper::prepareCreateUserPayload(
$attributesToCreateUser['userid'],
$attributesToCreateUser['password'],
$attributesToCreateUser['email'],
$attributesToCreateUser['displayname']
);
$request = GraphHelper::createRequest(
$this->getBaseUrl(),
$this->getStepLineRef(),
"POST",
'users',
$body,
);
// Add the request to the $requests array so that they can be sent in parallel.
$requests[] = $request;
}
}
$exceptionToThrow = null;
if (!$useLdap) {
if (!$this->isTestingWithLdap()) {
$results = HttpRequestHelper::sendBatchRequest($requests, $client);
// Check all requests to inspect failures.
foreach ($results as $key => $e) {
if ($e instanceof ClientException) {
if ($useGraph) {
$responseBody = $this->getJsonDecodedResponse($e->getResponse());
$httpStatusCode = $e->getResponse()->getStatusCode();
$graphStatusCode = $responseBody['error']['code'];
$messageText = $responseBody['error']['message'];
$exceptionToThrow = new Exception(
__METHOD__ .
" Unexpected failure when creating the user '" .
$usersAttributes[$key]['userid'] . "'" .
"\nHTTP status $httpStatusCode " .
"\nGraph status $graphStatusCode " .
"\nError message $messageText"
);
} else {
$responseXml = $this->getResponseXml($e->getResponse(), __METHOD__);
$messageText = (string) $responseXml->xpath("/ocs/meta/message")[0];
$ocsStatusCode = (string) $responseXml->xpath("/ocs/meta/statuscode")[0];
$httpStatusCode = $e->getResponse()->getStatusCode();
$reasonPhrase = $e->getResponse()->getReasonPhrase();
$exceptionToThrow = new Exception(
__METHOD__ . " Unexpected failure when creating the user '" .
$usersAttributes[$key]['userid'] . "': HTTP status $httpStatusCode " .
"HTTP reason $reasonPhrase OCS status $ocsStatusCode " .
"OCS message $messageText"
);
}
$responseBody = $this->getJsonDecodedResponse($e->getResponse());
$httpStatusCode = $e->getResponse()->getStatusCode();
$graphStatusCode = $responseBody['error']['code'];
$messageText = $responseBody['error']['message'];
$exceptionToThrow = new Exception(
__METHOD__ .
" Unexpected failure when creating the user '" .
$users[$key]['userid'] . "'" .
"\nHTTP status $httpStatusCode " .
"\nGraph status $graphStatusCode " .
"\nError message $messageText"
);
}
}
}
// Create requests for setting displayname and email for the newly created users.
// These values cannot be set while creating the user, so we have to edit the newly created user to set these values.
foreach ($usersAttributes as $userAttributes) {
if ($useGraph) {
foreach ($users as $userAttributes) {
if (!$this->isTestingWithLdap()) {
// for graph api, we need to save the user id to be able to add it in some group
// can be fetched with the "onPremisesSamAccountName" i.e. userid
$this->graphContext->adminHasRetrievedUserUsingTheGraphApi($userAttributes['userid']);
@@ -973,125 +882,22 @@ trait Provisioning {
$userAttributes['email'],
$userAttributes['id']
);
OcisHelper::createEOSStorageHome(
$this->getBaseUrl(),
$userAttributes['userid'],
$userAttributes['password'],
$this->getStepLineRef()
);
}
if (isset($exceptionToThrow)) {
throw $exceptionToThrow;
}
// If the user should have skeleton files, and we are testing on OCIS
// then do some work to "manually" put the skeleton files in place.
// When testing on ownCloud 10 the user is already getting whatever
// skeleton dir is defined in the server-under-test.
if ($skeleton) {
$this->manuallyAddSkeletonFiles($usersAttributes);
}
}
/**
* @When /^the administrator creates these users with ?(default attributes and|) skeleton files ?(but not initialized|):$/
*
* expects a table of users with the heading
* "|username|password|displayname|email|"
* password, displayname & email are optional
*
* @param string $setDefaultAttributes
* @param string $doNotInitialize
* @param TableNode $table
*
* @return void
* @throws Exception
* @throws GuzzleException
*/
public function theAdministratorCreatesTheseUsers(
string $setDefaultAttributes,
string $doNotInitialize,
TableNode $table
): void {
$this->verifyTableNodeColumns($table, ['username'], ['displayname', 'email', 'password']);
$table = $table->getColumnsHash();
$setDefaultAttributes = $setDefaultAttributes !== "";
$initialize = $doNotInitialize === "";
$usersAttributes = $this->buildUsersAttributesArray($setDefaultAttributes, $table);
$this->usersHaveBeenCreated(
$initialize,
$usersAttributes
);
}
/**
* expects a table of users with the heading
* "|username|password|displayname|email|"
* password, displayname & email are optional
*
* @param boolean $setDefaultAttributes
* @param boolean $initialize
* @param boolean $skeleton
* @param TableNode $table
*
* @return void
* @throws Exception
* @throws GuzzleException
*/
public function createTheseUsers(bool $setDefaultAttributes, bool $initialize, bool $skeleton, TableNode $table):void {
$this->verifyTableNodeColumns($table, ['username'], ['displayname', 'email', 'password']);
$table = $table->getColumnsHash();
$usersAttributes = $this->buildUsersAttributesArray($setDefaultAttributes, $table);
$this->usersHaveBeenCreated(
$initialize,
$usersAttributes,
null,
$skeleton
);
foreach ($usersAttributes as $expectedUser) {
$this->userShouldExist($expectedUser["userid"]);
}
}
/**
* @Given /^these users have been created with ?(default attributes and|) (tiny|small|large)\s?skeleton files ?(but not initialized|):$/
*
* expects a table of users with the heading
* "|username|password|displayname|email|"
* password, displayname & email are optional
*
* @param string $defaultAttributesText
* @param string $skeletonType
* @param string $doNotInitialize
* @param TableNode $table
*
* @return void
* @throws Exception|GuzzleException
*/
public function theseUsersHaveBeenCreated(
string $defaultAttributesText,
string $skeletonType,
string $doNotInitialize,
TableNode $table
):void {
if ($skeletonType === "") {
$skeletonType = $this->getSmallestSkeletonDirName();
foreach ($users as $user) {
Assert::assertTrue(
$this->userExists($user["userid"]),
"User '" . $user["userid"] . "' should exist but does not exist"
);
}
$originalSkeletonPath = $this->setSkeletonDirByType($skeletonType);
$setDefaultAttributes = $defaultAttributesText !== "";
$initialize = $doNotInitialize === "";
try {
$this->createTheseUsers($setDefaultAttributes, $initialize, true, $table);
} finally {
// The effective skeleton directory is the one when the user is initialized
// If we did not initialize the user on creation, then we need to leave
// the skeleton directory in effect so that it applies when some action
// happens later in the scenario that causes the user to be initialized.
if ($initialize) {
$this->setSkeletonDir($originalSkeletonPath);
if ($initialize) {
foreach ($users as $user) {
$this->initializeUser($user['userid'], $user['password']);
}
}
}
@@ -2380,7 +2186,6 @@ trait Provisioning {
* @throws JsonException
*/
public function userShouldExist(string $user):void {
$user = $this->getActualUsername($user);
Assert::assertTrue(
$this->userExists($user),
"User '$user' should exist but does not exist"
@@ -2723,8 +2528,13 @@ trait Provisioning {
* @return void
*/
public function initializeUser(string $user, string $password):void {
$url = $this->getBaseUrl()
. "/ocs/v$this->ocsApiVersion.php/cloud/users/$user";
$url = $this->getBaseUrl() . "/graph/v1.0/users/$user";
if (OcisHelper::isTestingOnReva()) {
$url = $this->getBaseUrl()
. "/ocs/v$this->ocsApiVersion.php/cloud/users/$user";
}
HttpRequestHelper::get(
$url,
$this->getStepLineRef(),
@@ -2830,41 +2640,35 @@ trait Provisioning {
/**
* creates a single user
*
* @param string|null $user
* @param string|null $password if null, then select a password
* @param string|null $displayName
* @param string|null $email
* @param bool $initialize initialize the user skeleton files etc
* @param string|null $method how to create the user api|occ, default api
* @param bool $setDefault sets the missing values to some default
* @param bool $skeleton
* @param array $userData
* @param string|null $byUser
*
* @return void
* @throws Exception|GuzzleException
*/
public function createUser(
?string $user,
?string $password = null,
?string $displayName = null,
?string $email = null,
bool $initialize = true,
?string $method = null,
bool $setDefault = true,
bool $skeleton = true
public function userHasBeenCreated(
array $userData,
string $byUser = null
):void {
$userId = null;
$user = $userData["userName"];
$displayName = $userData["displayName"] ?? null;
$email = $userData["email"] ?? null;
$password = $userData["password"] ?? null;
if ($password === null) {
$password = $this->getPasswordForUser($user);
}
if ($displayName === null && $setDefault === true) {
if ($displayName === null) {
$displayName = $this->getDisplayNameForUser($user);
if ($displayName === null) {
$displayName = $this->getDisplayNameForUser('regularuser');
}
}
if ($email === null && $setDefault === true) {
if ($email === null) {
$email = $this->getEmailAddressForUser($user);
if ($email === null) {
@@ -2872,61 +2676,50 @@ trait Provisioning {
$email = \str_replace(["@", " "], "", $user) . '@owncloud.com';
}
}
$user = $this->getActualUsername($user);
if ($method === null && $this->isTestingWithLdap()) {
//guess yourself
$method = "ldap";
} elseif (OcisHelper::isTestingWithGraphApi()) {
$method = "graph";
} elseif ($method === null) {
$method = "api";
}
$user = \trim($user);
$method = \trim(\strtolower($method));
switch ($method) {
case "api":
case "ldap":
$settings = [];
$setting["userid"] = $user;
$setting["displayName"] = $displayName;
$setting["password"] = $password;
$setting["email"] = $email;
$settings[] = $setting;
try {
$this->usersHaveBeenCreated(
$initialize,
$settings,
$method,
$skeleton
);
} catch (LdapException $exception) {
throw new Exception(
__METHOD__ . " cannot create a LDAP user with provided data. Error: $exception"
);
}
break;
case "graph":
$this->graphContext->theAdminHasCreatedUser(
$user,
$password,
$email,
$displayName,
);
$newUser = $this->getJsonDecodedResponse();
$userId = $newUser['id'];
break;
default:
throw new InvalidArgumentException(
__METHOD__ . " Invalid method to create a user"
if ($this->isTestingWithLdap()) {
$setting["userid"] = $user;
$setting["displayName"] = $displayName;
$setting["password"] = $password;
$setting["email"] = $email;
try {
$this->createLdapUser($setting);
} catch (LdapException $exception) {
throw new Exception(
__METHOD__ . " cannot create a LDAP user with provided data. Error: $exception"
);
}
} else {
$reqUser = $byUser ? $this->getActualUsername($byUser) : $this->getAdminUsername();
$response = GraphHelper::createUser(
$this->getBaseUrl(),
$this->getStepLineRef(),
$reqUser,
$this->getPasswordForUser($reqUser),
$user,
$password,
$email,
$displayName,
);
Assert::assertEquals(
200,
$response->getStatusCode(),
__METHOD__ . " cannot create user '$user' using Graph API.\nResponse:" .
json_encode($this->getJsonDecodedResponse($response))
);
$userId = $this->getJsonDecodedResponse($response)['id'];
}
$this->addUserToCreatedUsersList($user, $password, $displayName, $email, $userId);
if ($initialize) {
$this->initializeUser($user, $password);
}
Assert::assertTrue(
$this->userExists($user),
"User '$user' should exist but does not exist"
);
$this->initializeUser($user, $password);
}
/**
@@ -2976,46 +2769,32 @@ trait Provisioning {
}
/**
* @param string|null $user
* @param string $user
*
* @return bool
* @throws JsonException
*/
public function userExists(?string $user):bool {
// in OCIS there is no admin user and in oC10 there are issues when
// sending the username in lowercase in the auth but in uppercase in
// the URL see https://github.com/owncloud/core/issues/36822
$user = $this->getActualUsername($user);
// In OCIS an intermittent issue restricts users to list their own account
// So use admin account to list the user
// https://github.com/owncloud/ocis/issues/820
// The special code can be reverted once the issue is fixed
if (OcisHelper::isTestingParallelDeployment()) {
$requestingUser = $this->getActualUsername($user);
$requestingPassword = $this->getPasswordForUser($user);
} elseif (OcisHelper::isTestingWithGraphApi()) {
$requestingUser = $this->getAdminUsername();
$requestingPassword = $this->getAdminPassword();
} elseif (!OcisHelper::isTestingOnReva()) {
$requestingUser = 'moss';
$requestingPassword = 'vista';
} else {
$requestingUser = $this->getActualUsername($user);
$requestingPassword = $this->getPasswordForUser($requestingUser);
}
$path = (OcisHelper::isTestingWithGraphApi())
public function userExists(string $user):bool {
$path = (!OcisHelper::isTestingOnReva())
? "/graph/v1.0"
: "/ocs/v2.php/cloud";
$fullUrl = $this->getBaseUrl() . $path . "/users/$user";
$this->response = HttpRequestHelper::get(
if (OcisHelper::isTestingOnReva()) {
$requestingUser = $this->getActualUsername($user);
$requestingPassword = $this->getPasswordForUser($user);
} else {
$requestingUser = $this->getAdminUsername();
$requestingPassword = $this->getAdminPassword();
}
$response = HttpRequestHelper::get(
$fullUrl,
$this->getStepLineRef(),
$requestingUser,
$requestingPassword
);
if ($this->response->getStatusCode() >= 400) {
if ($response->getStatusCode() >= 400) {
return false;
}
return true;
@@ -64,7 +64,6 @@ class SearchContext implements Context {
$user = $this->featureContext->getActualUsername($user);
$baseUrl = $this->featureContext->getBaseUrl();
$password = $this->featureContext->getPasswordForUser($user);
$headers['X-Request-Id'] = WebDavHelper::generateUUIDv4();
$body
= "<?xml version='1.0' encoding='utf-8' ?>\n" .
" <oc:search-files xmlns:a='DAV:' xmlns:oc='http://owncloud.org/ns' >\n" .
@@ -103,7 +102,7 @@ class SearchContext implements Context {
$password,
"REPORT",
"/",
$headers,
null,
$this->featureContext->getStepLineRef(),
$body,
$this->featureContext->getDavPathVersion()
@@ -58,7 +58,7 @@ class SettingsContext implements Context {
public function getAllExistingRoles(string $user): void {
$fullUrl = $this->baseUrl . $this->settingsUrl . "roles-list";
$this->featureContext->setResponse(
$this->spacesContext->sendPostRequestToUrl($fullUrl, $user, $this->featureContext->getPasswordForUser($user), "{}")
$this->spacesContext->sendPostRequestToUrl($fullUrl, $user, $this->featureContext->getPasswordForUser($user), "{}", $this->featureContext->getStepLineRef())
);
}
@@ -77,7 +77,7 @@ class SettingsContext implements Context {
$body = json_encode(["account_uuid" => $userId, "role_id" => $roleId], JSON_THROW_ON_ERROR);
$this->featureContext->setResponse(
$this->spacesContext->sendPostRequestToUrl($fullUrl, $user, $this->featureContext->getPasswordForUser($user), $body)
$this->spacesContext->sendPostRequestToUrl($fullUrl, $user, $this->featureContext->getPasswordForUser($user), $body, $this->featureContext->getStepLineRef())
);
}
@@ -93,7 +93,7 @@ class SettingsContext implements Context {
public function sendRequestAssignmentsList(string $user, string $userId): ResponseInterface {
$fullUrl = $this->baseUrl . $this->settingsUrl . "assignments-list";
$body = json_encode(["account_uuid" => $userId], JSON_THROW_ON_ERROR);
return $this->spacesContext->sendPostRequestToUrl($fullUrl, $user, $this->featureContext->getPasswordForUser($user), $body);
return $this->spacesContext->sendPostRequestToUrl($fullUrl, $user, $this->featureContext->getPasswordForUser($user), $body, $this->featureContext->getStepLineRef());
}
/**
@@ -271,7 +271,7 @@ class SettingsContext implements Context {
public function sendRequestGetBundlesList(string $user): void {
$fullUrl = $this->baseUrl . $this->settingsUrl . "bundles-list";
$this->featureContext->setResponse(
$this->spacesContext->sendPostRequestToUrl($fullUrl, $user, $this->featureContext->getPasswordForUser($user), '{}')
$this->spacesContext->sendPostRequestToUrl($fullUrl, $user, $this->featureContext->getPasswordForUser($user), '{}', $this->featureContext->getStepLineRef())
);
$this->featureContext->theHTTPStatusCodeShouldBe(
@@ -312,7 +312,7 @@ class SettingsContext implements Context {
$fullUrl = $this->baseUrl . $this->settingsUrl . "values-list";
$body = json_encode(["account_uuid" => "me"], JSON_THROW_ON_ERROR);
$this->featureContext->setResponse(
$this->spacesContext->sendPostRequestToUrl($fullUrl, $user, $this->featureContext->getPasswordForUser($user), $body)
$this->spacesContext->sendPostRequestToUrl($fullUrl, $user, $this->featureContext->getPasswordForUser($user), $body, $this->featureContext->getStepLineRef())
);
Assert::assertEquals(
@@ -349,12 +349,12 @@ class SettingsContext implements Context {
* @param string $user
* @param string $language
*
* @return void
* @return ResponseInterface
*
* @throws GuzzleException
* @throws Exception
*/
public function sendRequestToSwitchSystemLanguage(string $user, string $language): void {
public function sendRequestToSwitchSystemLanguage(string $user, string $language): ResponseInterface {
$profileBundlesList = $this->getBundlesList($user, "Profile");
Assert::assertNotEmpty($profileBundlesList, "bundles list is empty");
@@ -390,9 +390,12 @@ class SettingsContext implements Context {
],
JSON_THROW_ON_ERROR
);
$this->featureContext->setResponse(
$this->spacesContext->sendPostRequestToUrl($fullUrl, $user, $this->featureContext->getPasswordForUser($user), $body)
return $this->spacesContext->sendPostRequestToUrl(
$fullUrl,
$user,
$this->featureContext->getPasswordForUser($user),
$body,
$this->featureContext->getStepLineRef()
);
}
@@ -405,12 +408,14 @@ class SettingsContext implements Context {
* @return void
*
* @throws Exception
* @throws GuzzleException
*/
public function theUserHasSwitchedSysemLanguage(string $user, string $language): void {
$this->sendRequestToSwitchSystemLanguage($user, $language);
public function theUserHasSwitchedSystemLanguage(string $user, string $language): void {
$response = $this->sendRequestToSwitchSystemLanguage($user, $language);
$this->featureContext->theHTTPStatusCodeShouldBe(
201,
"Expected response status code should be 201"
"Expected response status code should be 201",
$response
);
}
}
@@ -272,7 +272,7 @@ class SpacesContext implements Context {
return HttpRequestHelper::get(
$fullUrl,
"",
$this->featureContext->getStepLineRef(),
$user,
$this->featureContext->getPasswordForUser($user),
[],
@@ -341,7 +341,7 @@ class SpacesContext implements Context {
$this->featureContext->getPasswordForUser($user),
"",
['oc:privatelink'],
"",
$this->featureContext->getStepLineRef(),
"0",
"files",
WebDavHelper::DAV_VERSION_SPACES
@@ -437,14 +437,16 @@ class SpacesContext implements Context {
$this->featureContext->getBaseUrl(),
$userAdmin,
$this->featureContext->getPasswordForUser($userAdmin),
$value["id"]
$value["id"],
$this->featureContext->getStepLineRef()
);
}
GraphHelper::deleteSpace(
$this->featureContext->getBaseUrl(),
$userAdmin,
$this->featureContext->getPasswordForUser($userAdmin),
$value["id"]
$value["id"],
$this->featureContext->getStepLineRef()
);
}
}
@@ -517,7 +519,8 @@ class SpacesContext implements Context {
$this->featureContext->getBaseUrl(),
$user,
$this->featureContext->getPasswordForUser($user),
"?" . $query
"?" . $query,
$this->featureContext->getStepLineRef()
)
);
$this->rememberTheAvailableSpaces();
@@ -544,7 +547,8 @@ class SpacesContext implements Context {
$this->featureContext->getBaseUrl(),
$user,
$this->featureContext->getPasswordForUser($user),
"?" . $query
"?" . $query,
$this->featureContext->getStepLineRef()
)
);
$this->rememberTheAvailableSpaces();
@@ -571,7 +575,9 @@ class SpacesContext implements Context {
$this->featureContext->getBaseUrl(),
$user,
$this->featureContext->getPasswordForUser($user),
$space["id"]
$space["id"],
'',
$this->featureContext->getStepLineRef()
)
);
}
@@ -603,7 +609,8 @@ class SpacesContext implements Context {
$this->featureContext->getBaseUrl(),
$user,
$this->featureContext->getPasswordForUser($user),
$body
$body,
$this->featureContext->getStepLineRef()
)
);
$this->setSpaceCreator($spaceName, $user);
@@ -659,7 +666,7 @@ class SpacesContext implements Context {
$this->featureContext->getPasswordForUser($user),
$foldersPath,
[],
'',
$this->featureContext->getStepLineRef(),
'infinity',
'files',
WebDavHelper::DAV_VERSION_SPACES
@@ -686,7 +693,7 @@ class SpacesContext implements Context {
$this->featureContext->setResponse(
HttpRequestHelper::sendRequest(
$url,
"",
$this->featureContext->getStepLineRef(),
"PATCH",
$this->featureContext->getActualUsername($user),
$this->featureContext->getPasswordForUser($user),
@@ -1251,7 +1258,8 @@ class SpacesContext implements Context {
$user,
$this->featureContext->getPasswordForUser($user),
$body,
$spaceId
$spaceId,
$this->featureContext->getStepLineRef()
);
}
@@ -1408,7 +1416,8 @@ class SpacesContext implements Context {
$user,
$this->featureContext->getPasswordForUser($user),
$body,
$spaceId
$spaceId,
$this->featureContext->getStepLineRef()
)
);
}
@@ -1505,7 +1514,8 @@ class SpacesContext implements Context {
$this->featureContext->getBaseUrl(),
$user,
$this->featureContext->getPasswordForUser($user),
$body
$body,
$this->featureContext->getStepLineRef()
);
}
@@ -1641,7 +1651,6 @@ class SpacesContext implements Context {
):void {
$space = $this->getSpaceByName($user, $fromSpaceName);
$headers['Destination'] = $this->destinationHeaderValueWithSpaceName($user, $fileDestination, $toSpaceName);
$headers['X-Request-Id'] = WebDavHelper::generateUUIDv4();
$fullUrl = $space["root"]["webDavUrl"] . '/' . ltrim($fileSource, "/");
$this->featureContext->setResponse($this->copyFilesAndFoldersRequest($user, $fullUrl, $headers));
}
@@ -1744,15 +1753,19 @@ class SpacesContext implements Context {
* @param string $user
* @param string $fileDestination
* @param string $spaceName
* @param string|null $endPath
*
* @return string
* @throws GuzzleException
*/
public function destinationHeaderValueWithSpaceName(string $user, string $fileDestination, string $spaceName):string {
public function destinationHeaderValueWithSpaceName(string $user, string $fileDestination, string $spaceName, string $endPath = null):string {
$space = $this->getSpaceByName($user, $spaceName);
$fileDestination = $this->escapePath(\ltrim($fileDestination, "/"));
if ($endPath && str_contains($endPath, 'remote.php')) {
// this is check for when we want to test with the endpoint having `remote.php` in space webdav
// by default spaces webdav is '/dav/spaces'
return $this->featureContext->getBaseUrl() . '/remote.php/dav/spaces/' . $space['id'] . '/' . $fileDestination;
}
return $space["root"]["webDavUrl"] . '/' . $fileDestination;
}
@@ -1777,6 +1790,27 @@ class SpacesContext implements Context {
);
}
/**
* @When /^user "([^"]*)" copies a file "([^"]*)" into "([^"]*)" inside space "([^"]*)" using file-id path "([^"]*)"$/
*
* @param string $user
* @param string $sourceFile
* @param string $destinationFile
* @param string $toSpaceName
* @param string $url
*
* @throws GuzzleException
* @return void
*/
public function userCopiesFileWithFileIdFromAndToSpaceBetweenSpaces(string $user, string $sourceFile, string $destinationFile, string $toSpaceName, string $url): void {
// split the source when there are sub-folders
$sourceFile = explode("/", $sourceFile);
$fileDestination = $this->escapePath(\ltrim($destinationFile, "/")) . '/' . $this->escapePath(\ltrim(end($sourceFile), "/"));
$headers['Destination'] = $this->destinationHeaderValueWithSpaceName($user, $fileDestination, $toSpaceName, $url);
$fullUrl = $this->featureContext->getBaseUrl() . $url;
$this->featureContext->setResponse($this->copyFilesAndFoldersRequest($user, $fullUrl, $headers));
}
/**
* @Given /^user "([^"]*)" has uploaded a file inside space "([^"]*)" with content "([^"]*)" to "([^"]*)"$/
*
@@ -1853,7 +1887,8 @@ class SpacesContext implements Context {
$fullUrl,
$user,
$this->featureContext->getPasswordForUser($user),
$body
$body,
$this->featureContext->getStepLineRef()
);
}
@@ -1911,7 +1946,8 @@ class SpacesContext implements Context {
$fullUrl,
$user,
$this->featureContext->getPasswordForUser($user),
$body
$body,
$this->featureContext->getStepLineRef()
)
);
$response = $this->featureContext->getResponseXml(null, __METHOD__);
@@ -1972,7 +2008,7 @@ class SpacesContext implements Context {
$fullUrl = $this->baseUrl . $this->ocsApiUrl . '/' . $shareId;
return HttpRequestHelper::sendRequest(
$fullUrl,
"",
$this->featureContext->getStepLineRef(),
"PUT",
$this->featureContext->getActualUsername($user),
$this->featureContext->getPasswordForUser($user),
@@ -2034,7 +2070,8 @@ class SpacesContext implements Context {
$fullUrl,
$user,
$this->featureContext->getPasswordForUser($user),
$body
$body,
$this->featureContext->getStepLineRef()
)
);
@@ -2134,7 +2171,7 @@ class SpacesContext implements Context {
$this->featureContext->setResponse(
HttpRequestHelper::delete(
$fullUrl,
"",
$this->featureContext->getStepLineRef(),
$user,
$this->featureContext->getPasswordForUser($user)
)
@@ -2161,7 +2198,7 @@ class SpacesContext implements Context {
$this->featureContext->setResponse(
HttpRequestHelper::delete(
$spaceWebDavUrl,
"",
$this->featureContext->getStepLineRef(),
$user,
$this->featureContext->getPasswordForUser($user)
)
@@ -2210,7 +2247,8 @@ class SpacesContext implements Context {
$this->featureContext->getBaseUrl(),
$user,
$this->featureContext->getPasswordForUser($user),
$space["id"]
$space["id"],
$this->featureContext->getStepLineRef()
)
);
}
@@ -2282,7 +2320,8 @@ class SpacesContext implements Context {
$this->featureContext->getBaseUrl(),
$user,
$this->featureContext->getPasswordForUser($user),
$space["id"]
$space["id"],
$this->featureContext->getStepLineRef()
)
);
}
@@ -2309,7 +2348,8 @@ class SpacesContext implements Context {
$this->featureContext->getBaseUrl(),
$user,
$this->featureContext->getPasswordForUser($user),
$space["id"]
$space["id"],
$this->featureContext->getStepLineRef()
)
);
}
@@ -2351,7 +2391,7 @@ class SpacesContext implements Context {
$space = $this->getSpaceByName($user, $spaceName);
$fullUrl = $this->baseUrl . $this->davSpacesUrl . "trash-bin/" . $space["id"];
$this->featureContext->setResponse(
HttpRequestHelper::sendRequest($fullUrl, '', 'PROPFIND', $user, $this->featureContext->getPasswordForUser($user))
HttpRequestHelper::sendRequest($fullUrl, $this->featureContext->getStepLineRef(), 'PROPFIND', $user, $this->featureContext->getPasswordForUser($user))
);
}
@@ -2371,7 +2411,7 @@ class SpacesContext implements Context {
$space = $this->getSpaceByNameManager($user, $spaceName);
$fullUrl = $this->baseUrl . $this->davSpacesUrl . "trash-bin/" . $space["id"];
$this->featureContext->setResponse(
HttpRequestHelper::sendRequest($fullUrl, '', 'PROPFIND', $user, $this->featureContext->getPasswordForUser($user))
HttpRequestHelper::sendRequest($fullUrl, $this->featureContext->getStepLineRef(), 'PROPFIND', $user, $this->featureContext->getPasswordForUser($user))
);
}
@@ -2480,7 +2520,7 @@ class SpacesContext implements Context {
$this->featureContext->setResponse(
HttpRequestHelper::sendRequest(
$fullUrl,
"",
$this->featureContext->getStepLineRef(),
'MOVE',
$user,
$this->featureContext->getPasswordForUser($user),
@@ -2524,7 +2564,7 @@ class SpacesContext implements Context {
$this->featureContext->setResponse(
HttpRequestHelper::sendRequest(
$fullUrl,
"",
$this->featureContext->getStepLineRef(),
'DELETE',
$user,
$this->featureContext->getPasswordForUser($user),
@@ -2572,7 +2612,7 @@ class SpacesContext implements Context {
$this->featureContext->setResponse(
HttpRequestHelper::get(
$fullUrl,
"",
$this->featureContext->getStepLineRef(),
$user,
$this->featureContext->getPasswordForUser($user)
)
@@ -2658,7 +2698,7 @@ class SpacesContext implements Context {
string $spaceName
): void {
$this->setSpaceIDByName($user, $spaceName);
$this->filesVersionsContext->downloadVersion($user, $fileName, $index);
$this->featureContext->setResponse($this->filesVersionsContext->downloadVersion($user, $fileName, $index));
WebDavHelper::$SPACE_ID_FROM_OCIS = '';
}
@@ -2867,7 +2907,8 @@ class SpacesContext implements Context {
$fullUrl,
$user,
$this->featureContext->getPasswordForUser($user),
$body
$body,
$this->featureContext->getStepLineRef()
)
);
@@ -3022,7 +3063,7 @@ class SpacesContext implements Context {
*/
public function userFavoritesElementInSpaceUsingTheWebdavApi(string $user, string $path, string $spaceName): void {
$this->setSpaceIDByName($user, $spaceName);
$this->favoritesContext->userFavoritesElement($user, $path);
$this->featureContext->setResponse($this->favoritesContext->userFavoritesElement($user, $path));
}
/**
@@ -3115,7 +3156,7 @@ class SpacesContext implements Context {
$this->featureContext->getPasswordForUser($user),
$resource,
$properties,
"",
$this->featureContext->getStepLineRef(),
"0",
"files",
WebDavHelper::DAV_VERSION_SPACES
@@ -3170,6 +3211,10 @@ class SpacesContext implements Context {
$xmlRes = $this->featureContext->getResponseXml();
foreach ($table->getHash() as $row) {
$findItem = $row['key'];
Assert::assertNotEmpty(
$xmlRes->xpath("//d:response/d:propstat/d:prop/$findItem"),
'The xml response "' . $xmlRes->asXML() . '" did not contain "<' . $findItem . '>" element'
);
$responseValue = $xmlRes->xpath("//d:response/d:propstat/d:prop/$findItem")[0]->__toString();
$value = str_replace('UUIDof:', '', $row['value']);
switch ($findItem) {
@@ -3233,7 +3278,7 @@ class SpacesContext implements Context {
$this->featureContext->setResponse(
HttpRequestHelper::get(
$this->featureContext->getBaseUrl() . '/archiver?' . $queryString,
'',
$this->featureContext->getStepLineRef(),
'',
'',
)
@@ -3324,7 +3369,7 @@ class SpacesContext implements Context {
$this->featureContext->setResponse(
HttpRequestHelper::get(
$url,
'',
$this->featureContext->getStepLineRef(),
$user,
$this->featureContext->getPasswordForUser($user),
)
@@ -126,7 +126,8 @@ class SpacesTUSContext implements Context {
TableNode $headers
): void {
$this->spacesContext->setSpaceIDByName($user, $spaceName);
$this->tusContext->createNewTUSResourceWithHeaders($user, $headers, $content);
$response = $this->tusContext->createNewTUSResourceWithHeaders($user, $headers, $content);
$this->featureContext->setResponse($response);
}
/**
@@ -30,6 +30,7 @@ use TusPhp\Exception\ConnectionException;
use TusPhp\Exception\TusException;
use TusPhp\Tus\Client;
use PHPUnit\Framework\Assert;
use Psr\Http\Message\ResponseInterface;
require_once 'bootstrap.php';
@@ -41,6 +42,40 @@ class TUSContext implements Context {
private ?string $resourceLocation = null;
/**
* @param string $user
* @param TableNode $headers
* @param string $content
*
* @return ResponseInterface
*
* @throws Exception
* @throws GuzzleException
*/
public function createNewTUSResourceWithHeaders(string $user, TableNode $headers, string $content = ''): ResponseInterface {
$this->featureContext->verifyTableNodeColumnsCount($headers, 2);
$user = $this->featureContext->getActualUsername($user);
$password = $this->featureContext->getUserPassword($user);
$this->resourceLocation = null;
$response = $this->featureContext->makeDavRequest(
$user,
"POST",
null,
$headers->getRowsHash(),
$content,
"files",
null,
false,
$password
);
$locationHeader = $response->getHeader('Location');
if (\sizeof($locationHeader) > 0) {
$this->resourceLocation = $locationHeader[0];
}
return $response;
}
/**
* @When user :user creates a new TUS resource on the WebDAV API with these headers:
*
@@ -53,29 +88,9 @@ class TUSContext implements Context {
* @throws Exception
* @throws GuzzleException
*/
public function createNewTUSResourceWithHeaders(string $user, TableNode $headers, string $content = ''): void {
$this->featureContext->verifyTableNodeColumnsCount($headers, 2);
$user = $this->featureContext->getActualUsername($user);
$password = $this->featureContext->getUserPassword($user);
$this->resourceLocation = null;
$this->featureContext->setResponse(
$this->featureContext->makeDavRequest(
$user,
"POST",
null,
$headers->getRowsHash(),
$content,
"files",
null,
false,
$password
)
);
$locationHeader = $this->featureContext->getResponse()->getHeader('Location');
if (\sizeof($locationHeader) > 0) {
$this->resourceLocation = $locationHeader[0];
}
public function userCreateNewTUSResourceWithHeaders(string $user, TableNode $headers, string $content = ''): void {
$response = $this->createNewTUSResourceWithHeaders($user, $headers, $content);
$this->featureContext->setResponse($response);
}
/**
@@ -89,46 +104,58 @@ class TUSContext implements Context {
* @throws Exception
* @throws GuzzleException
*/
public function createNewTUSResource(string $user, TableNode $headers): void {
public function userHasCreatedNewTUSResourceWithHeaders(string $user, TableNode $headers): void {
$rows = $headers->getRows();
$rows[] = ['Tus-Resumable', '1.0.0'];
$this->createNewTUSResourceWithHeaders($user, new TableNode($rows));
$this->featureContext->theHTTPStatusCodeShouldBe(201);
$response = $this->createNewTUSResourceWithHeaders($user, new TableNode($rows));
$this->featureContext->theHTTPStatusCodeShouldBe(201, "", $response);
}
/**
* @When /^user "([^"]*)" sends a chunk to the last created TUS Location with offset "([^"]*)" and data "([^"]*)" using the WebDAV API$/
*
* @param string $user
* @param string $offset
* @param string $data
* @param string $checksum
*
* @return ResponseInterface
*
* @throws GuzzleException
* @throws JsonException
*/
public function sendsAChunkToTUSLocationWithOffsetAndData(string $user, string $offset, string $data, string $checksum = ''): ResponseInterface {
$user = $this->featureContext->getActualUsername($user);
$password = $this->featureContext->getUserPassword($user);
return HttpRequestHelper::sendRequest(
$this->resourceLocation,
$this->featureContext->getStepLineRef(),
'PATCH',
$user,
$password,
[
'Content-Type' => 'application/offset+octet-stream',
'Tus-Resumable' => '1.0.0',
'Upload-Checksum' => $checksum,
'Upload-Offset' => $offset
],
$data
);
}
/**
* @When user :user sends a chunk to the last created TUS Location with offset :offset and data :data using the WebDAV API
*
* @param string $user
* @param string $offset
* @param string $data
*
* @return void
*
* @throws GuzzleException
* @throws JsonException
*/
public function sendsAChunkToTUSLocationWithOffsetAndData(string $user, string $offset, string $data, string $checksum = ''): void {
$user = $this->featureContext->getActualUsername($user);
$password = $this->featureContext->getUserPassword($user);
$this->featureContext->setResponse(
HttpRequestHelper::sendRequest(
$this->resourceLocation,
$this->featureContext->getStepLineRef(),
'PATCH',
$user,
$password,
[
'Content-Type' => 'application/offset+octet-stream',
'Tus-Resumable' => '1.0.0',
'Upload-Checksum' => $checksum,
'Upload-Offset' => $offset
],
$data
)
);
WebDavHelper::$SPACE_ID_FROM_OCIS = '';
public function userSendsAChunkToTUSLocationWithOffsetAndData(string $user, string $offset, string $data): void {
$response = $this->sendsAChunkToTUSLocationWithOffsetAndData($user, $offset, $data);
$this->featureContext->setResponse($response);
}
/**
@@ -359,7 +386,8 @@ class TUSContext implements Context {
string $content,
TableNode $headers
): void {
$this->createNewTUSResourceWithHeaders($user, $headers, $content);
$response = $this->createNewTUSResourceWithHeaders($user, $headers, $content);
$this->featureContext->setResponse($response);
}
/**
@@ -407,7 +435,8 @@ class TUSContext implements Context {
string $offset,
string $content
): void {
$this->sendsAChunkToTUSLocationWithOffsetAndData($user, $offset, $content, $checksum);
$response = $this->sendsAChunkToTUSLocationWithOffsetAndData($user, $offset, $content, $checksum);
$this->featureContext->setResponse($response);
}
/**
@@ -427,8 +456,8 @@ class TUSContext implements Context {
string $offset,
string $content
): void {
$this->sendsAChunkToTUSLocationWithOffsetAndData($user, $offset, $content, $checksum);
$this->featureContext->theHTTPStatusCodeShouldBe(204);
$response = $this->sendsAChunkToTUSLocationWithOffsetAndData($user, $offset, $content, $checksum);
$this->featureContext->theHTTPStatusCodeShouldBe(204, "", $response);
}
/**
@@ -443,7 +472,8 @@ class TUSContext implements Context {
* @throws Exception
*/
public function userUploadsChunkFileWithChecksum(string $user, string $offset, string $data, string $checksum): void {
$this->sendsAChunkToTUSLocationWithOffsetAndData($user, $offset, $data, $checksum);
$response = $this->sendsAChunkToTUSLocationWithOffsetAndData($user, $offset, $data, $checksum);
$this->featureContext->setResponse($response);
}
/**
@@ -458,8 +488,8 @@ class TUSContext implements Context {
* @throws Exception
*/
public function userHasUploadedChunkFileWithChecksum(string $user, string $offset, string $data, string $checksum): void {
$this->sendsAChunkToTUSLocationWithOffsetAndData($user, $offset, $data, $checksum);
$this->featureContext->theHTTPStatusCodeShouldBe(204);
$response = $this->sendsAChunkToTUSLocationWithOffsetAndData($user, $offset, $data, $checksum);
$this->featureContext->theHTTPStatusCodeShouldBe(204, "", $response);
}
/**
@@ -478,7 +508,8 @@ class TUSContext implements Context {
* @throws Exception
*/
public function userOverwritesFileWithChecksum(string $user, string $offset, string $data, string $checksum, TableNode $headers): void {
$this->createNewTUSResource($user, $headers);
$this->userHasUploadedChunkFileWithChecksum($user, $offset, $data, $checksum);
$this->userHasCreatedNewTUSResourceWithHeaders($user, $headers);
$response = $this->sendsAChunkToTUSLocationWithOffsetAndData($user, $offset, $data, $checksum);
$this->featureContext->setResponse($response);
}
}
@@ -24,6 +24,7 @@ use Behat\Behat\Hook\Scope\BeforeScenarioScope;
use Behat\Gherkin\Node\TableNode;
use PHPUnit\Framework\Assert;
use TestHelpers\GraphHelper;
use \Psr\Http\Message\ResponseInterface;
require_once 'bootstrap.php';
@@ -53,7 +54,38 @@ class TagContext implements Context {
}
/**
* @When /^user "([^"]*)" creates the following tags for (folder|file)\s?"([^"]*)" of space "([^"]*)":$/
* @param string $user
* @param string $fileOrFolder (file|folder)
* @param string $resource
* @param string $space
* @param TableNode $table
*
* @return ResponseInterface
* @throws Exception
*/
public function createTags(string $user, string $fileOrFolder, string $resource, string $space, TableNode $table):ResponseInterface {
$tagNameArray = [];
foreach ($table->getRows() as $value) {
$tagNameArray[] = $value[0];
}
if ($fileOrFolder === 'folder' || $fileOrFolder === 'folders') {
$resourceId = $this->spacesContext->getResourceId($user, $space, $resource);
} else {
$resourceId = $this->spacesContext->getFileId($user, $space, $resource);
}
return GraphHelper::createTags(
$this->featureContext->getBaseUrl(),
$this->featureContext->getStepLineRef(),
$user,
$this->featureContext->getPasswordForUser($user),
$resourceId,
$tagNameArray
);
}
/**
* @When /^user "([^"]*)" creates the following tags for (folder|file) "([^"]*)" of space "([^"]*)":$/
*
* @param string $user
* @param string $fileOrFolder (file|folder)
@@ -65,24 +97,7 @@ class TagContext implements Context {
* @throws Exception
*/
public function theUserCreatesFollowingTags(string $user, string $fileOrFolder, string $resource, string $space, TableNode $table):void {
$tagNameArray = [];
foreach ($table->getRows() as $value) {
$tagNameArray[] = $value[0];
}
if ($fileOrFolder === 'folder' || $fileOrFolder === 'folders') {
$resourceId = $this->spacesContext->getResourceId($user, $space, $resource);
} else {
$resourceId = $this->spacesContext->getFileId($user, $space, $resource);
}
$response = GraphHelper::createTags(
$this->featureContext->getBaseUrl(),
$this->featureContext->getStepLineRef(),
$user,
$this->featureContext->getPasswordForUser($user),
$resourceId,
$tagNameArray
);
$response = $this->createTags($user, $fileOrFolder, $resource, $space, $table);
$this->featureContext->setResponse($response);
}
@@ -99,8 +114,8 @@ class TagContext implements Context {
* @throws Exception
*/
public function theUserHasCreatedFollowingTags(string $user, string $fileOrFolder, string $resource, string $space, TableNode $table):void {
$this->theUserCreatesFollowingTags($user, $fileOrFolder, $resource, $space, $table);
$this->featureContext->theHttpStatusCodeShouldBe(200);
$response = $this->createTags($user, $fileOrFolder, $resource, $space, $table);
$this->featureContext->theHttpStatusCodeShouldBe(200, "", $response);
}
/**
@@ -139,7 +154,8 @@ class TagContext implements Context {
GraphHelper::getTags(
$this->featureContext->getBaseUrl(),
$user,
$this->featureContext->getPasswordForUser($user)
$this->featureContext->getPasswordForUser($user),
$this->featureContext->getStepLineRef()
)
);
}
@@ -174,18 +190,16 @@ class TagContext implements Context {
}
/**
* @When /^user "([^"]*)" removes the following tags for (folder|file)\s?"([^"]*)" of space "([^"]*)":$/
*
* @param string $user
* @param string $fileOrFolder (file|folder)
* @param string $resource
* @param string $space
* @param TableNode $table
*
* @return void
* @return ResponseInterface
* @throws Exception
*/
public function userRemovesTagsFromResourceOfTheSpace(string $user, string $fileOrFolder, string $resource, string $space, TableNode $table):void {
public function removeTagsFromResourceOfTheSpace(string $user, string $fileOrFolder, string $resource, string $space, TableNode $table):ResponseInterface {
$tagNameArray = [];
foreach ($table->getRows() as $value) {
$tagNameArray[] = $value[0];
@@ -197,7 +211,7 @@ class TagContext implements Context {
$resourceId = $this->spacesContext->getFileId($user, $space, $resource);
}
$response = GraphHelper::deleteTags(
return GraphHelper::deleteTags(
$this->featureContext->getBaseUrl(),
$this->featureContext->getStepLineRef(),
$user,
@@ -205,6 +219,22 @@ class TagContext implements Context {
$resourceId,
$tagNameArray
);
}
/**
* @When /^user "([^"]*)" removes the following tags for (folder|file) "([^"]*)" of space "([^"]*)":$/
*
* @param string $user
* @param string $fileOrFolder (file|folder)
* @param string $resource
* @param string $space
* @param TableNode $table
*
* @return void
* @throws Exception
*/
public function userRemovesTagsFromResourceOfTheSpace(string $user, string $fileOrFolder, string $resource, string $space, TableNode $table):void {
$response = $this->removeTagsFromResourceOfTheSpace($user, $fileOrFolder, $resource, $space, $table);
$this->featureContext->setResponse($response);
}
@@ -221,7 +251,7 @@ class TagContext implements Context {
* @throws Exception
*/
public function userHAsRemovedTheFollowingTagsForFileOfSpace(string $user, string $fileOrFolder, string $resource, string $space, TableNode $table):void {
$this->userRemovesTagsFromResourceOfTheSpace($user, $fileOrFolder, $resource, $space, $table);
$this->featureContext->theHttpStatusCodeShouldBe(200);
$response = $this->removeTagsFromResourceOfTheSpace($user, $fileOrFolder, $resource, $space, $table);
$this->featureContext->theHttpStatusCodeShouldBe(200, "", $response);
}
}
@@ -37,8 +37,6 @@ class TrashbinContext implements Context {
private FeatureContext $featureContext;
/**
* @When user :user empties the trashbin using the trashbin API
*
* @param string|null $user user
*
* @return ResponseInterface
@@ -46,7 +44,7 @@ class TrashbinContext implements Context {
public function emptyTrashbin(?string $user):ResponseInterface {
$user = $this->featureContext->getActualUsername($user);
$davPathVersion = $this->featureContext->getDavPathVersion();
$response = WebDavHelper::makeDavRequest(
return WebDavHelper::makeDavRequest(
$this->featureContext->getBaseUrl(),
$user,
$this->featureContext->getPasswordForUser($user),
@@ -58,11 +56,18 @@ class TrashbinContext implements Context {
$davPathVersion,
'trash-bin'
);
$this->featureContext->setResponse($response);
return $response;
}
/**
* @When user :user empties the trashbin using the trashbin API
*
* @param string $user user
*
* @return void
*/
public function userEmptiesTrashbin(string $user): void {
$this->featureContext->setResponse($this->emptyTrashbin($user));
}
/**
* @Given user :user has emptied the trashbin
*
@@ -72,12 +77,7 @@ class TrashbinContext implements Context {
*/
public function userHasEmptiedTrashbin(string $user):void {
$response = $this->emptyTrashbin($user);
Assert::assertEquals(
204,
$response->getStatusCode(),
__METHOD__ . " Expected status code was '204' but got '" . $response->getStatusCode() . "'"
);
$this->featureContext->theHTTPStatusCodeShouldBe(204, '', $response);
}
/**
@@ -547,7 +547,8 @@ class TrashbinContext implements Context {
public function userTriesToRestoreFromTrashbinOfUser(?string $asUser, ?string $path, ?string $user):void {
$user = $this->featureContext->getActualUsername($user);
$asUser = $this->featureContext->getActualUsername($asUser);
$this->restoreElement($user, $path, null, true, $asUser);
$response = $this->restoreElement($user, $path, null, true, $asUser);
$this->featureContext->setResponse($response);
}
/**
@@ -565,7 +566,8 @@ class TrashbinContext implements Context {
public function userTriesToRestoreFromTrashbinOfUserUsingPassword(?string $asUser, ?string $path, ?string $user, ?string $password):void {
$asUser = $this->featureContext->getActualUsername($asUser);
$user = $this->featureContext->getActualUsername($user);
$this->restoreElement($user, $path, null, true, $asUser, $password);
$response = $this->restoreElement($user, $path, null, true, $asUser, $password);
$this->featureContext->setResponse($response);
}
/**
@@ -752,18 +754,18 @@ class TrashbinContext implements Context {
* @param string|null $asUser - To send request as another user
* @param string|null $password
*
* @return void
* @return ResponseInterface
* @throws JsonException
* @throws GuzzleException
*/
private function sendUndeleteRequest(string $user, string $trashItemHRef, string $destinationPath, ?string $asUser = null, ?string $password = null):void {
private function sendUndeleteRequest(string $user, string $trashItemHRef, string $destinationPath, ?string $asUser = null, ?string $password = null):ResponseInterface {
$asUser = $asUser ?? $user;
$destinationPath = \trim($destinationPath, '/');
$destinationValue = $this->featureContext->getBaseUrl() . "/remote.php/dav/files/$user/$destinationPath";
$trashItemHRef = $this->convertTrashbinHref($trashItemHRef);
$headers['Destination'] = $destinationValue;
$response = $this->featureContext->makeDavRequest(
return $this->featureContext->makeDavRequest(
$asUser,
'MOVE',
$trashItemHRef,
@@ -776,7 +778,6 @@ class TrashbinContext implements Context {
[],
$user
);
$this->featureContext->setResponse($response);
}
/**
@@ -787,11 +788,11 @@ class TrashbinContext implements Context {
* @param string|null $asUser - To send request as another user
* @param string|null $password
*
* @return void
* @return ResponseInterface
* @throws JsonException
* @throws GuzzleException
*/
private function restoreElement(string $user, string $originalPath, ?string $destinationPath = null, bool $throwExceptionIfNotFound = true, ?string $asUser = null, ?string $password = null):void {
private function restoreElement(string $user, string $originalPath, ?string $destinationPath = null, bool $throwExceptionIfNotFound = true, ?string $asUser = null, ?string $password = null):ResponseInterface {
$asUser = $asUser ?? $user;
$listing = $this->listTrashbinFolder($user);
$originalPath = \trim($originalPath, '/');
@@ -800,14 +801,13 @@ class TrashbinContext implements Context {
}
foreach ($listing as $entry) {
if ($entry['original-location'] === $originalPath) {
$this->sendUndeleteRequest(
return $this->sendUndeleteRequest(
$user,
$entry['href'],
$destinationPath,
$asUser,
$password
);
return;
}
}
// The requested element to restore was not even in the trashbin.
@@ -907,7 +907,8 @@ class TrashbinContext implements Context {
* @throws Exception
*/
public function userTriesToRestoreElementInTrash(string $user, string $originalPath):void {
$this->restoreElement($user, $originalPath, null, false);
$response = $this->restoreElement($user, $originalPath, null, false);
$this->featureContext->setResponse($response);
}
/**
@@ -922,7 +923,7 @@ class TrashbinContext implements Context {
*/
public function elementInTrashIsRestored(?string $user, string $originalPath):void {
$user = $this->featureContext->getActualUsername($user);
$this->restoreElement($user, $originalPath);
$this->featureContext->setResponse($this->restoreElement($user, $originalPath));
}
/**
@@ -955,7 +956,8 @@ class TrashbinContext implements Context {
* @throws Exception
*/
public function elementInTrashHasBeenRestored(string $user, string $originalPath):void {
$this->restoreElement($user, $originalPath);
$response = $this->restoreElement($user, $originalPath);
$this->featureContext->theHTTPStatusCodeShouldBe(201, "", $response);
if ($this->isInTrash($user, $originalPath)) {
throw new Exception("File previously located at $originalPath is still in the trashbin");
}
@@ -978,7 +980,7 @@ class TrashbinContext implements Context {
?string $destinationPath
):void {
$user = $this->featureContext->getActualUsername($user);
$this->restoreElement($user, $originalPath, $destinationPath);
$this->featureContext->setResponse($this->restoreElement($user, $originalPath, $destinationPath));
}
/**
+79 -19
View File
@@ -74,7 +74,7 @@ trait WebDav {
/**
* response content parsed into a SimpleXMLElement
*/
private ?SimpleXMLElement $responseXmlObject;
private ?SimpleXMLElement $responseXmlObject = null;
private int $httpRequestTimeout = 0;
@@ -455,9 +455,9 @@ trait WebDav {
* @param string|null $width
* @param string|null $height
*
* @return void
* @return ResponseInterface
*/
public function downloadPreviews(string $user, ?string $path, ?string $doDavRequestAsUser, ?string $width, ?string $height):void {
public function downloadPreviews(string $user, ?string $path, ?string $doDavRequestAsUser, ?string $width, ?string $height):ResponseInterface {
$user = $this->getActualUsername($user);
$doDavRequestAsUser = $this->getActualUsername($doDavRequestAsUser);
$urlParameter = [
@@ -466,7 +466,7 @@ trait WebDav {
'forceIcon' => '0',
'preview' => '1'
];
$this->response = $this->makeDavRequest(
return $this->makeDavRequest(
$user,
"GET",
$path,
@@ -1053,14 +1053,17 @@ trait WebDav {
/**
* @param string $expectedContent
* @param string $extraErrorText
* @param ResponseInterface|null $response
*
* @return void
*/
public function checkDownloadedContentMatches(
string $expectedContent,
string $extraErrorText = ""
string $extraErrorText = "",
?ResponseInterface $response = null
):void {
$actualContent = (string) $this->response->getBody();
$response = $response ?? $this->response;
$actualContent = (string) $response->getBody();
// For this test we really care about the content.
// A separate "Then" step can specifically check the HTTP status.
// But if the content is wrong (e.g. empty) then it is useful to
@@ -2390,8 +2393,6 @@ trait WebDav {
false,
'new'
);
$this->pushToLastStatusCodesArrays();
}
/**
@@ -4630,6 +4631,7 @@ trait WebDav {
/**
* @When user :user downloads the preview of :path with width :width and height :height using the WebDAV API
* @When user :user tries to download the preview of nonexistent file :path with width :width and height :height using the WebDAV API
*
* @param string $user
* @param string $path
@@ -4639,13 +4641,14 @@ trait WebDav {
* @return void
*/
public function downloadPreviewOfFiles(string $user, string $path, string $width, string $height):void {
$this->downloadPreviews(
$response = $this->downloadPreviews(
$user,
$path,
null,
$width,
$height
);
$this->setResponse($response);
}
/**
@@ -4660,13 +4663,14 @@ trait WebDav {
* @return void
*/
public function downloadPreviewOfOtherUser(string $user1, string $path, string $doDavRequestAsUser, string $width, string $height):void {
$this->downloadPreviews(
$response = $this->downloadPreviews(
$user1,
$path,
$doDavRequestAsUser,
$width,
$height
);
$this->setResponse($response);
}
/**
@@ -4871,22 +4875,33 @@ trait WebDav {
$elementRows = $expectedFiles->getRows();
$should = ($shouldOrNot !== "not");
foreach ($elementRows as $expectedFile) {
$fileFound = $this->findEntryFromPropfindResponse(
$expectedFile[0],
$user,
$method,
"files",
$folderpath
);
$resource = $expectedFile[0];
if ($resource === '') {
continue;
}
if ($method === "REPORT") {
$fileFound = $this->findEntryFromSearchResponse(
$resource
);
} else {
$fileFound = $this->findEntryFromPropfindResponse(
$resource,
$user,
$method,
"files",
$folderpath
);
}
if ($should) {
Assert::assertNotEmpty(
$fileFound,
"response does not contain the entry '$expectedFile[0]'"
"response does not contain the entry '$resource'"
);
} else {
Assert::assertFalse(
$fileFound,
"response does contain the entry '$expectedFile[0]' but should not"
"response does contain the entry '$resource' but should not"
);
}
}
@@ -5334,6 +5349,51 @@ trait WebDav {
return false;
}
/**
* parses a REPORT response from $this->response into xml
* and returns found search results if found else returns false
*
* @param string|null $entryNameToSearch
*
* @return string|array|boolean
*
* string if $entryNameToSearch is given and is found
* array if $entryNameToSearch is not given
* boolean false if $entryNameToSearch is given and is not found
*
* @throws GuzzleException
*/
public function findEntryFromSearchResponse(
?string $entryNameToSearch = null
) {
// trim any leading "/" passed by the caller, we can just match the "raw" name
if ($entryNameToSearch !== null) {
$entryNameToSearch = \trim($entryNameToSearch, "/");
}
$spacesBaseUrl = webDavHelper::getDavPath(null, webDavHelper::DAV_VERSION_SPACES);
$searchResults = $this->getResponseXml()->xpath("//d:multistatus/d:response");
$results = [];
foreach ($searchResults as $item) {
$href = (string)$item->xpath("d:href")[0];
$shareRootXml = $item->xpath("d:propstat//oc:shareroot");
$href = \str_replace($spacesBaseUrl, "", $href);
$resourcePath = \substr($href, \strpos($href, '/') + 1);
if (\count($shareRootXml)) {
$shareroot = \trim((string)$shareRootXml[0], "/");
$resourcePath = $shareroot . "/" . $resourcePath;
}
$resourcePath = \rawurldecode($resourcePath);
if ($entryNameToSearch === $resourcePath) {
return $resourcePath;
}
$results[] = $resourcePath;
}
if ($entryNameToSearch === null) {
return $results;
}
return false;
}
/**
* Prevent creating two uploads and/or deletes with the same "stime"
* That is based on seconds in some implementations.
@@ -642,6 +642,7 @@ class WebDavLockingContext implements Context {
$password,
'GET',
"/apps/testing/api/v1/app/core/lock-breaker-groups",
$this->featureContext->getStepLineRef(),
(string) $ocsApiVersion
);
@@ -8,7 +8,7 @@ Feature: sharing works when a username and group name are the same
Scenario: creating a new share with user and a group having same name
Given these users have been created without skeleton files:
Given these users have been created with default attributes and without skeleton files:
| username |
| Brian |
| Carol |
@@ -30,7 +30,7 @@ Feature: sharing works when a username and group name are the same
Scenario: creating a new share with group and a user having same name
Given these users have been created without skeleton files:
Given these users have been created with default attributes and without skeleton files:
| username |
| Brian |
| Carol |
@@ -52,7 +52,7 @@ Feature: sharing works when a username and group name are the same
Scenario: creating a new share with user and a group having same name but different case
Given these users have been created without skeleton files:
Given these users have been created with default attributes and without skeleton files:
| username |
| Brian |
| Carol |
@@ -74,7 +74,7 @@ Feature: sharing works when a username and group name are the same
Scenario: creating a new share with group and a user having same name but different case
Given these users have been created without skeleton files:
Given these users have been created with default attributes and without skeleton files:
| username |
| Brian |
| Carol |
@@ -398,7 +398,7 @@ Feature: sharing
Scenario: share with user when username contains capital letters
Given these users have been created without skeleton files:
Given these users have been created with default attributes and without skeleton files:
| username |
| brian |
And user "Alice" has uploaded file with content "Random data" to "/randomfile.txt"
@@ -415,12 +415,12 @@ Feature: sharing
Then the OCS status code should be "100"
And the HTTP status code should be "200"
And user "brian" should see the following elements
| /Shares/randomfile.txt |
| /Shares/randomfile.txt |
And the content of file "Shares/randomfile.txt" for user "brian" should be "Random data"
Scenario: creating a new share with user of a group when username contains capital letters
Given these users have been created without skeleton files:
Given these users have been created with default attributes and without skeleton files:
| username |
| Brian |
And group "grp1" has been created
@@ -571,7 +571,7 @@ Feature: sharing
And user "Carol" has accepted share "/userOneFolder" offered by user "Brian"
When user "Carol" shares folder "/Shares/userOneFolder" with user "Brian" using the sharing API
Then the HTTP status code should be "200"
# Then the HTTP status code should be "405"
# Then the HTTP status code should be "405"
And the sharing API should report to user "Brian" that no shares are in the pending state
And as "Brian" folder "/Shares/userOneFolder" should not exist
@@ -589,7 +589,7 @@ Feature: sharing
And user "Carol" has accepted share "/userOneFolder" offered by user "Brian"
When user "Carol" shares folder "/Shares/userOneFolder" with user "Alice" using the sharing API
Then the HTTP status code should be "200"
# Then the HTTP status code should be "405"
# Then the HTTP status code should be "405"
And the sharing API should report to user "Alice" that no shares are in the pending state
And as "Alice" folder "/Shares/userOneFolder" should not exist
@@ -610,7 +610,7 @@ Feature: sharing
And user "David" has accepted share "/userOneFolder" offered by user "Brian"
When user "David" shares folder "/Shares/userOneFolder" with user "Carol" using the sharing API
Then the HTTP status code should be "200"
# Then the HTTP status code should be "405"
# Then the HTTP status code should be "405"
And the sharing API should report to user "Carol" that no shares are in the pending state
And as "Carol" folder "/Shares/userOneFolder" should not exist
@@ -624,17 +624,17 @@ Feature: sharing
Then the OCS status code should be "<ocs_status_code>"
And the HTTP status code should be "200"
And the fields of the last response to user "Alice" sharing with user "Brian" should include
| share_with | %username% |
| share_with_displayname | %displayname% |
| share_with | %username% |
| share_with_displayname | %displayname% |
| file_target | /Shares/renamed.txt |
| path | /renamed.txt |
| permissions | share,read,update |
| uid_owner | %username% |
| displayname_owner | %displayname% |
| item_type | file |
| mimetype | text/plain |
| storage_id | ANY_VALUE |
| share_type | user |
| permissions | share,read,update |
| uid_owner | %username% |
| displayname_owner | %displayname% |
| item_type | file |
| mimetype | text/plain |
| storage_id | ANY_VALUE |
| share_type | user |
When user "Brian" accepts share "/renamed.txt" offered by user "Alice" using the sharing API
Then the OCS status code should be "<ocs_status_code>"
And the HTTP status code should be "200"
@@ -413,3 +413,21 @@ Feature: create a public link share
| d:href |
Then the HTTP status code should be "207"
And the value of the item "//d:href" in the response should match "/%base_path%\/remote.php\/dav\/public-files\/%public_token%\/file.txt$/"
@issue-6929
Scenario Outline: create a password-protected public link on a file with the name same to the previously deleted one
Given using OCS API version "<ocs-api-version>"
And user "Alice" has uploaded file with content "test data 1" to "/test.txt"
And user "Alice" has created a public link share with settings
| path | test.txt |
| permissions | read |
And user "Alice" has deleted file "test.txt"
When user "Alice" updates the last public link share using the sharing API with
| password | testpassword |
Then the OCS status code should be "998"
And the HTTP status code should be "<http-code>"
And the OCS status message should be "update public share: resource not found"
Examples:
| ocs-api-version | http-code |
| 1 | 200 |
| 2 | 404 |
@@ -17,7 +17,7 @@ Feature: dav-versions
Scenario: upload file and no version is available using various chunking methods (except new chunking)
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 should be "200"
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
@@ -34,7 +34,7 @@ Feature: dav-versions
Scenario: upload a file twice and versions are available using various chunking methods (except new chunking)
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 responses on all endpoints should be "200"
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
@@ -9,80 +9,135 @@ Feature: previews of files downloaded through the webdav API
Scenario Outline: download previews with invalid width
Given user "Alice" has uploaded file "filesForUpload/lorem.txt" to "/parent.txt"
Given using <dav-path-version> DAV path
And user "Alice" has uploaded file "filesForUpload/lorem.txt" to "/parent.txt"
When user "Alice" downloads the preview of "/parent.txt" with width "<width>" and height "32" using the WebDAV API
Then the HTTP status code should be "400"
And the value of the item "/d:error/s:message" in the response about user "Alice" should be "Cannot set width of 0 or smaller!"
And the value of the item "/d:error/s:exception" in the response about user "Alice" should be "Sabre\DAV\Exception\BadRequest"
Examples:
| width |
| 0 |
| 0.5 |
| -1 |
| false |
| true |
| A |
| %2F |
| dav-path-version | width |
| old | 0 |
| old | 0.5 |
| old | -1 |
| old | false |
| old | true |
| old | A |
| old | %2F |
| new | 0 |
| new | 0.5 |
| new | -1 |
| new | false |
| new | true |
| new | A |
| new | %2F |
| spaces | 0 |
| spaces | 0.5 |
| spaces | -1 |
| spaces | false |
| spaces | true |
| spaces | A |
| spaces | %2F |
Scenario Outline: download previews with invalid height
Given user "Alice" has uploaded file "filesForUpload/lorem.txt" to "/parent.txt"
Given using <dav-path-version> DAV path
And user "Alice" has uploaded file "filesForUpload/lorem.txt" to "/parent.txt"
When user "Alice" downloads the preview of "/parent.txt" with width "32" and height "<height>" using the WebDAV API
Then the HTTP status code should be "400"
And the value of the item "/d:error/s:message" in the response about user "Alice" should be "Cannot set height of 0 or smaller!"
And the value of the item "/d:error/s:exception" in the response about user "Alice" should be "Sabre\DAV\Exception\BadRequest"
Examples:
| height |
| 0 |
| 0.5 |
| -1 |
| false |
| true |
| A |
| %2F |
| dav-path-version | height |
| old | 0 |
| old | 0.5 |
| old | -1 |
| old | false |
| old | true |
| old | A |
| old | %2F |
| new | 0 |
| new | 0.5 |
| new | -1 |
| new | false |
| new | true |
| new | A |
| new | %2F |
| spaces | 0 |
| spaces | 0.5 |
| spaces | -1 |
| spaces | false |
| spaces | true |
| spaces | A |
| spaces | %2F |
Scenario: download previews of files inside sub-folders
Given user "Alice" has created folder "subfolder"
And user "Alice" has uploaded file "filesForUpload/lorem.txt" to "/subfolder/parent.txt"
When user "Alice" downloads the preview of "/subfolder/parent.txt" with width "32" and height "32" using the WebDAV API
Scenario Outline: download previews of files inside sub-folders
Given using <dav-path-version> DAV path
And user "Alice" has created folder "subfolder"
And user "Alice" has uploaded file "filesForUpload/example.gif" to "subfolder/example.gif"
When user "Alice" downloads the preview of "subfolder/example.gif" with width "32" and height "32" using the WebDAV API
Then the HTTP status code should be "200"
And the downloaded image should be "32" pixels wide and "32" pixels high
Examples:
| dav-path-version |
| old |
| new |
| spaces |
Scenario Outline: download previews of file types that don't support preview
Given user "Alice" has uploaded file "filesForUpload/<filename>" to "/<newfilename>"
When user "Alice" downloads the preview of "/<newfilename>" with width "32" and height "32" using the WebDAV API
Given using <dav-path-version> DAV path
And user "Alice" has uploaded file "filesForUpload/<filename>" to "/<filename>"
When user "Alice" downloads the preview of "/<filename>" with width "32" and height "32" using the WebDAV API
Then the HTTP status code should be "404"
And the value of the item "/d:error/s:exception" in the response about user "Alice" should be "Sabre\DAV\Exception\NotFound"
Examples:
| filename | newfilename |
| simple.pdf | test.pdf |
| simple.odt | test.odt |
| new-data.zip | test.zip |
| dav-path-version | filename |
| old | simple.pdf |
| old | simple.odt |
| old | new-data.zip |
| new | simple.pdf |
| new | simple.odt |
| new | new-data.zip |
| spaces | simple.pdf |
| spaces | simple.odt |
| spaces | new-data.zip |
Scenario Outline: download previews of different image file types
Given user "Alice" has uploaded file "filesForUpload/<imageName>" to "/<newImageName>"
When user "Alice" downloads the preview of "/<newImageName>" with width "32" and height "32" using the WebDAV API
Given using <dav-path-version> DAV path
And user "Alice" has uploaded file "filesForUpload/<imageName>" to "/<imageName>"
When user "Alice" downloads the preview of "/<imageName>" with width "32" and height "32" using the WebDAV API
Then the HTTP status code should be "200"
And the downloaded image should be "32" pixels wide and "32" pixels high
Examples:
| imageName | newImageName |
| testavatar.jpg | testimage.jpg |
| testavatar.png | testimage.png |
| dav-path-version | imageName |
| old | testavatar.jpg |
| old | testavatar.png |
| new | testavatar.jpg |
| new | testavatar.png |
| spaces | testavatar.jpg |
| spaces | testavatar.png |
Scenario: download previews of image after renaming it
Given user "Alice" has uploaded file "filesForUpload/testavatar.jpg" to "/testimage.jpg"
Scenario Outline: download previews of image after renaming it
Given using <dav-path-version> DAV path
And user "Alice" has uploaded file "filesForUpload/testavatar.jpg" to "/testimage.jpg"
And user "Alice" has moved file "/testimage.jpg" to "/testimage.txt"
When user "Alice" downloads the preview of "/testimage.txt" with width "32" and height "32" using the WebDAV API
Then the HTTP status code should be "200"
And the downloaded image should be "32" pixels wide and "32" pixels high
Examples:
| dav-path-version |
| old |
| new |
| spaces |
Scenario Outline: download previews of shared files (to shares folder)
Given user "Brian" has been created with default attributes and without skeleton files
Given using <dav-path-version> DAV path
And user "Brian" has been created with default attributes and without skeleton files
And user "Alice" has uploaded file "filesForUpload/<resource>" to "/<resource>"
And user "Alice" has shared file "/<resource>" with user "Brian"
And user "Brian" has accepted share "/<resource>" offered by user "Alice"
@@ -90,45 +145,71 @@ Feature: previews of files downloaded through the webdav API
Then the HTTP status code should be "200"
And the downloaded image should be "32" pixels wide and "32" pixels high
Examples:
| resource |
| lorem.txt |
| example.gif |
| dav-path-version | resource |
| old | lorem.txt |
| old | example.gif |
| new | lorem.txt |
| new | example.gif |
Scenario: download previews of other users files
Given user "Brian" has been created with default attributes and without skeleton files
Scenario Outline: user tries to download previews of other users files
Given using <dav-path-version> DAV path
And user "Brian" has been created with default attributes and without skeleton files
And user "Alice" has uploaded file "filesForUpload/lorem.txt" to "/parent.txt"
When user "Brian" downloads the preview of "/parent.txt" of "Alice" with width "32" and height "32" using the WebDAV API
Then the HTTP status code should be "404"
And the value of the item "/d:error/s:message" in the response about user "Alice" should be "File not found: parent.txt in '%username%'"
And the value of the item "/d:error/s:message" in the response about user "Alice" should be "File with name parent.txt could not be located"
And the value of the item "/d:error/s:exception" in the response about user "Alice" should be "Sabre\DAV\Exception\NotFound"
Examples:
| dav-path-version |
| new |
| spaces |
Scenario: download previews of folders
Given user "Alice" has created folder "subfolder"
Scenario Outline: download previews of folders
Given using <dav-path-version> DAV path
And user "Alice" has created folder "subfolder"
When user "Alice" downloads the preview of "/subfolder/" with width "32" and height "32" using the WebDAV API
Then the HTTP status code should be "400"
And the value of the item "/d:error/s:message" in the response about user "Alice" should be "Unsupported file type"
And the value of the item "/d:error/s:exception" in the response about user "Alice" should be "Sabre\DAV\Exception\BadRequest"
Examples:
| dav-path-version |
| old |
| new |
| spaces |
Scenario: download previews of not-existing files
When user "Alice" downloads the preview of "/parent.txt" with width "32" and height "32" using the WebDAV API
Scenario Outline: user tries to download previews of nonexistent files
Given using <dav-path-version> DAV path
When user "Alice" tries to download the preview of nonexistent file "/parent.txt" with width "32" and height "32" using the WebDAV API
Then the HTTP status code should be "404"
And the value of the item "/d:error/s:message" in the response about user "Alice" should be "File with name parent.txt could not be located"
And the value of the item "/d:error/s:exception" in the response about user "Alice" should be "Sabre\DAV\Exception\NotFound"
Examples:
| dav-path-version |
| old |
| new |
| spaces |
Scenario: preview content changes with the change in file content
Given user "Alice" has uploaded file "filesForUpload/lorem.txt" to "/parent.txt"
Scenario Outline: preview content changes with the change in file content
Given using <dav-path-version> DAV path
And user "Alice" has uploaded file "filesForUpload/lorem.txt" to "/parent.txt"
And user "Alice" has downloaded the preview of "/parent.txt" with width "32" and height "32"
When user "Alice" uploads file with content "this is a file to upload" to "/parent.txt" using the WebDAV API
Then the HTTP status code should be "204"
And as user "Alice" the preview of "/parent.txt" with width "32" and height "32" should have been changed
Examples:
| dav-path-version |
| old |
| new |
| spaces |
@issue-2538
Scenario: when owner updates a shared file, previews for sharee are also updated (to shared folder)
Given user "Brian" has been created with default attributes and without skeleton files
Scenario Outline: when owner updates a shared file, previews for sharee are also updated (to shared folder)
Given using <dav-path-version> DAV path
And user "Brian" has been created with default attributes and without skeleton files
And user "Alice" has uploaded file "filesForUpload/lorem.txt" to "/parent.txt"
And user "Alice" has shared file "/parent.txt" with user "Brian"
And user "Brian" has accepted share "/parent.txt" offered by user "Alice"
@@ -136,19 +217,30 @@ Feature: previews of files downloaded through the webdav API
When user "Alice" uploads file with content "this is a file to upload" to "/parent.txt" using the WebDAV API
Then the HTTP status code should be "204"
And as user "Brian" the preview of "/Shares/parent.txt" with width "32" and height "32" should have been changed
Examples:
| dav-path-version |
| old |
| new |
Scenario: preview content should be updated if the file content is updated (content with UTF chars)
Given user "Alice" has uploaded file "filesForUpload/lorem.txt" to "/lorem.txt"
Scenario Outline: it should update the preview content if the file content is updated (content with UTF chars)
Given using <dav-path-version> DAV path
And user "Alice" has uploaded file "filesForUpload/lorem.txt" to "/lorem.txt"
And user "Alice" has uploaded file with content "ओनक्लाउड फाएल शेरिङ्ग एन्ड सिन्किङ" to "/lorem.txt"
When user "Alice" downloads the preview of "/lorem.txt" with width "32" and height "32" using the WebDAV API
Then the HTTP status code should be "200"
And the downloaded image should be "32" pixels wide and "32" pixels high
And the downloaded preview content should match with "unicode-fixture.png" fixtures preview content
Examples:
| dav-path-version |
| old |
| new |
| spaces |
Scenario: updates to a file should change the preview for both sharees and sharers
Given user "Brian" has been created with default attributes and without skeleton files
Scenario Outline: updates to a file should change the preview for both sharees and sharers
Given using <dav-path-version> DAV path
And user "Brian" has been created with default attributes and without skeleton files
And user "Alice" has created folder "FOLDER"
And user "Alice" has uploaded file with content "file to upload" to "/FOLDER/lorem.txt"
And user "Alice" has shared folder "FOLDER" with user "Brian"
@@ -163,10 +255,15 @@ Feature: previews of files downloaded through the webdav API
Then the HTTP status code should be "204"
And as user "Alice" the preview of "/FOLDER/lorem.txt" with width "32" and height "32" should have been changed
And as user "Brian" the preview of "Shares/FOLDER/lorem.txt" with width "32" and height "32" should have been changed
Examples:
| dav-path-version |
| old |
| new |
Scenario: updates to a group shared file should change the preview for both sharees and sharers
Given group "grp1" has been created
Scenario Outline: updates to a group shared file should change the preview for both sharees and sharers
Given using <dav-path-version> DAV path
And group "grp1" has been created
And user "Brian" has been created with default attributes and without skeleton files
And user "Carol" has been created with default attributes and without skeleton files
And user "Brian" has been added to group "grp1"
@@ -189,3 +286,7 @@ Feature: previews of files downloaded through the webdav API
And as user "Alice" the preview of "/FOLDER/lorem.txt" with width "32" and height "32" should have been changed
And as user "Brian" the preview of "Shares/FOLDER/lorem.txt" with width "32" and height "32" should have been changed
And as user "Carol" the preview of "Shares/FOLDER/lorem.txt" with width "32" and height "32" should have been changed
Examples:
| dav-path-version |
| old |
| new |
@@ -6,7 +6,7 @@ Feature: get quota
Background:
Given using OCS API version "1"
And user "Alice" has been created with default attributes and small skeleton files
And user "Alice" has been created with default attributes and without skeleton files
Scenario Outline: retrieving folder quota when no quota is set
@@ -35,7 +35,7 @@ Feature: get quota
Scenario Outline: retrieving folder quota of shared folder with quota when no quota is set for recipient
Given using <dav-path-version> DAV path
And user "Brian" has been created with default attributes and small skeleton files
And user "Brian" has been created with default attributes and without skeleton files
And user "Alice" has been given unlimited quota
And the quota of user "Brian" has been set to "10 MB"
And user "Brian" has created folder "/testquota"
@@ -74,7 +74,7 @@ Feature: get quota
Scenario Outline: retrieving folder quota when quota is set and a file was received
Given using <dav-path-version> DAV path
And user "Brian" has been created with default attributes and small skeleton files
And user "Brian" has been created with default attributes and without skeleton files
And the quota of user "Brian" has been set to "1 KB"
And user "Alice" has uploaded file "/Alice.txt" of size 93 bytes
And user "Alice" has shared file "Alice.txt" with user "Brian"
+17 -13
View File
@@ -41,20 +41,24 @@ func GetKeyValuesFromCtx(ctx context.Context) map[interface{}]interface{} {
}
func getKeyValue(ctx interface{}, m map[interface{}]interface{}) {
ctxVals := reflect.ValueOf(ctx).Elem()
ctxType := reflect.TypeOf(ctx).Elem()
// This is a dirty hack to run with go 1.21.x
reflectCtxValues := reflect.ValueOf(ctx)
if reflectCtxValues.Kind() != reflect.Struct {
ctxVals := reflectCtxValues.Elem()
ctxType := reflect.TypeOf(ctx).Elem()
if ctxType.Kind() == reflect.Struct {
for i := 0; i < ctxVals.NumField(); i++ {
currField, currIf := extractField(ctxVals, ctxType, i)
switch currField {
case "Context":
getKeyValue(currIf, m)
case "key":
nextField, nextIf := extractField(ctxVals, ctxType, i+1)
if nextField == "val" {
m[currIf] = nextIf
i++
if ctxType.Kind() == reflect.Struct {
for i := 0; i < ctxVals.NumField(); i++ {
currField, currIf := extractField(ctxVals, ctxType, i)
switch currField {
case "Context":
getKeyValue(currIf, m)
case "key":
nextField, nextIf := extractField(ctxVals, ctxType, i+1)
if nextField == "val" {
m[currIf] = nextIf
i++
}
}
}
}
+3 -1
View File
@@ -119,9 +119,11 @@ func Create(opts ...microstore.Option) microstore.Store {
// TODO nats needs a DefaultTTL option as it does not support per Write TTL ...
// FIXME nats has restrictions on the key, we cannot use slashes AFAICT
// host, port, clusterid
natsOptions := nats.GetDefaultOptions()
natsOptions.Name = "TODO" // we can pass in the service name to allow identifying the client, but that requires adding a custom context option
return natsjs.NewStore(
append(opts,
natsjs.NatsOptions(nats.Options{Name: "TODO"}),
natsjs.NatsOptions(natsOptions), // always pass in properly initialized default nats options
natsjs.DefaultTTL(ttl))...,
) // TODO test with ocis nats
case TypeMemory, "mem", "": // allow existing short form and use as default
+1 -1
View File
@@ -354,7 +354,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.16.0
# github.com/cs3org/reva/v2 v2.16.1
## explicit; go 1.20
github.com/cs3org/reva/v2/cmd/revad/internal/grace
github.com/cs3org/reva/v2/cmd/revad/runtime