-
Notifications
You must be signed in to change notification settings - Fork 164
/
updatePublicLinkShare.feature
498 lines (466 loc) · 25.4 KB
/
updatePublicLinkShare.feature
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
Feature: update a public link share
As a user
I want to update a public link
So that I change permissions whenever I want
Background:
Given using OCS API version "1"
And user "Alice" has been created with default attributes and without skeleton files
Scenario Outline: change expiration date of a public link share and get its info
Given using OCS API version "<ocs_api_version>"
And user "Alice" has created folder "FOLDER"
And user "Alice" has created a public link share with settings
| path | FOLDER |
| password | %public% |
When user "Alice" updates the last public link share using the sharing API with
| expireDate | 2040-01-01T23:59:59+0100 |
Then the OCS status code should be "<ocs_status_code>"
And the OCS status message should be "OK"
And the HTTP status code should be "200"
And the fields of the last response to user "Alice" should include
| id | A_STRING |
| share_type | public_link |
| uid_owner | %username% |
| displayname_owner | %displayname% |
| permissions | read |
| stime | A_NUMBER |
| parent | |
| expiration | A_STRING |
| token | A_STRING |
| uid_file_owner | %username% |
| displayname_file_owner | %displayname% |
| additional_info_owner | %emailaddress% |
| additional_info_file_owner | %emailaddress% |
| item_type | folder |
| item_source | A_STRING |
| path | /FOLDER |
| mimetype | httpd/unix-directory |
| storage_id | A_STRING |
| storage | A_NUMBER |
| file_source | A_STRING |
| file_target | /FOLDER |
| mail_send | 0 |
| name | |
Examples:
| ocs_api_version | ocs_status_code |
| 1 | 100 |
| 2 | 200 |
@smokeTest
Scenario Outline: change expiration date of a newly created public link share and get its info
Given using OCS API version "<ocs_api_version>"
And user "Alice" has created folder "FOLDER"
And user "Alice" has created a public link share with settings
| path | FOLDER |
| password | %public% |
And user "Alice" has updated the last public link share with
| expireDate | 2033-01-31T23:59:59+0100 |
When user "Alice" gets the info of the last public link share using the sharing API
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" should include
| id | A_STRING |
| item_type | folder |
| item_source | A_STRING |
| share_type | public_link |
| file_source | A_STRING |
| file_target | /FOLDER |
| permissions | read |
| stime | A_NUMBER |
| expiration | 2033-01-31 |
| token | A_TOKEN |
| storage | A_STRING |
| mail_send | 0 |
| uid_owner | %username% |
| displayname_owner | %displayname% |
| url | AN_URL |
| mimetype | httpd/unix-directory |
Examples:
| ocs_api_version | ocs_status_code |
| 1 | 100 |
| 2 | 200 |
Scenario Outline: creating a new public link share with password and adding an expiration date using public API
Given using OCS API version "<ocs_api_version>"
And user "Alice" has uploaded file with content "Random data" to "/randomfile.txt"
And user "Alice" has created a public link share with settings
| path | randomfile.txt |
| password | %public% |
When user "Alice" updates the last public link share using the sharing API with
| expireDate | 2040-01-01T23:59:59+0100 |
Then the OCS status code should be "<ocs_status_code>"
And the HTTP status code should be "200"
And the public should be able to download the last publicly shared file using the old public WebDAV API with password "%public%" and the content should be "Random data"
And the public should be able to download the last publicly shared file using the new public WebDAV API with password "%public%" and the content should be "Random data"
Examples:
| ocs_api_version | ocs_status_code |
| 1 | 100 |
| 2 | 200 |
Scenario Outline: creating a new public link share with password and removing (updating) it to make the resources accessible without password using public API
Given using OCS API version "<ocs_api_version>"
And user "Alice" has uploaded file with content "Random data" to "/randomfile.txt"
And user "Alice" has created a public link share with settings
| path | randomfile.txt |
| password | %public% |
When user "Alice" updates the last public link share using the sharing API with
#removing password is basically making password empty
| password | %remove% |
Then the OCS status code should be "<ocs_status_code>"
And the HTTP status code should be "200"
And the public should be able to download the last publicly shared file using the old public WebDAV API without a password and the content should be "Random data"
And the public should be able to download the last publicly shared file using the new public WebDAV API without a password and the content should be "Random data"
Examples:
| ocs_api_version | ocs_status_code |
| 1 | 100 |
| 2 | 200 |
Scenario Outline: creating a new public link share, updating its password and getting its info
Given using OCS API version "<ocs_api_version>"
And user "Alice" has created folder "FOLDER"
And user "Alice" has created a public link share with settings
| path | FOLDER |
| password | %public% |
And user "Alice" has updated the last public link share with
| password | %public% |
When user "Alice" gets the info of the last public link share using the sharing API
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" should include
| id | A_STRING |
| item_type | folder |
| item_source | A_STRING |
| share_type | public_link |
| file_source | A_STRING |
| file_target | /FOLDER |
| permissions | read |
| stime | A_NUMBER |
| token | A_TOKEN |
| storage | A_STRING |
| mail_send | 0 |
| uid_owner | %username% |
| displayname_owner | %displayname% |
| url | AN_URL |
| mimetype | httpd/unix-directory |
Examples:
| ocs_api_version | ocs_status_code |
| 1 | 100 |
| 2 | 200 |
Scenario Outline: creating a new public link share, updating its permissions and getting its info
Given using OCS API version "<ocs_api_version>"
And user "Alice" has created folder "FOLDER"
And user "Alice" has created a public link share with settings
| path | FOLDER |
| password | %public% |
And user "Alice" has updated the last public link share with
| permissions | read,update,create,delete |
When user "Alice" gets the info of the last public link share using the sharing API
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" should include
| id | A_STRING |
| item_type | folder |
| item_source | A_STRING |
| share_type | public_link |
| file_source | A_STRING |
| file_target | /FOLDER |
| permissions | read,update,create,delete |
| stime | A_NUMBER |
| token | A_TOKEN |
| storage | A_STRING |
| mail_send | 0 |
| uid_owner | %username% |
| displayname_owner | %displayname% |
| url | AN_URL |
| mimetype | httpd/unix-directory |
Examples:
| ocs_api_version | ocs_status_code |
| 1 | 100 |
| 2 | 200 |
Scenario Outline: creating a new public link share, updating its permissions to view download and upload and getting its info
Given using OCS API version "<ocs_api_version>"
And user "Alice" has created folder "FOLDER"
And user "Alice" has created a public link share with settings
| path | FOLDER |
| password | %public% |
And user "Alice" has updated the last public link share with
| permissions | read,update,create,delete |
When user "Alice" gets the info of the last public link share using the sharing API
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" should include
| id | A_STRING |
| item_type | folder |
| item_source | A_STRING |
| share_type | public_link |
| file_source | A_STRING |
| file_target | /FOLDER |
| permissions | read,update,create,delete |
| stime | A_NUMBER |
| token | A_TOKEN |
| storage | A_STRING |
| mail_send | 0 |
| uid_owner | %username% |
| displayname_owner | %displayname% |
| url | AN_URL |
| mimetype | httpd/unix-directory |
Examples:
| ocs_api_version | ocs_status_code |
| 1 | 100 |
| 2 | 200 |
Scenario Outline: creating a new public link share, updating publicUpload option and getting its info
Given using OCS API version "<ocs_api_version>"
And user "Alice" has created folder "FOLDER"
And user "Alice" has created a public link share with settings
| path | FOLDER |
| password | %public% |
And user "Alice" has updated the last public link share with
| publicUpload | true |
When user "Alice" gets the info of the last public link share using the sharing API
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" should include
| id | A_STRING |
| item_type | folder |
| item_source | A_STRING |
| share_type | public_link |
| file_source | A_STRING |
| file_target | /FOLDER |
| permissions | read,update,create,delete |
| stime | A_NUMBER |
| token | A_TOKEN |
| storage | A_STRING |
| mail_send | 0 |
| uid_owner | %username% |
| displayname_owner | %displayname% |
| url | AN_URL |
| mimetype | httpd/unix-directory |
Examples:
| ocs_api_version | ocs_status_code |
| 1 | 100 |
| 2 | 200 |
@skipOnReva
Scenario Outline: adding public upload to a read only shared folder as recipient is not allowed using the public API
Given using OCS API version "<ocs_api_version>"
And user "Brian" has been created with default attributes and without skeleton files
And user "Alice" has created folder "/test"
And user "Alice" has shared folder "/test" with user "Brian" with permissions "share,read"
And user "Brian" has created a public link share with settings
| path | /Shares/test |
| publicUpload | false |
| password | %public% |
When user "Brian" updates the last public link share using the sharing API with
| publicUpload | true |
Then the OCS status code should be "403"
And the HTTP status code should be "<http_status_code>"
And uploading a file should not work using the old public WebDAV API
And uploading a file should not work using the new public WebDAV API
Examples:
| ocs_api_version | http_status_code |
| 1 | 200 |
| 2 | 403 |
@skipOnReva
Scenario Outline:adding public upload to a shared folder as recipient is allowed with permissions using the public API
Given using OCS API version "<ocs_api_version>"
And user "Brian" has been created with default attributes and without skeleton files
And user "Alice" has created folder "/test"
And user "Alice" has shared folder "/test" with user "Brian" with permissions "all"
And user "Brian" has created a public link share with settings
| path | /Shares/test |
| publicUpload | false |
| password | %public% |
When user "Brian" updates the last public link share using the sharing API with
| publicUpload | true |
Then the OCS status code should be "<ocs_status_code>"
And the HTTP status code should be "200"
And uploading a file with password "%public%" should work using the old public WebDAV API
And uploading a file with password "%public%" should work using the new public WebDAV API
Examples:
| ocs_api_version | ocs_status_code |
| 1 | 100 |
| 2 | 200 |
@skipOnReva
Scenario Outline: adding public link with all permissions to a read only shared folder as recipient is not allowed using the public API
Given using OCS API version "<ocs_api_version>"
And user "Brian" has been created with default attributes and without skeleton files
And user "Alice" has created folder "/test"
And user "Alice" has shared folder "/test" with user "Brian" with permissions "share,read"
And user "Brian" has created a public link share with settings
| path | /Shares/test |
| permissions | read |
| password | %public% |
When user "Brian" updates the last public link share using the sharing API with
| permissions | read,update,create,delete |
Then the OCS status code should be "403"
And the HTTP status code should be "<http_status_code>"
And uploading a file should not work using the old public WebDAV API
And uploading a file should not work using the new public WebDAV API
Examples:
| ocs_api_version | http_status_code |
| 1 | 200 |
| 2 | 403 |
@skipOnReva
Scenario Outline: adding public link with all permissions to a read only shared folder as recipient is allowed with permissions using the public API
Given using OCS API version "<ocs_api_version>"
And user "Brian" has been created with default attributes and without skeleton files
And user "Alice" has created folder "/test"
And user "Alice" has shared folder "/test" with user "Brian" with permissions "all"
And user "Brian" has created a public link share with settings
| path | /Shares/test |
| permissions | read |
| password | %public% |
When user "Brian" updates the last public link share using the sharing API with
| permissions | read,update,create,delete |
Then the OCS status code should be "<ocs_status_code>"
And the HTTP status code should be "200"
And uploading a file with password "%public%" should work using the new public WebDAV API
Examples:
| ocs_api_version | ocs_status_code |
| 1 | 100 |
| 2 | 200 |
@issue-1269
Scenario Outline: updating share permissions from change to read restricts public from deleting files using the public API
Given using OCS API version "<ocs_api_version>"
And user "Alice" has created folder "PARENT"
And user "Alice" has created folder "PARENT/CHILD"
And user "Alice" has uploaded file "filesForUpload/textfile.txt" to "/PARENT/CHILD/child.txt"
And user "Alice" has created a public link share with settings
| path | /PARENT |
| permissions | read,update,create,delete |
| password | %public% |
And user "Alice" has updated the last public link share with
| permissions | read |
And the public deletes file "CHILD/child.txt" from the last public link share using the password "%public%" and new public WebDAV API
And the HTTP status code of responses on all endpoints should be "403"
And as "Alice" file "PARENT/CHILD/child.txt" should exist
Examples:
| ocs_api_version |
| 1 |
| 2 |
Scenario Outline: updating share permissions from read to change allows public to delete files using the public API
Given using OCS API version "<ocs_api_version>"
And user "Alice" has created folder "PARENT"
And user "Alice" has created folder "PARENT/CHILD"
And user "Alice" has uploaded file "filesForUpload/textfile.txt" to "/PARENT/parent.txt"
And user "Alice" has uploaded file "filesForUpload/textfile.txt" to "/PARENT/CHILD/child.txt"
And user "Alice" has created a public link share with settings
| path | /PARENT |
| permissions | read |
| password | %public% |
And user "Alice" has updated the last public link share with
| permissions | read,update,create,delete |
When the public deletes file "CHILD/child.txt" from the last public link share using the password "%public%" and new public WebDAV API
And the public deletes file "parent.txt" from the last public link share using the password "%public%" and new public WebDAV API
Then the HTTP status code of responses on all endpoints should be "204"
And as "Alice" file "PARENT/CHILD/child.txt" should not exist
And as "Alice" file "PARENT/parent.txt" should not exist
Examples:
| ocs_api_version |
| 1 |
| 2 |
Scenario Outline: rename a folder with public link and get its info
Given using OCS API version "<ocs_api_version>"
And using <dav-path-version> DAV path
And user "Alice" has created folder "FOLDER"
And user "Alice" has created a public link share with settings
| path | FOLDER |
| password | %public% |
And user "Alice" has moved folder "/FOLDER" to "/RENAMED_FOLDER"
When user "Alice" gets the info of the last public link share using the sharing API
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" should include
| id | A_STRING |
| share_type | public_link |
| uid_owner | %username% |
| displayname_owner | %displayname% |
| permissions | read |
| stime | A_NUMBER |
| parent | |
| expiration | |
| token | A_STRING |
| uid_file_owner | %username% |
| displayname_file_owner | %displayname% |
| item_type | folder |
| item_source | A_STRING |
| path | /RENAMED_FOLDER |
| mimetype | httpd/unix-directory |
| storage_id | A_STRING |
| storage | A_STRING |
| file_source | A_STRING |
| file_target | /RENAMED_FOLDER |
| mail_send | 0 |
| name | |
Examples:
| dav-path-version | ocs_api_version | ocs_status_code |
| old | 1 | 100 |
| old | 2 | 200 |
| new | 1 | 100 |
| new | 2 | 200 |
@skipOnRevaMaster
Examples:
| dav-path-version | ocs_api_version | ocs_status_code |
| spaces | 1 | 100 |
| spaces | 2 | 200 |
Scenario Outline: rename a file with public link and get its info
Given using OCS API version "<ocs_api_version>"
And using <dav-path-version> DAV path
And user "Alice" has uploaded file with content "some content" to "/lorem.txt"
And user "Alice" has created a public link share with settings
| path | lorem.txt |
| password | %public% |
And user "Alice" has moved file "/lorem.txt" to "/new-lorem.txt"
When user "Alice" gets the info of the last public link share using the sharing API
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" should include
| id | A_STRING |
| share_type | public_link |
| uid_owner | %username% |
| displayname_owner | %displayname% |
| permissions | read |
| stime | A_NUMBER |
| parent | |
| expiration | |
| token | A_STRING |
| uid_file_owner | %username% |
| displayname_file_owner | %displayname% |
| item_type | file |
| item_source | A_STRING |
| path | /new-lorem.txt |
| mimetype | text/plain |
| storage_id | A_STRING |
| storage | A_STRING |
| file_source | A_STRING |
| file_target | /new-lorem.txt |
| mail_send | 0 |
| name | |
Examples:
| dav-path-version | ocs_api_version | ocs_status_code |
| old | 1 | 100 |
| old | 2 | 200 |
| new | 1 | 100 |
| new | 2 | 200 |
@skipOnRevaMaster
Examples:
| dav-path-version | ocs_api_version | ocs_status_code |
| spaces | 1 | 100 |
| spaces | 2 | 200 |
Scenario Outline: update the role of a public link to internal
Given using OCS API version "<ocs_api_version>"
And using <dav-path-version> DAV path
And user "Alice" has uploaded file "filesForUpload/textfile.txt" to "/textfile.txt"
And user "Alice" has created a public link share with settings
| path | /textfile.txt |
| permissions | read |
| password | %public% |
When user "Alice" updates the last public link share using the sharing API with
| permissions | 0 |
Then the OCS status code should be "<ocs_status_code>"
And the HTTP status code should be "200"
Examples:
| dav-path-version | ocs_api_version | ocs_status_code |
| old | 1 | 100 |
| old | 2 | 200 |
| new | 1 | 100 |
| new | 2 | 200 |
@skipOnRevaMaster
Examples:
| dav-path-version | ocs_api_version | ocs_status_code |
| spaces | 1 | 100 |
| spaces | 2 | 200 |