Skip to content

Commit

Permalink
[full-ci] Do not share versions (#5531)
Browse files Browse the repository at this point in the history
* change test expectations

* bump reva  version

* add changelog

* fix test

* php style fix

* bump webCommit. fixt contarct tests

* change webBranch

* change webBranch

* new web commit

* fix flaky draw.io file

* fix after review

---------

Co-authored-by: Viktor Scharf <[email protected]>
  • Loading branch information
micbar and ScharfViktor authored Apr 6, 2023
1 parent 1a69583 commit f80cc17
Show file tree
Hide file tree
Showing 12 changed files with 71 additions and 165 deletions.
5 changes: 3 additions & 2 deletions .drone.env
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# The test runner source for UI tests
WEB_COMMITID=c7781078121ee07cc19b866713b0047a0e1c0eed
WEB_BRANCH=master

WEB_COMMITID=a36aec7f6af0a0e5d2319f5ab18429e53e9f702a
WEB_BRANCH=doNotShareVersionChangeE2eTest
5 changes: 5 additions & 0 deletions changelog/unreleased/do-not-share-versions.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Change: Do not share versions

We changed the default behavior of shares: Share receivers have no access to versions. People in spaces with the "Editor" or "Manager" role can still see versions and work with them.

https://github.com/owncloud/ocis/pull/5531
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ require (
github.com/blevesearch/bleve/v2 v2.3.7
github.com/coreos/go-oidc/v3 v3.4.0
github.com/cs3org/go-cs3apis v0.0.0-20221012090518-ef2996678965
github.com/cs3org/reva/v2 v2.12.1-0.20230403080425-f93a726ab656
github.com/cs3org/reva/v2 v2.12.1-0.20230404090709-bb973fae26ae
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
Expand Down
6 changes: 4 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -627,8 +627,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.12.1-0.20230403080425-f93a726ab656 h1:FAlxhUtG0/57X4i05x3suRd/rtAecM/7ZWeJ9ZtqrIc=
github.com/cs3org/reva/v2 v2.12.1-0.20230403080425-f93a726ab656/go.mod h1:FNAYs5H3xs8v0OFmNgZtiMAzIMXd/6TJmO0uZuNn8pQ=
github.com/cs3org/reva/v2 v2.12.1-0.20230404090709-bb973fae26ae h1:APfYubzIYqCTXtmX6cAm4c8wBYS3R/cZwomX8IlXLaI=
github.com/cs3org/reva/v2 v2.12.1-0.20230404090709-bb973fae26ae/go.mod h1:FNAYs5H3xs8v0OFmNgZtiMAzIMXd/6TJmO0uZuNn8pQ=
github.com/cubewise-code/go-mime v0.0.0-20200519001935-8c5762b177d8 h1:Z9lwXumT5ACSmJ7WGnFl+OMLLjpz5uR2fyz7dC255FI=
github.com/cubewise-code/go-mime v0.0.0-20200519001935-8c5762b177d8/go.mod h1:4abs/jPXcmJzYoYGF91JF9Uq9s/KL5n1jvFDix8KcqY=
github.com/cyberdelia/templates v0.0.0-20141128023046-ca7fffd4298c/go.mod h1:GyV+0YP4qX0UQ7r2MoYZ+AvYDp12OF5yg4q8rGnyNh4=
Expand Down Expand Up @@ -1268,6 +1268,8 @@ github.com/maxymania/go-system v0.0.0-20170110133659-647cc364bf0b h1:Q53idHrTuQD
github.com/maxymania/go-system v0.0.0-20170110133659-647cc364bf0b/go.mod h1:KirJrATYGbTyUwVR26xIkaipRqRcMRXBf8N5dacvGus=
github.com/mendsley/gojwk v0.0.0-20141217222730-4d5ec6e58103 h1:Z/i1e+gTZrmcGeZyWckaLfucYG6KYOXLWo4co8pZYNY=
github.com/mendsley/gojwk v0.0.0-20141217222730-4d5ec6e58103/go.mod h1:o9YPB5aGP8ob35Vy6+vyq3P3bWe7NQWzf+JLiXCiMaE=
github.com/micbar/reva/v2 v2.0.0-20230403215034-66e24325ae82 h1:ivuBEObF9BlpArq363tS2qB9w4YO+b+uO59GueepZhk=
github.com/micbar/reva/v2 v2.0.0-20230403215034-66e24325ae82/go.mod h1:FNAYs5H3xs8v0OFmNgZtiMAzIMXd/6TJmO0uZuNn8pQ=
github.com/miekg/dns v1.0.14/go.mod h1:W1PPwlIAgtquWBMBEV9nkV9Cazfe8ScdGz/Lj7v3Nrg=
github.com/miekg/dns v1.1.26/go.mod h1:bPDLeHnStXmXAq1m/Ch/hvfNHr14JKNPMBo3VZKjuso=
github.com/miekg/dns v1.1.40/go.mod h1:KNUDUusw/aVsxyTYZM1oqvCicbwhgbNgztCETuNZ7xM=
Expand Down
4 changes: 0 additions & 4 deletions tests/acceptance/expected-failures-API-on-OCIS-storage.md
Original file line number Diff line number Diff line change
Expand Up @@ -359,10 +359,6 @@ cannot share a folder with create permission
- [coreApiShareUpdateToShares/updateShare.feature:241](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/coreApiShareUpdateToShares/updateShare.feature#L241)
- [coreApiShareUpdateToShares/updateShare.feature:242](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/coreApiShareUpdateToShares/updateShare.feature#L242)

#### [user can access version metadata of a received share before accepting it](https://github.com/owncloud/ocis/issues/760)

- [coreApiVersions/fileVersions.feature:487](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/coreApiVersions/fileVersions.feature#L487)

#### [Share lists deleted user as 'user'](https://github.com/owncloud/ocis/issues/903)

- [coreApiShareManagementBasicToShares/createShareToSharesFolder.feature:676](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/coreApiShareManagementBasicToShares/createShareToSharesFolder.feature#L676)
Expand Down
4 changes: 2 additions & 2 deletions tests/acceptance/features/apiContract/sharesReport.feature
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ Feature: REPORT request to Shares space
| oc:shareroot | /folderMain |
| oc:name | SubFolder1 |
| d:getcontenttype | httpd/unix-directory |
| oc:permissions | SR |
| oc:permissions | S |
Examples:
| dav_version |
| old |
Expand All @@ -44,7 +44,7 @@ Feature: REPORT request to Shares space
| oc:shareroot | /folderMain |
| oc:name | frodo.txt |
| d:getcontenttype | text/plain |
| oc:permissions | SR |
| oc:permissions | S |
| d:getcontentlength | 34 |
Examples:
| dav_version |
Expand Down
4 changes: 2 additions & 2 deletions tests/acceptance/features/apiContract/spacesReport.feature
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ Feature: Report test
| oc:shareroot | /folderMain |
| oc:name | SubFolder1 |
| d:getcontenttype | httpd/unix-directory |
| oc:permissions | SR |
| oc:permissions | S |
| oc:size | 12 |


Expand All @@ -52,5 +52,5 @@ Feature: Report test
| oc:shareroot | /folderMain |
| oc:name | insideTheFolder.txt |
| d:getcontenttype | text/plain |
| oc:permissions | SRDNVW |
| oc:permissions | SD |
| d:getcontentlength | 12 |
12 changes: 9 additions & 3 deletions tests/acceptance/features/apiSpaces/download.feature
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ Feature: Download file in project space
| role | viewer |


Scenario Outline: An user downloads a file in the project space
Scenario Outline: A user downloads a file in the project space
When user "<user>" downloads the file "file.txt" of the space "download file" using the WebDAV API
Then the HTTP status code should be "200"
And the following headers should be set
Expand All @@ -36,7 +36,7 @@ Feature: Download file in project space
| Bob |


Scenario Outline: An user downloads an old version of the file in the project space
Scenario Outline: users with role manager and editor can download an old version of the file in the project space
Given user "Alice" has uploaded a file inside space "download file" with content "new content" to "file.txt"
And user "Alice" has uploaded a file inside space "download file" with content "newest content" to "file.txt"
When user "<user>" downloads version of the file "file.txt" with the index "1" of the space "download file" using the WebDAV API
Expand All @@ -53,4 +53,10 @@ Feature: Download file in project space
| user |
| Alice |
| Brian |
| Bob |


Scenario: A user viewer cannot get the old version of the file in the project space
Given user "Alice" has uploaded a file inside space "download file" with content "new content" to "file.txt"
When user "Bob" tries to get version of the file "file.txt" with the index "1" of the space "download file" using the WebDAV API
Then the HTTP status code should be "403"

47 changes: 0 additions & 47 deletions tests/acceptance/features/apiSpaces/restoreSpaceObjects.feature
Original file line number Diff line number Diff line change
Expand Up @@ -116,50 +116,3 @@ Feature: Restore files, folder
}
}
"""


Scenario: The recipient can restore a file even if there is not enough owner's quota to do so
Given user "Admin" has changed the quota of the "Brian Murphy" space to "30"
And user "Brian" has uploaded file with content "file is less than 30 bytes" to "/file.txt"
And user "Brian" has uploaded file with content "reduceContent" to "/file.txt"
And user "Brian" has uploaded file with content "some content" to "newFile.txt"
And user "Brian" has shared file "file.txt" with user "Alice"
And user "Alice" has accepted share "/file.txt" offered by user "Brian"
And using new DAV path
When user "Alice" restores version index "1" of file "/Shares/file.txt" using the WebDAV API
Then the HTTP status code should be "204"
And the content of file "/Shares/file.txt" for user "Alice" should be "file is less than 30 bytes"
And for user "Brian" the JSON response should contain space called "Brian Murphy" and match
"""
{
"type": "object",
"required": [
"quota"
],
"properties": {
"quota": {
"type": "object",
"required": [
"state",
"total",
"remaining",
"used"
],
"properties": {
"state" : {
"type": "string",
"enum": ["exceeded"]
},
"total" : {
"type": "number",
"enum": [30]
},
"used": {
"type": "number",
"enum": [38]
}
}
}
}
}
"""
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@ Feature:
When user "Alice" downloads version of the file "/textfile1.txt" with the index "2" of the space "Personal" using the WebDAV API
Then the HTTP status code should be "200"
And the downloaded content should be "old content version 1"
When user "Brian" downloads version of the file "/textfile1.txt" with the index "1" of the space "Shares" using the WebDAV API
When user "Alice" downloads version of the file "/textfile1.txt" with the index "1" of the space "Personal" using the WebDAV API
Then the HTTP status code should be "200"
And the downloaded content should be "old content version 2"
When user "Brian" tries to get version of the file "/textfile1.txt" with the index "1" of the space "Shares" using the WebDAV API
Then the HTTP status code should be "403"
16 changes: 16 additions & 0 deletions tests/acceptance/features/bootstrap/SpacesContext.php
Original file line number Diff line number Diff line change
Expand Up @@ -2739,6 +2739,22 @@ public function downloadVersionOfTheFile(
WebDavHelper::$SPACE_ID_FROM_OCIS = '';
}

/**
* @When /^user "([^"]*)" tries to get version of the file "([^"]*)" with the index "([^"]*)" of the space "([^"]*)" using the WebDAV API$/
*
* @param string $user
* @param string $file
* @param string $index
* @param string $spaceName
*
* @return void
* @throws Exception
*/
public function userTriesToDownloadFileVersions(string $user, string $file, string $index, string $spaceName):void {
$this->setSpaceIDByName($user, $spaceName);
$this->filesVersionsContext->userGetsFileVersions($user, $file);
}

/**
* return the etag for an element inside a space
*
Expand Down
Loading

0 comments on commit f80cc17

Please sign in to comment.