webdav-related.feature 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260
  1. Feature: webdav-related
  2. Background:
  3. Given using api version "1"
  4. Scenario: moving a file old way
  5. Given using dav path "remote.php/webdav"
  6. And As an "admin"
  7. And user "user0" exists
  8. When User "user0" moves file "/textfile0.txt" to "/FOLDER/textfile0.txt"
  9. Then the HTTP status code should be "201"
  10. Scenario: download a file with range
  11. Given using dav path "remote.php/webdav"
  12. And As an "admin"
  13. When Downloading file "/welcome.txt" with range "bytes=51-77"
  14. Then Downloaded content should be "example file for developers"
  15. Scenario: Upload forbidden if quota is 0
  16. Given using dav path "remote.php/webdav"
  17. And As an "admin"
  18. And user "user0" exists
  19. And user "user0" has a quota of "0"
  20. When User "user0" uploads file "data/textfile.txt" to "/asdf.txt"
  21. Then the HTTP status code should be "507"
  22. Scenario: Retrieving folder quota when no quota is set
  23. Given using dav path "remote.php/webdav"
  24. And As an "admin"
  25. And user "user0" exists
  26. When user "user0" has unlimited quota
  27. Then as "user0" gets properties of folder "/" with
  28. |{DAV:}quota-available-bytes|
  29. And the single response should contain a property "{DAV:}quota-available-bytes" with value "-3"
  30. Scenario: Retrieving folder quota when quota is set
  31. Given using dav path "remote.php/webdav"
  32. And As an "admin"
  33. And user "user0" exists
  34. When user "user0" has a quota of "10 MB"
  35. Then as "user0" gets properties of folder "/" with
  36. |{DAV:}quota-available-bytes|
  37. And the single response should contain a property "{DAV:}quota-available-bytes" with value "10485429"
  38. Scenario: Retrieving folder quota of shared folder with quota when no quota is set for recipient
  39. Given using dav path "remote.php/webdav"
  40. And As an "admin"
  41. And user "user0" exists
  42. And user "user1" exists
  43. And user "user0" has unlimited quota
  44. And user "user1" has a quota of "10 MB"
  45. And As an "user1"
  46. And user "user1" created a folder "/testquota"
  47. And as "user1" creating a share with
  48. | path | testquota |
  49. | shareType | 0 |
  50. | permissions | 31 |
  51. | shareWith | user0 |
  52. Then as "user0" gets properties of folder "/testquota" with
  53. |{DAV:}quota-available-bytes|
  54. And the single response should contain a property "{DAV:}quota-available-bytes" with value "10485429"
  55. Scenario: download a public shared file with range
  56. Given user "user0" exists
  57. And As an "user0"
  58. When creating a share with
  59. | path | welcome.txt |
  60. | shareType | 3 |
  61. And Downloading last public shared file with range "bytes=51-77"
  62. Then Downloaded content should be "example file for developers"
  63. Scenario: download a public shared file inside a folder with range
  64. Given user "user0" exists
  65. And As an "user0"
  66. When creating a share with
  67. | path | PARENT |
  68. | shareType | 3 |
  69. And Downloading last public shared file inside a folder "/parent.txt" with range "bytes=1-7"
  70. Then Downloaded content should be "wnCloud"
  71. Scenario: Downloading a file on the old endpoint should serve security headers
  72. Given using dav path "remote.php/webdav"
  73. And As an "admin"
  74. When Downloading file "/welcome.txt"
  75. Then The following headers should be set
  76. |Content-Disposition|attachment; filename*=UTF-8''welcome.txt; filename="welcome.txt"|
  77. |Content-Security-Policy|default-src 'none';|
  78. |X-Content-Type-Options |nosniff|
  79. |X-Download-Options|noopen|
  80. |X-Frame-Options|Sameorigin|
  81. |X-Permitted-Cross-Domain-Policies|none|
  82. |X-Robots-Tag|none|
  83. |X-XSS-Protection|1; mode=block|
  84. And Downloaded content should start with "Welcome to your ownCloud account!"
  85. Scenario: Doing a GET with a web login should work without CSRF token on the old backend
  86. Given Logging in using web as "admin"
  87. When Sending a "GET" to "/remote.php/webdav/welcome.txt" without requesttoken
  88. Then Downloaded content should start with "Welcome to your ownCloud account!"
  89. Then the HTTP status code should be "200"
  90. Scenario: Doing a GET with a web login should work with CSRF token on the old backend
  91. Given Logging in using web as "admin"
  92. When Sending a "GET" to "/remote.php/webdav/welcome.txt" with requesttoken
  93. Then Downloaded content should start with "Welcome to your ownCloud account!"
  94. Then the HTTP status code should be "200"
  95. Scenario: Doing a PROPFIND with a web login should not work without CSRF token on the old backend
  96. Given Logging in using web as "admin"
  97. When Sending a "PROPFIND" to "/remote.php/webdav/welcome.txt" without requesttoken
  98. Then the HTTP status code should be "401"
  99. Scenario: Doing a PROPFIND with a web login should work with CSRF token on the old backend
  100. Given Logging in using web as "admin"
  101. When Sending a "PROPFIND" to "/remote.php/webdav/welcome.txt" with requesttoken
  102. Then the HTTP status code should be "207"
  103. Scenario: Upload chunked file asc
  104. Given user "user0" exists
  105. And user "user0" uploads chunk file "1" of "3" with "AAAAA" to "/myChunkedFile.txt"
  106. And user "user0" uploads chunk file "2" of "3" with "BBBBB" to "/myChunkedFile.txt"
  107. And user "user0" uploads chunk file "3" of "3" with "CCCCC" to "/myChunkedFile.txt"
  108. When As an "user0"
  109. And Downloading file "/myChunkedFile.txt"
  110. Then Downloaded content should be "AAAAABBBBBCCCCC"
  111. Scenario: Upload chunked file desc
  112. Given user "user0" exists
  113. And user "user0" uploads chunk file "3" of "3" with "CCCCC" to "/myChunkedFile.txt"
  114. And user "user0" uploads chunk file "2" of "3" with "BBBBB" to "/myChunkedFile.txt"
  115. And user "user0" uploads chunk file "1" of "3" with "AAAAA" to "/myChunkedFile.txt"
  116. When As an "user0"
  117. And Downloading file "/myChunkedFile.txt"
  118. Then Downloaded content should be "AAAAABBBBBCCCCC"
  119. Scenario: Upload chunked file random
  120. Given user "user0" exists
  121. And user "user0" uploads chunk file "2" of "3" with "BBBBB" to "/myChunkedFile.txt"
  122. And user "user0" uploads chunk file "3" of "3" with "CCCCC" to "/myChunkedFile.txt"
  123. And user "user0" uploads chunk file "1" of "3" with "AAAAA" to "/myChunkedFile.txt"
  124. When As an "user0"
  125. And Downloading file "/myChunkedFile.txt"
  126. Then Downloaded content should be "AAAAABBBBBCCCCC"
  127. Scenario: A file that is not shared does not have a share-types property
  128. Given user "user0" exists
  129. And user "user0" created a folder "/test"
  130. When as "user0" gets properties of folder "/test" with
  131. |{http://owncloud.org/ns}share-types|
  132. Then the response should contain an empty property "{http://owncloud.org/ns}share-types"
  133. Scenario: A file that is shared to a user has a share-types property
  134. Given user "user0" exists
  135. And user "user1" exists
  136. And user "user0" created a folder "/test"
  137. And as "user0" creating a share with
  138. | path | test |
  139. | shareType | 0 |
  140. | permissions | 31 |
  141. | shareWith | user1 |
  142. When as "user0" gets properties of folder "/test" with
  143. |{http://owncloud.org/ns}share-types|
  144. Then the response should contain a share-types property with
  145. | 0 |
  146. Scenario: A file that is shared to a group has a share-types property
  147. Given user "user0" exists
  148. And group "group1" exists
  149. And user "user0" created a folder "/test"
  150. And as "user0" creating a share with
  151. | path | test |
  152. | shareType | 1 |
  153. | permissions | 31 |
  154. | shareWith | group1 |
  155. When as "user0" gets properties of folder "/test" with
  156. |{http://owncloud.org/ns}share-types|
  157. Then the response should contain a share-types property with
  158. | 1 |
  159. Scenario: A file that is shared by link has a share-types property
  160. Given user "user0" exists
  161. And user "user0" created a folder "/test"
  162. And as "user0" creating a share with
  163. | path | test |
  164. | shareType | 3 |
  165. | permissions | 31 |
  166. When as "user0" gets properties of folder "/test" with
  167. |{http://owncloud.org/ns}share-types|
  168. Then the response should contain a share-types property with
  169. | 3 |
  170. Scenario: A file that is shared by user,group and link has a share-types property
  171. Given user "user0" exists
  172. And user "user1" exists
  173. And group "group2" exists
  174. And user "user0" created a folder "/test"
  175. And as "user0" creating a share with
  176. | path | test |
  177. | shareType | 0 |
  178. | permissions | 31 |
  179. | shareWith | user1 |
  180. And as "user0" creating a share with
  181. | path | test |
  182. | shareType | 1 |
  183. | permissions | 31 |
  184. | shareWith | group2 |
  185. And as "user0" creating a share with
  186. | path | test |
  187. | shareType | 3 |
  188. | permissions | 31 |
  189. When as "user0" gets properties of folder "/test" with
  190. |{http://owncloud.org/ns}share-types|
  191. Then the response should contain a share-types property with
  192. | 0 |
  193. | 1 |
  194. | 3 |
  195. Scenario: Upload chunked file asc with new chunking
  196. Given using dav path "remote.php/dav"
  197. And user "user0" exists
  198. And user "user0" creates a new chunking upload with id "chunking-42"
  199. And user "user0" uploads new chunk file "1" with "AAAAA" to id "chunking-42"
  200. And user "user0" uploads new chunk file "2" with "BBBBB" to id "chunking-42"
  201. And user "user0" uploads new chunk file "3" with "CCCCC" to id "chunking-42"
  202. And user "user0" moves new chunk file with id "chunking-42" to "/myChunkedFile.txt"
  203. When As an "user0"
  204. And Downloading file "/files/user0/myChunkedFile.txt"
  205. Then Downloaded content should be "AAAAABBBBBCCCCC"
  206. Scenario: Upload chunked file desc with new chunking
  207. Given using dav path "remote.php/dav"
  208. And user "user0" exists
  209. And user "user0" creates a new chunking upload with id "chunking-42"
  210. And user "user0" uploads new chunk file "3" with "CCCCC" to id "chunking-42"
  211. And user "user0" uploads new chunk file "2" with "BBBBB" to id "chunking-42"
  212. And user "user0" uploads new chunk file "1" with "AAAAA" to id "chunking-42"
  213. And user "user0" moves new chunk file with id "chunking-42" to "/myChunkedFile.txt"
  214. When As an "user0"
  215. And Downloading file "/files/user0/myChunkedFile.txt"
  216. Then Downloaded content should be "AAAAABBBBBCCCCC"
  217. Scenario: Upload chunked file random with new chunking
  218. Given using dav path "remote.php/dav"
  219. And user "user0" exists
  220. And user "user0" creates a new chunking upload with id "chunking-42"
  221. And user "user0" uploads new chunk file "2" with "BBBBB" to id "chunking-42"
  222. And user "user0" uploads new chunk file "3" with "CCCCC" to id "chunking-42"
  223. And user "user0" uploads new chunk file "1" with "AAAAA" to id "chunking-42"
  224. And user "user0" moves new chunk file with id "chunking-42" to "/myChunkedFile.txt"
  225. When As an "user0"
  226. And Downloading file "/files/user0/myChunkedFile.txt"
  227. Then Downloaded content should be "AAAAABBBBBCCCCC"
  228. Scenario: A disabled user cannot use webdav
  229. Given user "userToBeDisabled" exists
  230. And As an "admin"
  231. And assure user "userToBeDisabled" is disabled
  232. When Downloading file "/welcome.txt" as "userToBeDisabled"
  233. Then the HTTP status code should be "503"