-
Notifications
You must be signed in to change notification settings - Fork 2.1k
/
reShareWithExpiryDate.feature
445 lines (429 loc) · 29 KB
/
reShareWithExpiryDate.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
@api @files_sharing-app-required @issue-ocis-1328 @skipOnOcV10.6 @skipOnOcV10.7 @skipOnOcV10.8.0
Feature: resharing a resource with an expiration date
Background:
Given the administrator has set the default folder for received shares to "Shares"
And auto-accept shares has been disabled
And these users have been created with default attributes and without skeleton files:
| username |
| Alice |
| Brian |
And user "Alice" has uploaded file "filesForUpload/textfile.txt" to "/textfile0.txt"
@skipOnOcV10.3
Scenario Outline: User should be able to set expiration while resharing a file with user
Given using OCS API version "<ocs_api_version>"
And user "Carol" has been created with default attributes and without skeleton files
And user "Alice" has shared file "/textfile0.txt" with user "Brian" with permissions "read,update,share"
And user "Brian" has accepted share "/textfile0.txt" offered by user "Alice"
When user "Brian" creates a share using the sharing API with settings
| path | /Shares/textfile0.txt |
| shareType | user |
| permissions | change |
| shareWith | Carol |
| expireDate | +3 days |
Then the HTTP status code should be "200"
And the OCS status code should be "<ocs_status_code>"
And user "Carol" should be able to accept pending share "/textfile0.txt" offered by user "Brian"
And the information of the last share of user "Brian" should include
| expiration | +3 days |
And the response when user "Carol" gets the info of the last share should include
| expiration | +3 days |
Examples:
| ocs_api_version | ocs_status_code |
| 1 | 100 |
| 2 | 200 |
@skipOnOcV10.3 @issue-ocis-reva-194
Scenario Outline: User should be able to set expiration while resharing a file with group
Given using OCS API version "<ocs_api_version>"
And user "Carol" has been created with default attributes and without skeleton files
And group "grp1" has been created
And user "Carol" has been added to group "grp1"
And user "Alice" has shared file "/textfile0.txt" with user "Brian" with permissions "read,update,share"
And user "Brian" has accepted share "/textfile0.txt" offered by user "Alice"
When user "Brian" creates a share using the sharing API with settings
| path | /Shares/textfile0.txt |
| shareType | group |
| permissions | change |
| shareWith | grp1 |
| expireDate | +3 days |
Then the HTTP status code should be "200"
And the OCS status code should be "<ocs_status_code>"
And user "Carol" should be able to accept pending share "/textfile0.txt" offered by user "Brian"
And the information of the last share of user "Brian" should include
| expiration | +3 days |
And the response when user "Carol" gets the info of the last share should include
| expiration | +3 days |
Examples:
| ocs_api_version | ocs_status_code |
| 1 | 100 |
| 2 | 200 |
@skipOnOcV10.3
Scenario Outline: resharing with user using the sharing API with expire days set and combinations of default/enforce expire date enabled
Given using OCS API version "<ocs_api_version>"
And parameter "shareapi_default_expire_date_user_share" of app "core" has been set to "<default-expire-date>"
And parameter "shareapi_enforce_expire_date_user_share" of app "core" has been set to "<enforce-expire-date>"
And parameter "shareapi_expire_after_n_days_user_share" of app "core" has been set to "30"
And user "Carol" has been created with default attributes and without skeleton files
And user "Alice" has shared file "/textfile0.txt" with user "Brian" with permissions "read,update,share"
And user "Brian" has accepted share "/textfile0.txt" offered by user "Alice"
When user "Brian" creates a share using the sharing API with settings
| path | /Shares/textfile0.txt |
| shareType | user |
| permissions | change |
| shareWith | Carol |
Then the HTTP status code should be "200"
And the OCS status code should be "<ocs_status_code>"
And user "Carol" should be able to accept pending share "/textfile0.txt" offered by user "Brian"
And the information of the last share of user "Brian" should include
| expiration | <expected-expire-date> |
And the response when user "Carol" gets the info of the last share should include
| expiration | <expected-expire-date> |
Examples:
| ocs_api_version | default-expire-date | enforce-expire-date | expected-expire-date | ocs_status_code |
| 1 | yes | yes | +30 days | 100 |
| 2 | yes | yes | +30 days | 200 |
| 1 | no | yes | | 100 |
| 2 | no | yes | | 200 |
@skipOnOcV10.3 @issue-ocis-reva-194
Scenario Outline: resharing with group using the sharing API with expire days set and combinations of default/enforce expire date enabled
Given using OCS API version "<ocs_api_version>"
And parameter "shareapi_default_expire_date_group_share" of app "core" has been set to "<default-expire-date>"
And parameter "shareapi_enforce_expire_date_group_share" of app "core" has been set to "<enforce-expire-date>"
And parameter "shareapi_expire_after_n_days_group_share" of app "core" has been set to "30"
And user "Carol" has been created with default attributes and without skeleton files
And group "grp1" has been created
And user "Carol" has been added to group "grp1"
And user "Alice" has shared file "/textfile0.txt" with user "Brian" with permissions "read,update,share"
And user "Brian" has accepted share "/textfile0.txt" offered by user "Alice"
When user "Brian" creates a share using the sharing API with settings
| path | /Shares/textfile0.txt |
| shareType | group |
| permissions | change |
| shareWith | grp1 |
Then the HTTP status code should be "200"
And the OCS status code should be "<ocs_status_code>"
And user "Carol" should be able to accept pending share "/textfile0.txt" offered by user "Brian"
And the information of the last share of user "Brian" should include
| expiration | <expected-expire-date> |
And the response when user "Carol" gets the info of the last share should include
| expiration | <expected-expire-date> |
Examples:
| ocs_api_version | default-expire-date | enforce-expire-date | expected-expire-date | ocs_status_code |
| 1 | yes | yes | +30 days | 100 |
| 2 | yes | yes | +30 days | 200 |
| 1 | no | yes | | 100 |
| 2 | no | yes | | 200 |
@skipOnOcV10.3
Scenario Outline: resharing with user using the sharing API without expire days set and with combinations of default/enforce expire date enabled
Given using OCS API version "<ocs_api_version>"
And parameter "shareapi_default_expire_date_user_share" of app "core" has been set to "<default-expire-date>"
And parameter "shareapi_enforce_expire_date_user_share" of app "core" has been set to "<enforce-expire-date>"
And user "Carol" has been created with default attributes and without skeleton files
And user "Alice" has shared file "/textfile0.txt" with user "Brian" with permissions "read,update,share"
And user "Brian" has accepted share "/textfile0.txt" offered by user "Alice"
When user "Brian" creates a share using the sharing API with settings
| path | /Shares/textfile0.txt |
| shareType | user |
| permissions | change |
| shareWith | Carol |
Then the HTTP status code should be "200"
And the OCS status code should be "<ocs_status_code>"
And user "Carol" should be able to accept pending share "/textfile0.txt" offered by user "Brian"
And the information of the last share of user "Brian" should include
| expiration | <expected-expire-date> |
And the response when user "Carol" gets the info of the last share should include
| expiration | <expected-expire-date> |
Examples:
| ocs_api_version | default-expire-date | enforce-expire-date | expected-expire-date | ocs_status_code |
| 1 | yes | yes | +7 days | 100 |
| 2 | yes | yes | +7 days | 200 |
| 1 | no | yes | | 100 |
| 2 | no | yes | | 200 |
@skipOnOcV10.3 @issue-ocis-reva-194
Scenario Outline: resharing with group using the sharing API without expire days set and with combinations of default/enforce expire date enabled
Given using OCS API version "<ocs_api_version>"
And parameter "shareapi_default_expire_date_group_share" of app "core" has been set to "<default-expire-date>"
And parameter "shareapi_enforce_expire_date_group_share" of app "core" has been set to "<enforce-expire-date>"
And user "Carol" has been created with default attributes and without skeleton files
And group "grp1" has been created
And user "Carol" has been added to group "grp1"
And user "Alice" has shared file "/textfile0.txt" with user "Brian" with permissions "read,update,share"
And user "Brian" has accepted share "/textfile0.txt" offered by user "Alice"
When user "Brian" creates a share using the sharing API with settings
| path | /Shares/textfile0.txt |
| shareType | group |
| permissions | change |
| shareWith | grp1 |
Then the HTTP status code should be "200"
And the OCS status code should be "<ocs_status_code>"
And user "Carol" should be able to accept pending share "/textfile0.txt" offered by user "Brian"
And the information of the last share of user "Brian" should include
| expiration | <expected-expire-date> |
And the response when user "Carol" gets the info of the last share should include
| expiration | <expected-expire-date> |
Examples:
| ocs_api_version | default-expire-date | enforce-expire-date | expected-expire-date | ocs_status_code |
| 1 | yes | yes | +7 days | 100 |
| 2 | yes | yes | +7 days | 200 |
| 1 | no | yes | | 100 |
| 2 | no | yes | | 200 |
@skipOnOcV10.3
Scenario Outline: resharing with user using the sharing API with expire days set and with combinations of default/enforce expire date enabled and specify expire date in share
Given using OCS API version "<ocs_api_version>"
And parameter "shareapi_default_expire_date_user_share" of app "core" has been set to "<default-expire-date>"
And parameter "shareapi_enforce_expire_date_user_share" of app "core" has been set to "<enforce-expire-date>"
And parameter "shareapi_expire_after_n_days_user_share" of app "core" has been set to "30"
And user "Carol" has been created with default attributes and without skeleton files
And user "Alice" has shared file "/textfile0.txt" with user "Brian" with permissions "read,update,share"
And user "Brian" has accepted share "/textfile0.txt" offered by user "Alice"
When user "Brian" creates a share using the sharing API with settings
| path | /Shares/textfile0.txt |
| shareType | user |
| permissions | change |
| shareWith | Carol |
| expireDate | +20 days |
Then the HTTP status code should be "200"
And the OCS status code should be "<ocs_status_code>"
And user "Carol" should be able to accept pending share "/textfile0.txt" offered by user "Brian"
And the information of the last share of user "Brian" should include
| expiration | +20 days |
And the response when user "Carol" gets the info of the last share should include
| expiration | +20 days |
Examples:
| ocs_api_version | default-expire-date | enforce-expire-date | ocs_status_code |
| 1 | yes | yes | 100 |
| 2 | yes | yes | 200 |
| 1 | no | yes | 100 |
| 2 | no | yes | 200 |
@skipOnOcV10.3 @issue-ocis-reva-194
Scenario Outline: resharing with group using the sharing API with expire days set and with combinations of default/enforce expire date enabled and specify expire date in share
Given using OCS API version "<ocs_api_version>"
And parameter "shareapi_default_expire_date_group_share" of app "core" has been set to "<default-expire-date>"
And parameter "shareapi_enforce_expire_date_group_share" of app "core" has been set to "<enforce-expire-date>"
And parameter "shareapi_expire_after_n_days_group_share" of app "core" has been set to "30"
And user "Carol" has been created with default attributes and without skeleton files
And group "grp1" has been created
And user "Carol" has been added to group "grp1"
And user "Alice" has shared file "/textfile0.txt" with user "Brian" with permissions "read,update,share"
And user "Brian" has accepted share "/textfile0.txt" offered by user "Alice"
When user "Brian" creates a share using the sharing API with settings
| path | /Shares/textfile0.txt |
| shareType | group |
| permissions | change |
| shareWith | grp1 |
| expireDate | +20 days |
Then the HTTP status code should be "200"
And the OCS status code should be "<ocs_status_code>"
And user "Carol" should be able to accept pending share "/textfile0.txt" offered by user "Brian"
And the information of the last share of user "Brian" should include
| expiration | +20 days |
And the response when user "Carol" gets the info of the last share should include
| expiration | +20 days |
Examples:
| ocs_api_version | default-expire-date | enforce-expire-date | ocs_status_code |
| 1 | yes | yes | 100 |
| 2 | yes | yes | 200 |
| 1 | no | yes | 100 |
| 2 | no | yes | 200 |
@skipOnOcV10.3
Scenario Outline: Setting default expiry date and enforcement after the share is created
Given using OCS API version "<ocs_api_version>"
And user "Carol" has been created with default attributes and without skeleton files
And user "Alice" has shared file "/textfile0.txt" with user "Brian" with permissions "read,update,share"
And user "Brian" has accepted share "/textfile0.txt" offered by user "Alice"
And user "Brian" has shared file "/Shares/textfile0.txt" with user "Carol"
And user "Carol" has accepted share "/textfile0.txt" offered by user "Brian"
And parameter "shareapi_default_expire_date_user_share" of app "core" has been set to "<default-expire-date>"
And parameter "shareapi_enforce_expire_date_user_share" of app "core" has been set to "<enforce-expire-date>"
And parameter "shareapi_expire_after_n_days_user_share" of app "core" has been set to "4"
When user "Brian" gets the info of the last share using the sharing API
Then the HTTP status code should be "200"
And the OCS status code should be "<ocs_status_code>"
And the information of the last share of user "Brian" should include
| expiration | |
And the response when user "Carol" gets the info of the last share should include
| expiration | |
Examples:
| ocs_api_version | default-expire-date | enforce-expire-date | ocs_status_code |
| 1 | yes | yes | 100 |
| 2 | yes | yes | 200 |
| 1 | no | yes | 100 |
| 2 | no | yes | 200 |
@skipOnOcV10.3 @issue-ocis-reva-194
Scenario Outline: resharing group share with user using the sharing API with default expire date set and with combinations of default/enforce expire date enabled
Given using OCS API version "<ocs_api_version>"
And parameter "shareapi_default_expire_date_user_share" of app "core" has been set to "<default-expire-date>"
And parameter "shareapi_enforce_expire_date_user_share" of app "core" has been set to "<enforce-expire-date>"
And parameter "shareapi_expire_after_n_days_user_share" of app "core" has been set to "30"
And group "grp1" has been created
And user "Carol" has been created with default attributes and without skeleton files
And user "Brian" has been added to group "grp1"
And user "Alice" has shared file "/textfile0.txt" with group "grp1" with permissions "read,update,share"
And user "Brian" has accepted share "/textfile0.txt" offered by user "Alice"
When user "Brian" creates a share using the sharing API with settings
| path | /Shares/textfile0.txt |
| shareType | user |
| permissions | change |
| shareWith | Carol |
Then the HTTP status code should be "200"
And the OCS status code should be "<ocs_status_code>"
And user "Carol" should be able to accept pending share "/textfile0.txt" offered by user "Brian"
And the information of the last share of user "Brian" should include
| expiration | <expected-expire-date> |
And the response when user "Carol" gets the info of the last share should include
| expiration | <expected-expire-date> |
Examples:
| ocs_api_version | default-expire-date | enforce-expire-date | expected-expire-date | ocs_status_code |
| 1 | yes | yes | +30 days | 100 |
| 2 | yes | yes | +30 days | 200 |
| 1 | no | yes | | 100 |
| 2 | no | yes | | 200 |
@skipOnOcV10.3 @issue-ocis-reva-194
Scenario Outline: resharing group share with user using the sharing API with default expire date set and specifying expiration on share and with combinations of default/enforce expire date enabled
Given using OCS API version "<ocs_api_version>"
And parameter "shareapi_default_expire_date_user_share" of app "core" has been set to "<default-expire-date>"
And parameter "shareapi_enforce_expire_date_user_share" of app "core" has been set to "<enforce-expire-date>"
And parameter "shareapi_expire_after_n_days_user_share" of app "core" has been set to "30"
And group "grp1" has been created
And user "Carol" has been created with default attributes and without skeleton files
And user "Brian" has been added to group "grp1"
And user "Alice" has shared file "/textfile0.txt" with group "grp1" with permissions "read,update,share"
And user "Brian" has accepted share "/textfile0.txt" offered by user "Alice"
When user "Brian" creates a share using the sharing API with settings
| path | /Shares/textfile0.txt |
| shareType | user |
| permissions | change |
| shareWith | Carol |
| expireDate | +20 days |
Then the HTTP status code should be "200"
And the OCS status code should be "<ocs_status_code>"
And user "Carol" should be able to accept pending share "/textfile0.txt" offered by user "Brian"
And the information of the last share of user "Brian" should include
| expiration | <expected-expire-date> |
And the response when user "Carol" gets the info of the last share should include
| expiration | <expected-expire-date> |
Examples:
| ocs_api_version | default-expire-date | enforce-expire-date | expected-expire-date | ocs_status_code |
| 1 | yes | yes | +20 days | 100 |
| 2 | yes | yes | +20 days | 200 |
| 1 | no | yes | +20 days | 100 |
| 2 | no | yes | +20 days | 200 |
@skipOnOcV10.3
Scenario Outline: resharing using the sharing API with default expire date set but not enforced
Given using OCS API version "<ocs_api_version>"
And parameter "shareapi_default_expire_date_user_share" of app "core" has been set to "<default-expire-date>"
And parameter "shareapi_enforce_expire_date_user_share" of app "core" has been set to "<enforce-expire-date>"
And parameter "shareapi_expire_after_n_days_user_share" of app "core" has been set to "30"
And user "Carol" has been created with default attributes and without skeleton files
And user "Alice" has shared file "/textfile0.txt" with user "Brian" with permissions "read,update,share"
And user "Brian" has accepted share "/textfile0.txt" offered by user "Alice"
When user "Brian" creates a share using the sharing API with settings
| path | /Shares/textfile0.txt |
| shareType | user |
| permissions | change |
| shareWith | Carol |
Then the HTTP status code should be "200"
And the OCS status code should be "<ocs_status_code>"
And user "Carol" should be able to accept pending share "/textfile0.txt" offered by user "Brian"
And the information of the last share of user "Brian" should include
| expiration | |
And the response when user "Carol" gets the info of the last share should include
| expiration | |
Examples:
| ocs_api_version | default-expire-date | enforce-expire-date | ocs_status_code |
| 1 | yes | no | 100 |
| 2 | yes | no | 200 |
| 1 | no | no | 100 |
| 2 | no | no | 200 |
@skipOnOcV10 @skipOnOcV10.3 @issue-37013
Scenario Outline: reshare extends the received expiry date up to the default by default
Given using OCS API version "<ocs_api_version>"
And parameter "shareapi_default_expire_date_user_share" of app "core" has been set to "<default-expire-date>"
And parameter "shareapi_enforce_expire_date_user_share" of app "core" has been set to "<enforce-expire-date>"
And parameter "shareapi_expire_after_n_days_user_share" of app "core" has been set to "30"
And user "Carol" has been created with default attributes and without skeleton files
And user "Alice" has created a share with settings
| path | textfile0.txt |
| shareType | user |
| permissions | all |
| shareWith | Brian |
| expireDate | +20 days |
And user "Brian" has accepted share "/textfile0.txt" offered by user "Alice"
When user "Brian" creates a share using the sharing API with settings
| path | /Shares/textfile0.txt |
| shareType | user |
| permissions | change |
| shareWith | Carol |
Then the HTTP status code should be "200"
And the OCS status code should be "<ocs_status_code>"
And user "Carol" should be able to accept pending share "/textfile0.txt" offered by user "Brian"
And the information of the last share of user "Alice" should include
| expiration | +20 days |
And the response when user "Carol" gets the info of the last share should include
| expiration | +20 |
Examples:
| ocs_api_version | default-expire-date | enforce-expire-date | ocs_status_code |
| 1 | yes | yes | 100 |
| 2 | yes | yes | 200 |
| 1 | yes | no | 100 |
| 2 | yes | no | 200 |
| 1 | no | no | 100 |
| 2 | no | no | 200 |
@skipOnOcV10 @skipOnOcV10.3 @issue-37013
Scenario Outline: reshare cannot extend the received expiry date further into the future
Given using OCS API version "<ocs_api_version>"
And parameter "shareapi_default_expire_date_user_share" of app "core" has been set to "<default-expire-date>"
And parameter "shareapi_enforce_expire_date_user_share" of app "core" has been set to "no"
And parameter "shareapi_expire_after_n_days_user_share" of app "core" has been set to "30"
And user "Carol" has been created with default attributes and without skeleton files
And user "Alice" has created a share with settings
| path | textfile0.txt |
| shareType | user |
| permissions | all |
| shareWith | Brian |
| expireDate | +20 days |
And user "Brian" has accepted share "/textfile0.txt" offered by user "Alice"
When user "Brian" creates a share using the sharing API with settings
| path | /Shares/textfile0.txt |
| shareType | user |
| permissions | change |
| shareWith | Carol |
| expireDate | +40 days |
#The action of changing the expiration date while resharing should be forbidden
Then the HTTP status code should be "403"
And the OCS status code should be "403"
And the information of the last share of user "Alice" should include
| expiration | +20 days |
Examples:
| ocs_api_version | default-expire-date |
| 1 | yes |
| 2 | yes |
| 1 | no |
| 2 | no |
@skipOnOcV10 @skipOnOcV10.3 @issue-37013
Scenario Outline: reshare cannot extend the received expiry date past the default when the default is enforced
Given using OCS API version "<ocs_api_version>"
And parameter "shareapi_default_expire_date_user_share" of app "core" has been set to "<default-expire-date>"
And parameter "shareapi_enforce_expire_date_user_share" of app "core" has been set to "yes"
And parameter "shareapi_expire_after_n_days_user_share" of app "core" has been set to "30"
And user "Carol" has been created with default attributes and without skeleton files
And user "Alice" has created a share with settings
| path | textfile0.txt |
| shareType | user |
| permissions | all |
| shareWith | Brian |
| expireDate | +20 days |
And user "Brian" has accepted share "/textfile0.txt" offered by user "Alice"
When user "Brian" creates a share using the sharing API with settings
| path | /Shares/textfile0.txt |
| shareType | user |
| permissions | change |
| shareWith | Carol |
| expireDate | +40 days |
Then the HTTP status code should be "403"
And the OCS status code should be "403"
And the information of the last share of user "Alice" should include
| expiration | +20 days |
Examples:
| ocs_api_version | default-expire-date |
| 1 | yes |
| 2 | yes |