2016-06-17 15:10:43 +03:00
|
|
|
Feature: dav-v2
|
|
|
|
Background:
|
|
|
|
Given using api version "1"
|
|
|
|
|
|
|
|
Scenario: moving a file new endpoint way
|
2016-09-27 14:09:55 +03:00
|
|
|
Given using new dav path
|
2016-06-17 15:10:43 +03:00
|
|
|
And As an "admin"
|
|
|
|
And user "user0" exists
|
2016-09-27 14:09:55 +03:00
|
|
|
When User "user0" moves file "/textfile0.txt" to "/FOLDER/textfile0.txt"
|
2016-06-17 15:10:43 +03:00
|
|
|
Then the HTTP status code should be "201"
|
|
|
|
|
|
|
|
Scenario: download a file with range using new endpoint
|
2016-09-27 14:09:55 +03:00
|
|
|
Given using new dav path
|
2016-06-17 15:10:43 +03:00
|
|
|
And As an "admin"
|
|
|
|
And user "user0" exists
|
|
|
|
And As an "user0"
|
2016-09-27 14:09:55 +03:00
|
|
|
When Downloading file "/welcome.txt" with range "bytes=52-78"
|
2016-06-17 15:10:43 +03:00
|
|
|
Then Downloaded content should be "example file for developers"
|
|
|
|
|
|
|
|
Scenario: Downloading a file on the new endpoint should serve security headers
|
2016-09-27 14:09:55 +03:00
|
|
|
Given using new dav path
|
2016-06-17 15:10:43 +03:00
|
|
|
And As an "admin"
|
2016-09-27 14:09:55 +03:00
|
|
|
When Downloading file "/welcome.txt"
|
2016-06-17 15:10:43 +03:00
|
|
|
Then The following headers should be set
|
|
|
|
|Content-Disposition|attachment; filename*=UTF-8''welcome.txt; filename="welcome.txt"|
|
|
|
|
|Content-Security-Policy|default-src 'none';|
|
|
|
|
|X-Content-Type-Options |nosniff|
|
|
|
|
|X-Download-Options|noopen|
|
2017-04-12 13:37:32 +03:00
|
|
|
|X-Frame-Options|SAMEORIGIN|
|
2016-06-17 15:10:43 +03:00
|
|
|
|X-Permitted-Cross-Domain-Policies|none|
|
|
|
|
|X-Robots-Tag|none|
|
|
|
|
|X-XSS-Protection|1; mode=block|
|
2016-07-28 21:50:23 +03:00
|
|
|
And Downloaded content should start with "Welcome to your Nextcloud account!"
|
2016-06-17 15:10:43 +03:00
|
|
|
|
|
|
|
Scenario: Doing a GET with a web login should work without CSRF token on the new backend
|
|
|
|
Given Logging in using web as "admin"
|
|
|
|
When Sending a "GET" to "/remote.php/dav/files/admin/welcome.txt" without requesttoken
|
2016-07-28 21:50:23 +03:00
|
|
|
Then Downloaded content should start with "Welcome to your Nextcloud account!"
|
2016-06-17 15:10:43 +03:00
|
|
|
Then the HTTP status code should be "200"
|
|
|
|
|
|
|
|
Scenario: Doing a GET with a web login should work with CSRF token on the new backend
|
|
|
|
Given Logging in using web as "admin"
|
|
|
|
When Sending a "GET" to "/remote.php/dav/files/admin/welcome.txt" with requesttoken
|
2016-07-28 21:50:23 +03:00
|
|
|
Then Downloaded content should start with "Welcome to your Nextcloud account!"
|
2016-06-17 15:10:43 +03:00
|
|
|
Then the HTTP status code should be "200"
|
|
|
|
|
|
|
|
Scenario: Doing a PROPFIND with a web login should not work without CSRF token on the new backend
|
|
|
|
Given Logging in using web as "admin"
|
|
|
|
When Sending a "PROPFIND" to "/remote.php/dav/files/admin/welcome.txt" without requesttoken
|
|
|
|
Then the HTTP status code should be "401"
|
|
|
|
|
|
|
|
Scenario: Doing a PROPFIND with a web login should work with CSRF token on the new backend
|
|
|
|
Given Logging in using web as "admin"
|
|
|
|
When Sending a "PROPFIND" to "/remote.php/dav/files/admin/welcome.txt" with requesttoken
|
|
|
|
Then the HTTP status code should be "207"
|
2016-07-29 07:40:39 +03:00
|
|
|
|
|
|
|
Scenario: Uploading a file having 0B as quota
|
2016-09-27 14:09:55 +03:00
|
|
|
Given using new dav path
|
2016-07-29 07:40:39 +03:00
|
|
|
And As an "admin"
|
|
|
|
And user "user0" exists
|
|
|
|
And user "user0" has a quota of "0 B"
|
|
|
|
And As an "user0"
|
2016-09-27 14:09:55 +03:00
|
|
|
When User "user0" uploads file "data/textfile.txt" to "/asdf.txt"
|
2016-07-29 07:40:39 +03:00
|
|
|
Then the HTTP status code should be "507"
|
|
|
|
|
|
|
|
Scenario: Uploading a file as recipient using webdav new endpoint having quota
|
2016-09-27 14:09:55 +03:00
|
|
|
Given using new dav path
|
2016-07-29 07:40:39 +03:00
|
|
|
And As an "admin"
|
|
|
|
And user "user0" exists
|
|
|
|
And user "user1" exists
|
|
|
|
And user "user0" has a quota of "10 MB"
|
|
|
|
And user "user1" has a quota of "10 MB"
|
|
|
|
And As an "user1"
|
|
|
|
And user "user1" created a folder "/testquota"
|
|
|
|
And as "user1" creating a share with
|
|
|
|
| path | testquota |
|
|
|
|
| shareType | 0 |
|
|
|
|
| permissions | 31 |
|
|
|
|
| shareWith | user0 |
|
2019-11-20 17:41:15 +03:00
|
|
|
And user "user0" accepts last share
|
2016-07-29 07:40:39 +03:00
|
|
|
And As an "user0"
|
2016-09-27 14:09:55 +03:00
|
|
|
When User "user0" uploads file "data/textfile.txt" to "/testquota/asdf.txt"
|
2016-07-29 07:40:39 +03:00
|
|
|
Then the HTTP status code should be "201"
|