From a86d5f67645616c2d5dc62835bc131928ef5d9d3 Mon Sep 17 00:00:00 2001 From: Saw-jan Date: Tue, 28 Feb 2023 14:57:33 +0545 Subject: [PATCH] remove sharing tests with expiration --- .../expected-failures-API-on-OCIS-storage.md | 2 + .../shareSubItemOfSpace.feature | 36 +- .../createShareExpirationDate.feature | 756 ------------------ .../allowGroupToCreatePublicLinks.feature | 110 --- ...pdatePublicLinkShareOc10Issue37653.feature | 47 -- 5 files changed, 6 insertions(+), 945 deletions(-) delete mode 100644 tests/acceptance/features/coreApiShareCreateSpecialToShares1/createShareExpirationDate.feature delete mode 100644 tests/acceptance/features/coreApiSharePublicLink3/allowGroupToCreatePublicLinks.feature delete mode 100644 tests/acceptance/features/coreApiSharePublicLink3/updatePublicLinkShareOc10Issue37653.feature diff --git a/tests/acceptance/expected-failures-API-on-OCIS-storage.md b/tests/acceptance/expected-failures-API-on-OCIS-storage.md index 1dc2abe3f75..3fb0b7f1f0e 100644 --- a/tests/acceptance/expected-failures-API-on-OCIS-storage.md +++ b/tests/acceptance/expected-failures-API-on-OCIS-storage.md @@ -295,6 +295,7 @@ cannot share a folder with create permission #### Expiration date of user shares +- [coreApiShareReshareToShares3/reShareWithExpiryDate.feature:33](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/coreApiShareReshareToShares3/reShareWithExpiryDate.feature#L33) - [coreApiShareReshareToShares3/reShareWithExpiryDate.feature:34](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/coreApiShareReshareToShares3/reShareWithExpiryDate.feature#L34) - [coreApiShareReshareToShares3/reShareWithExpiryDate.feature:85](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/coreApiShareReshareToShares3/reShareWithExpiryDate.feature#L85) - [coreApiShareReshareToShares3/reShareWithExpiryDate.feature:86](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/coreApiShareReshareToShares3/reShareWithExpiryDate.feature#L86) @@ -325,6 +326,7 @@ cannot share a folder with create permission #### Expiration date of group shares +- [coreApiShareReshareToShares3/reShareWithExpiryDate.feature:59](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/coreApiShareReshareToShares3/reShareWithExpiryDate.feature#L59) - [coreApiShareReshareToShares3/reShareWithExpiryDate.feature:60](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/coreApiShareReshareToShares3/reShareWithExpiryDate.feature#L60) - [coreApiShareReshareToShares3/reShareWithExpiryDate.feature:115](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/coreApiShareReshareToShares3/reShareWithExpiryDate.feature#L115) - [coreApiShareReshareToShares3/reShareWithExpiryDate.feature:116](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/coreApiShareReshareToShares3/reShareWithExpiryDate.feature#L116) diff --git a/tests/acceptance/features/apiSpacesShares/shareSubItemOfSpace.feature b/tests/acceptance/features/apiSpacesShares/shareSubItemOfSpace.feature index f7f189b578c..4d62ffc833c 100644 --- a/tests/acceptance/features/apiSpacesShares/shareSubItemOfSpace.feature +++ b/tests/acceptance/features/apiSpacesShares/shareSubItemOfSpace.feature @@ -37,9 +37,9 @@ Feature: Share a file or folder that is inside a space Examples: | entity | type | role | expireDate | expiration | | folder | folder | viewer | | | - | folder | folder | editor | 2042-03-25T23:59:59+0100 | 2042-03-25 | + | folder | folder | editor | | | | file.txt | file | viewer | | | - | file.txt | file | editor | 2042-03-25T23:59:59+0100 | 2042-03-25 | + | file.txt | file | editor | | | Scenario Outline: A user participant of the project space with manager role can share an entity to another user @@ -60,9 +60,9 @@ Feature: Share a file or folder that is inside a space | expiration | | Examples: | entity | type | role | expireDate | expiration | - | folder | folder | viewer | 2042-03-25T23:59:59+0100 | 2042-03-25 | + | folder | folder | viewer | | | | folder | folder | editor | | | - | file.txt | file | viewer | 2042-03-25T23:59:59+0100 | 2042-03-25 | + | file.txt | file | viewer | | | | file.txt | file | editor | | | @@ -118,31 +118,3 @@ Feature: Share a file or folder that is inside a space Then as "Brian" folder "Shares/folder" should exist And the information about the last share for user "Brian" should include | expiration | 2042-01-01 | - - - Scenario: A user changes the expiration date - Given user "Alice" has created a share inside of space "share sub-item" with settings: - | path | folder | - | shareWith | Brian | - | role | viewer | - | expireDate | 2042-01-01T23:59:59+0100 | - And user "Brian" has accepted share "/folder" offered by user "Alice" - When user "Alice" changes the last share with settings: - | expireDate | 2044-01-01T23:59:59.999+01:00 | - Then the HTTP status code should be "200" - And the information about the last share for user "Brian" should include - | expiration | 2044-01-01 | - - - Scenario: A user deletes the expiration date - Given user "Alice" has created a share inside of space "share sub-item" with settings: - | path | folder | - | shareWith | Brian | - | role | viewer | - | expireDate | 2042-01-01T23:59:59+0100 | - And user "Brian" has accepted share "/folder" offered by user "Alice" - When user "Alice" changes the last share with settings: - | expireDate | | - Then the HTTP status code should be "200" - And the information about the last share for user "Brian" should include - | expiration | | diff --git a/tests/acceptance/features/coreApiShareCreateSpecialToShares1/createShareExpirationDate.feature b/tests/acceptance/features/coreApiShareCreateSpecialToShares1/createShareExpirationDate.feature deleted file mode 100644 index 49db429ecd4..00000000000 --- a/tests/acceptance/features/coreApiShareCreateSpecialToShares1/createShareExpirationDate.feature +++ /dev/null @@ -1,756 +0,0 @@ -@api @files_sharing-app-required @issue-ocis-1328 @issue-ocis-1250 -Feature: a default expiration date can be specified for shares with users or groups - - Background: - Given auto-accept shares has been disabled - And these users have been created with default attributes and without skeleton files: - | username | - | Alice | - | Brian | - - - Scenario Outline: sharing with default expiration date enabled but not enforced for users, user shares without specifying expireDate - Given using OCS API version "" - And parameter "shareapi_default_expire_date_user_share" of app "core" has been set to "yes" - And user "Alice" has created folder "/FOLDER" - When user "Alice" shares folder "/FOLDER" with user "Brian" using the sharing API - And user "Brian" accepts share "/FOLDER" offered by user "Alice" using the sharing API - Then the OCS status code of responses on all endpoints should be "" - And the HTTP status code of responses on all endpoints should be "" - And the fields of the last response to user "Alice" should include - | expiration | | - And the response when user "Brian" gets the info of the last share should include - | expiration | | - Examples: - | ocs_api_version | ocs_status_code | http_status_code | - | 1 | 100 | 200 | - | 2 | 200 | 200 | - - - Scenario Outline: sharing with default expiration date enabled but not enforced for users, user shares with expiration date - Given using OCS API version "" - And parameter "shareapi_default_expire_date_user_share" of app "core" has been set to "yes" - And user "Alice" has created folder "/FOLDER" - And user "Alice" has created a share with settings - | path | /FOLDER | - | shareType | user | - | shareWith | Brian | - | permissions | read,share | - | expireDate | +15 days | - When user "Brian" accepts share "/FOLDER" offered by user "Alice" using the sharing API - Then the info about the last share by user "Alice" with user "Brian" should include - | share_type | user | - | file_target | /Shares/FOLDER | - | uid_owner | %username% | - | expiration | +15 days | - | share_with | %username% | - And the response when user "Brian" gets the info of the last share should include - | expiration | +15 days | - Examples: - | ocs_api_version | - | 1 | - | 2 | - - - Scenario Outline: sharing with default expiration date not enabled, user shares with expiration date set - Given using OCS API version "" - And user "Alice" has created folder "/FOLDER" - And user "Alice" has created a share with settings - | path | /FOLDER | - | shareType | user | - | shareWith | Brian | - | permissions | read,share | - | expireDate | +15 days | - When user "Brian" accepts share "/FOLDER" offered by user "Alice" using the sharing API - Then the info about the last share by user "Alice" with user "Brian" should include - | share_type | user | - | file_target | /Shares/FOLDER | - | uid_owner | %username% | - | expiration | +15 days | - | share_with | %username% | - And the response when user "Brian" gets the info of the last share should include - | expiration | +15 days | - Examples: - | ocs_api_version | - | 1 | - | 2 | - - - Scenario Outline: sharing with default expiration date enabled but not enforced for users, user shares with expiration date and then disables - Given using OCS API version "" - And parameter "shareapi_default_expire_date_user_share" of app "core" has been set to "yes" - And user "Alice" has created folder "/FOLDER" - And user "Alice" has created a share with settings - | path | /FOLDER | - | shareType | user | - | shareWith | Brian | - | permissions | read,share | - | expireDate | +15 days | - And user "Brian" has accepted share "/FOLDER" offered by user "Alice" - When the administrator sets parameter "shareapi_default_expire_date_user_share" of app "core" to "no" - Then the info about the last share by user "Alice" with user "Brian" should include - | share_type | user | - | file_target | /Shares/FOLDER | - | uid_owner | %username% | - | expiration | +15 days | - | share_with | %username% | - And the response when user "Brian" gets the info of the last share should include - | expiration | +15 days | - Examples: - | ocs_api_version | - | 1 | - | 2 | - - - Scenario Outline: sharing with default expiration date enabled and enforced for users, user shares with expiration date and then disables - Given using OCS API version "" - And parameter "shareapi_default_expire_date_user_share" of app "core" has been set to "yes" - And parameter "shareapi_enforce_expire_date_user_share" of app "core" has been set to "yes" - And user "Alice" has created folder "/FOLDER" - And user "Alice" has created a share with settings - | path | /FOLDER | - | shareType | user | - | shareWith | Brian | - | permissions | read,share | - And user "Brian" has accepted share "/FOLDER" offered by user "Alice" - When the administrator sets parameter "shareapi_default_expire_date_user_share" of app "core" to "no" - Then the info about the last share by user "Alice" with user "Brian" should include - | share_type | user | - | file_target | /Shares/FOLDER | - | uid_owner | %username% | - | share_with | %username% | - | expiration | +7 days | - And the response when user "Brian" gets the info of the last share should include - | expiration | +7 days | - Examples: - | ocs_api_version | - | 1 | - | 2 | - - - Scenario Outline: sharing with default expiration date enabled but not enforced for groups, user shares without specifying expireDate - Given using OCS API version "" - And parameter "shareapi_default_expire_date_group_share" of app "core" has been set to "yes" - And group "grp1" has been created - And user "Brian" has been added to group "grp1" - And user "Alice" has created folder "/FOLDER" - And user "Alice" has shared folder "/FOLDER" with group "grp1" - When user "Brian" accepts share "/FOLDER" offered by user "Alice" using the sharing API - Then the OCS status code should be "" - And the HTTP status code should be "" - And the fields of the last response to user "Alice" should include - | expiration | | - And the response when user "Brian" gets the info of the last share should include - | expiration | | - Examples: - | ocs_api_version | ocs_status_code | http_status_code | - | 1 | 100 | 200 | - | 2 | 200 | 200 | - - - Scenario Outline: sharing with default expiration date enabled but not enforced for groups, user shares with expiration date - Given using OCS API version "" - And parameter "shareapi_default_expire_date_group_share" of app "core" has been set to "yes" - And group "grp1" has been created - And user "Brian" has been added to group "grp1" - And user "Alice" has created folder "/FOLDER" - And user "Alice" has created a share with settings - | path | /FOLDER | - | shareType | group | - | shareWith | grp1 | - | permissions | read,share | - | expireDate | +15 days | - When user "Brian" accepts share "/FOLDER" offered by user "Alice" using the sharing API - Then the info about the last share by user "Alice" with user "Brian" should include - | share_type | group | - | file_target | /Shares/FOLDER | - | uid_owner | %username% | - | expiration | +15 days | - | share_with | grp1 | - And the response when user "Brian" gets the info of the last share should include - | expiration | +15 days | - Examples: - | ocs_api_version | - | 1 | - | 2 | - - - Scenario Outline: sharing with default expiration date not enabled for groups, user shares with expiration date set - Given using OCS API version "" - And group "grp1" has been created - And user "Brian" has been added to group "grp1" - And user "Alice" has created folder "/FOLDER" - And user "Alice" has created a share with settings - | path | /FOLDER | - | shareType | group | - | shareWith | grp1 | - | permissions | read,share | - | expireDate | +15 days | - When user "Brian" accepts share "/FOLDER" offered by user "Alice" using the sharing API - Then the info about the last share by user "Alice" with user "Brian" should include - | share_type | group | - | file_target | /Shares/FOLDER | - | uid_owner | %username% | - | expiration | +15 days | - | share_with | grp1 | - And the response when user "Brian" gets the info of the last share should include - | expiration | +15 days | - Examples: - | ocs_api_version | - | 1 | - | 2 | - - - Scenario Outline: sharing with default expiration date enabled but not enforced for groups, user shares with expiration date and then disables - Given using OCS API version "" - And parameter "shareapi_default_expire_date_group_share" of app "core" has been set to "yes" - And group "grp1" has been created - And user "Brian" has been added to group "grp1" - And user "Alice" has created folder "/FOLDER" - And user "Alice" has created a share with settings - | path | /FOLDER | - | shareType | group | - | shareWith | grp1 | - | permissions | read,share | - | expireDate | +15 days | - And user "Brian" has accepted share "/FOLDER" offered by user "Alice" - When the administrator sets parameter "shareapi_default_expire_date_group_share" of app "core" to "no" - Then the info about the last share by user "Alice" with user "Brian" should include - | share_type | group | - | file_target | /Shares/FOLDER | - | uid_owner | %username% | - | share_with | grp1 | - | expiration | +15 days | - And the response when user "Brian" gets the info of the last share should include - | expiration | +15 days | - Examples: - | ocs_api_version | - | 1 | - | 2 | - - - Scenario Outline: sharing with default expiration date enabled and enforced for groups, user shares with expiration date and then disables - Given using OCS API version "" - And parameter "shareapi_default_expire_date_group_share" of app "core" has been set to "yes" - And parameter "shareapi_enforce_expire_date_group_share" of app "core" has been set to "yes" - And group "grp1" has been created - And user "Brian" has been added to group "grp1" - And user "Alice" has created folder "/FOLDER" - And user "Alice" has created a share with settings - | path | /FOLDER | - | shareType | group | - | shareWith | grp1 | - | permissions | read,share | - | expireDate | +3 days | - And user "Brian" has accepted share "/FOLDER" offered by user "Alice" - When the administrator sets parameter "shareapi_default_expire_date_group_share" of app "core" to "no" - Then the info about the last share by user "Alice" with user "Brian" should include - | share_type | group | - | file_target | /Shares/FOLDER | - | uid_owner | %username% | - | share_with | grp1 | - | expiration | +3 days | - And the response when user "Brian" gets the info of the last share should include - | expiration | +3 days | - Examples: - | ocs_api_version | - | 1 | - | 2 | - - - Scenario Outline: sharing with default expiration date enabled and enforced for users, user shares without setting expiration date - Given using OCS API version "" - And parameter "shareapi_default_expire_date_user_share" of app "core" has been set to "yes" - And parameter "shareapi_enforce_expire_date_user_share" of app "core" has been set to "yes" - And user "Alice" has uploaded file "filesForUpload/textfile.txt" to "/textfile0.txt" - And user "Alice" has shared file "/textfile0.txt" with user "Brian" - When user "Brian" accepts share "/textfile0.txt" offered by user "Alice" using the sharing API - Then the info about the last share by user "Alice" with user "Brian" should include - | share_type | user | - | file_target | /Shares/textfile0.txt | - | uid_owner | %username% | - | share_with | %username% | - | expiration | +7 days | - And the response when user "Brian" gets the info of the last share should include - | expiration | +7 days | - Examples: - | ocs_api_version | - | 1 | - | 2 | - - - Scenario Outline: sharing with default expiration date enabled and enforced for users, user shares with expiration date more than the default - Given using OCS API version "" - And parameter "shareapi_default_expire_date_user_share" of app "core" has been set to "yes" - And parameter "shareapi_enforce_expire_date_user_share" of app "core" has been set to "yes" - And user "Alice" has uploaded file "filesForUpload/textfile.txt" to "/textfile0.txt" - When user "Alice" creates a share using the sharing API with settings - | path | textfile0.txt | - | shareType | user | - | shareWith | Brian | - | permissions | read,share | - | expireDate | +10 days | - Then the HTTP status code should be "" - And the OCS status code should be "404" - And the OCS status message should be "Cannot set expiration date more than 7 days in the future" - And the sharing API should report to user "Brian" that no shares are in the pending state - And user "Brian" should not have any received shares - Examples: - | ocs_api_version | http_status_code | - | 1 | 200 | - | 2 | 404 | - - - Scenario Outline: sharing with default expiration date enabled and enforced for users/max expire date is set, user shares without setting expiration date - Given using OCS API version "" - And parameter "shareapi_default_expire_date_user_share" of app "core" has been set to "yes" - 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 "Alice" has uploaded file "filesForUpload/textfile.txt" to "/textfile0.txt" - And user "Alice" has shared file "/textfile0.txt" with user "Brian" - When user "Brian" accepts share "/textfile0.txt" offered by user "Alice" using the sharing API - Then the info about the last share by user "Alice" with user "Brian" should include - | share_type | user | - | file_target | /Shares/textfile0.txt | - | uid_owner | %username% | - | share_with | %username% | - | expiration | +30 days | - And the response when user "Brian" gets the info of the last share should include - | expiration | +30 days | - Examples: - | ocs_api_version | - | 1 | - | 2 | - - - Scenario Outline: sharing with default expiration date enabled and enforced for users/max expire date set, user shares with expiration date more than the max expire date - Given using OCS API version "" - And parameter "shareapi_default_expire_date_user_share" of app "core" has been set to "yes" - 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 "Alice" has uploaded file "filesForUpload/textfile.txt" to "/textfile0.txt" - When user "Alice" creates a share using the sharing API with settings - | path | textfile0.txt | - | shareType | user | - | shareWith | Brian | - | permissions | read,share | - | expireDate | +40 days | - Then the HTTP status code should be "" - And the OCS status code should be "404" - And the OCS status message should be "Cannot set expiration date more than 30 days in the future" - And the sharing API should report to user "Brian" that no shares are in the pending state - And user "Brian" should not have any received shares - Examples: - | ocs_api_version | http_status_code | - | 1 | 200 | - | 2 | 404 | - - - Scenario Outline: sharing with default expiration date enabled and enforced for users/max expire date is set, user shares and changes the max expire date greater than the previous one - Given using OCS API version "" - And parameter "shareapi_default_expire_date_user_share" of app "core" has been set to "yes" - 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 "Alice" has uploaded file "filesForUpload/textfile.txt" to "/textfile0.txt" - And user "Alice" has shared file "textfile0.txt" with user "Brian" with permissions "read,share" - And user "Brian" has accepted share "/textfile0.txt" offered by user "Alice" - When the administrator sets parameter "shareapi_expire_after_n_days_user_share" of app "core" to "40" - Then the info about the last share by user "Alice" with user "Brian" should include - | expiration | +30 days | - Examples: - | ocs_api_version | - | 1 | - | 2 | - - - Scenario Outline: sharing with default expiration date enabled for users/max expire date is set, user shares and changes max expire date less than the previous one - Given using OCS API version "" - And parameter "shareapi_default_expire_date_user_share" of app "core" has been set to "yes" - 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 "Alice" has uploaded file "filesForUpload/textfile.txt" to "/textfile0.txt" - And user "Alice" has shared file "textfile0.txt" with user "Brian" with permissions "read,share" - And user "Brian" has accepted share "/textfile0.txt" offered by user "Alice" - When the administrator sets parameter "shareapi_expire_after_n_days_user_share" of app "core" to "15" - Then the info about the last share by user "Alice" with user "Brian" should include - | expiration | +30 days | - Examples: - | ocs_api_version | - | 1 | - | 2 | - - - Scenario Outline: sharing with default expiration date enabled and enforced for groups, user shares without setting expiration date - Given using OCS API version "" - And parameter "shareapi_default_expire_date_group_share" of app "core" has been set to "yes" - And parameter "shareapi_enforce_expire_date_group_share" of app "core" has been set to "yes" - And group "grp1" has been created - And user "Brian" has been added to group "grp1" - And user "Alice" has uploaded file "filesForUpload/textfile.txt" to "/textfile0.txt" - And user "Alice" has shared file "textfile0.txt" with group "grp1" - When user "Brian" accepts share "/textfile0.txt" offered by user "Alice" using the sharing API - Then the info about the last share by user "Alice" with user "Brian" should include - | share_type | group | - | file_target | /Shares/textfile0.txt | - | uid_owner | %username% | - | share_with | grp1 | - | expiration | +7 days | - And the response when user "Brian" gets the info of the last share should include - | expiration | +7 days | - Examples: - | ocs_api_version | - | 1 | - | 2 | - - - Scenario Outline: sharing with default expiration date enabled and enforced for groups, user shares with expiration date more than the default - Given using OCS API version "" - And parameter "shareapi_default_expire_date_group_share" of app "core" has been set to "yes" - And parameter "shareapi_enforce_expire_date_group_share" of app "core" has been set to "yes" - And group "grp1" has been created - And user "Brian" has been added to group "grp1" - And user "Alice" has uploaded file "filesForUpload/textfile.txt" to "/textfile0.txt" - When user "Alice" creates a share using the sharing API with settings - | path | textfile0.txt | - | shareType | group | - | shareWith | grp1 | - | permissions | read,share | - | expireDate | +10 days | - Then the HTTP status code should be "" - And the OCS status code should be "404" - And the OCS status message should be "Cannot set expiration date more than 7 days in the future" - And the sharing API should report to user "Brian" that no shares are in the pending state - And user "Brian" should not have any received shares - Examples: - | ocs_api_version | http_status_code | - | 1 | 200 | - | 2 | 404 | - - - Scenario Outline: sharing with default expiration date enabled and enforced for groups/max expire date is set, user shares without setting expiration date - Given using OCS API version "" - And parameter "shareapi_default_expire_date_group_share" of app "core" has been set to "yes" - And parameter "shareapi_enforce_expire_date_group_share" of app "core" has been set to "yes" - And parameter "shareapi_expire_after_n_days_group_share" of app "core" has been set to "30" - And group "grp1" has been created - And user "Brian" has been added to group "grp1" - And user "Alice" has uploaded file "filesForUpload/textfile.txt" to "/textfile0.txt" - And user "Alice" has shared file "textfile0.txt" with group "grp1" - When user "Brian" accepts share "/textfile0.txt" offered by user "Alice" using the sharing API - Then the info about the last share by user "Alice" with user "Brian" should include - | share_type | group | - | file_target | /Shares/textfile0.txt | - | uid_owner | %username% | - | share_with | grp1 | - | expiration | +30 days | - And the response when user "Brian" gets the info of the last share should include - | expiration | +30 days | - Examples: - | ocs_api_version | - | 1 | - | 2 | - - - Scenario Outline: sharing with default expiration date enabled and enforced for groups/max expire date set, user shares with expiration date more than the max expire date - Given using OCS API version "" - And parameter "shareapi_default_expire_date_group_share" of app "core" has been set to "yes" - And parameter "shareapi_enforce_expire_date_group_share" of app "core" has been set to "yes" - And parameter "shareapi_expire_after_n_days_group_share" of app "core" has been set to "30" - And group "grp1" has been created - And user "Brian" has been added to group "grp1" - And user "Alice" has uploaded file "filesForUpload/textfile.txt" to "/textfile0.txt" - When user "Alice" creates a share using the sharing API with settings - | path | textfile0.txt | - | shareType | group | - | shareWith | grp1 | - | permissions | read,share | - | expireDate | +40 days | - Then the HTTP status code should be "" - And the OCS status code should be "404" - And the OCS status message should be "Cannot set expiration date more than 30 days in the future" - And the sharing API should report to user "Brian" that no shares are in the pending state - And user "Brian" should not have any received shares - Examples: - | ocs_api_version | http_status_code | - | 1 | 200 | - | 2 | 404 | - - - Scenario Outline: sharing with default expiration date enabled for groups/max expire date is set, user shares and changes the max expire date greater than the previous one - Given using OCS API version "" - And parameter "shareapi_default_expire_date_group_share" of app "core" has been set to "yes" - And parameter "shareapi_enforce_expire_date_group_share" of app "core" has been set to "yes" - And parameter "shareapi_expire_after_n_days_group_share" of app "core" has been set to "30" - And group "grp1" has been created - And user "Brian" has been added to group "grp1" - And user "Alice" has uploaded file "filesForUpload/textfile.txt" to "/textfile0.txt" - And user "Alice" has shared file "textfile0.txt" with group "grp1" with permissions "read,share" - And user "Brian" has accepted share "/textfile0.txt" offered by user "Alice" - When the administrator sets parameter "shareapi_expire_after_n_days_group_share" of app "core" to "40" - Then the info about the last share by user "Alice" with user "Brian" should include - | expiration | +30 days | - And the response when user "Brian" gets the info of the last share should include - | expiration | +30 days | - Examples: - | ocs_api_version | - | 1 | - | 2 | - - - Scenario Outline: sharing with default expiration date enabled for groups/max expire date is set, user shares and changes max expire date less than the previous one - Given using OCS API version "" - And parameter "shareapi_default_expire_date_group_share" of app "core" has been set to "yes" - And parameter "shareapi_enforce_expire_date_group_share" of app "core" has been set to "yes" - And parameter "shareapi_expire_after_n_days_group_share" of app "core" has been set to "30" - And group "grp1" has been created - And user "Brian" has been added to group "grp1" - And user "Alice" has uploaded file "filesForUpload/textfile.txt" to "/textfile0.txt" - And user "Alice" has shared file "textfile0.txt" with group "grp1" with permissions "read,share" - And user "Brian" has accepted share "/textfile0.txt" offered by user "Alice" - When the administrator sets parameter "shareapi_expire_after_n_days_group_share" of app "core" to "15" - Then the info about the last share by user "Alice" with user "Brian" should include - | expiration | +30 days | - And the response when user "Brian" gets the info of the last share should include - | expiration | +30 days | - Examples: - | ocs_api_version | - | 1 | - | 2 | - - - Scenario Outline: sharing with default expiration date enforced for users, user shares to a group without setting an expiration date - Given using OCS API version "" - And parameter "shareapi_default_expire_date_user_share" of app "core" has been set to "yes" - And parameter "shareapi_enforce_expire_date_user_share" of app "core" has been set to "yes" - And group "grp1" has been created - And user "Brian" has been added to group "grp1" - And user "Alice" has created folder "FOLDER" - And user "Alice" has shared folder "FOLDER" with group "grp1" with permissions "read,share" - When user "Brian" accepts share "/FOLDER" offered by user "Alice" using the sharing API - Then the info about the last share by user "Alice" with user "Brian" should include - | expiration | | - And the response when user "Brian" gets the info of the last share should include - | expiration | | - Examples: - | ocs_api_version | - | 1 | - | 2 | - - - Scenario Outline: sharing with default expiration date enforced for groups, user shares to another user - Given using OCS API version "" - And parameter "shareapi_default_expire_date_group_share" of app "core" has been set to "yes" - And parameter "shareapi_enforce_expire_date_group_share" of app "core" has been set to "yes" - And user "Alice" has created folder "FOLDER" - And user "Alice" has shared folder "/FOLDER" with user "Brian" with permissions "read,share" - When user "Brian" accepts share "/FOLDER" offered by user "Alice" using the sharing API - Then the info about the last share by user "Alice" with user "Brian" should include - | expiration | | - And the response when user "Brian" gets the info of the last share should include - | expiration | | - Examples: - | ocs_api_version | - | 1 | - | 2 | - - - Scenario Outline: sharing with default expiration date enforced for users, user shares with invalid expiration date set - Given using OCS API version "" - And parameter "shareapi_default_expire_date_user_share" of app "core" has been set to "yes" - And parameter "shareapi_enforce_expire_date_user_share" of app "core" has been set to "yes" - And user "Alice" has uploaded file "filesForUpload/textfile.txt" to "/textfile0.txt" - When user "Alice" creates a share using the sharing API with settings - | path | textfile0.txt | - | shareType | user | - | shareWith | Brian | - | permissions | read,share | - | expireDateAsString | INVALID-DATE | - Then the HTTP status code should be "" - And the OCS status code should be "" - And the OCS status message should be "Invalid date, date format must be YYYY-MM-DD" - And the sharing API should report to user "Brian" that no shares are in the pending state - And user "Brian" should not have any received shares - Examples: - | ocs_api_version | ocs_status_code | http_status_code | - | 1 | 404 | 200 | - | 2 | 404 | 404 | - - - Scenario Outline: sharing with default expiration date enforced for users, user shares with different time format - Given using OCS API version "2" - And parameter "shareapi_default_expire_date_user_share" of app "core" has been set to "yes" - And user "Alice" has uploaded file "filesForUpload/textfile.txt" to "/textfile0.txt" - And user "Alice" has created a share with settings - | path | textfile0.txt | - | shareType | user | - | shareWith | Brian | - | permissions | read,share | - | expireDateAsString | | - When user "Brian" accepts share "/textfile0.txt" offered by user "Alice" using the sharing API - Then the HTTP status code should be "200" - And the OCS status code should be "200" - And the fields of the last response to user "Alice" should include - | expiration | 2050-12-11 | - And the response when user "Brian" gets the info of the last share should include - | expiration | 2050-12-11 | - Examples: - | date | - | 2050-12-11 | - | 11-12-2050 | - | 12/11/2050 | - | 11.12.2050 | - | 11.12.2050 12:30:40 | - - - Scenario Outline: user shares with humanized expiration date format - Given using OCS API version "" - And parameter "shareapi_default_expire_date_user_share" of app "core" has been set to "" - And parameter "shareapi_enforce_expire_date_user_share" of app "core" has been set to "" - And user "Alice" has uploaded file "filesForUpload/textfile.txt" to "/textfile0.txt" - And user "Alice" has created a share with settings - | path | textfile0.txt | - | shareType | user | - | shareWith | Brian | - | permissions | read,share | - | expireDateAsString | | - When user "Brian" accepts share "/textfile0.txt" offered by user "Alice" using the sharing API - Then the fields of the last response to user "Alice" should include - | expiration | | - And the response when user "Brian" gets the info of the last share should include - | expiration | | - Examples: - | ocs_api_version | expiration_date | default | enforce | - | 1 | today | yes | yes | - | 2 | today | yes | yes | - | 1 | tomorrow | yes | yes | - | 2 | tomorrow | yes | yes | - | 1 | today | yes | no | - | 2 | today | yes | no | - | 1 | tomorrow | yes | no | - | 2 | tomorrow | yes | no | - | 1 | today | no | no | - | 2 | today | no | no | - | 1 | tomorrow | no | no | - | 2 | tomorrow | no | no | - - - Scenario Outline: user shares with humanized expiration date format in past - Given using OCS API version "" - And parameter "shareapi_default_expire_date_user_share" of app "core" has been set to "" - And parameter "shareapi_enforce_expire_date_user_share" of app "core" has been set to "" - And user "Alice" has uploaded file "filesForUpload/textfile.txt" to "/textfile0.txt" - When user "Alice" creates a share using the sharing API with settings - | path | textfile0.txt | - | shareType | user | - | shareWith | Brian | - | permissions | read,share | - | expireDateAsString | yesterday | - Then the HTTP status code should be "" - And the OCS status code should be "" - And the OCS status message should be "Expiration date is in the past" - And the sharing API should report to user "Brian" that no shares are in the pending state - And user "Brian" should not have any received shares - Examples: - | ocs_api_version | ocs_status_code | http_status_code | default | enforce | - | 1 | 404 | 200 | yes | yes | - | 2 | 404 | 404 | yes | yes | - | 1 | 404 | 200 | yes | no | - | 2 | 404 | 404 | yes | no | - | 1 | 404 | 200 | no | no | - | 2 | 404 | 404 | no | no | - - - Scenario Outline: user shares with invalid humanized expiration date - Given using OCS API version "" - And parameter "shareapi_default_expire_date_user_share" of app "core" has been set to "" - And parameter "shareapi_enforce_expire_date_user_share" of app "core" has been set to "" - And user "Alice" has uploaded file "filesForUpload/textfile.txt" to "/textfile0.txt" - When user "Alice" creates a share using the sharing API with settings - | path | textfile0.txt | - | shareType | user | - | shareWith | Brian | - | permissions | read,share | - | expireDateAsString | 123 | - Then the HTTP status code should be "" - And the OCS status code should be "" - And the OCS status message should be "Invalid date, date format must be YYYY-MM-DD" - And the sharing API should report to user "Brian" that no shares are in the pending state - And user "Brian" should not have any received shares - Examples: - | ocs_api_version | ocs_status_code | http_status_code | default | enforce | - | 1 | 404 | 200 | yes | yes | - | 2 | 404 | 404 | yes | yes | - | 1 | 404 | 200 | yes | no | - | 2 | 404 | 404 | yes | no | - | 1 | 404 | 200 | no | no | - | 2 | 404 | 404 | no | no | - - - Scenario Outline: sharing with default expiration date enforced for users, user shares with past expiration date set - Given using OCS API version "" - And parameter "shareapi_default_expire_date_user_share" of app "core" has been set to "yes" - And parameter "shareapi_enforce_expire_date_user_share" of app "core" has been set to "yes" - And user "Alice" has uploaded file "filesForUpload/textfile.txt" to "/textfile0.txt" - When user "Alice" creates a share using the sharing API with settings - | path | textfile0.txt | - | shareType | user | - | shareWith | Brian | - | permissions | read,share | - | expireDateAsString | -10 days | - Then the HTTP status code should be "" - And the OCS status code should be "" - And the OCS status message should be "Expiration date is in the past" - And the sharing API should report to user "Brian" that no shares are in the pending state - And user "Brian" should not have any received shares - Examples: - | ocs_api_version | ocs_status_code | http_status_code | - | 1 | 404 | 200 | - | 2 | 404 | 404 | - - @issue-36569 - Scenario Outline: sharing with default expiration date enforced for users, max expire date is 0, user shares without specifying expiration date - Given using OCS API version "" - And parameter "shareapi_default_expire_date_user_share" of app "core" has been set to "yes" - 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 "0" - And user "Alice" has uploaded file "filesForUpload/textfile.txt" to "/textfile0.txt" - And user "Alice" has created a share with settings - | path | textfile0.txt | - | shareType | user | - | shareWith | Brian | - | permissions | read,share | - When user "Brian" accepts share "/textfile0.txt" offered by user "Alice" using the sharing API - Then the HTTP status code should be "200" - And the OCS status code should be "" - And the fields of the last response to user "Alice" should include - | expiration | today | - And the response when user "Brian" gets the info of the last share should include - | expiration | today | - Examples: - | ocs_api_version | ocs_status_code | - | 1 | 100 | - | 2 | 200 | - - - Scenario Outline: sharing with default expiration date enforced for users, max expire date is 1, user shares without specifying expiration date - Given using OCS API version "" - And parameter "shareapi_default_expire_date_user_share" of app "core" has been set to "yes" - 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 "1" - And user "Alice" has uploaded file "filesForUpload/textfile.txt" to "/textfile0.txt" - And user "Alice" has created a share with settings - | path | textfile0.txt | - | shareType | user | - | shareWith | Brian | - | permissions | read,share | - When user "Brian" accepts share "/textfile0.txt" offered by user "Alice" using the sharing API - Then the HTTP status code should be "200" - And the OCS status code should be "" - And the fields of the last response to user "Alice" should include - | expiration | tomorrow | - And the response when user "Brian" gets the info of the last share should include - | expiration | tomorrow | - Examples: - | ocs_api_version | ocs_status_code | - | 1 | 100 | - | 2 | 200 | diff --git a/tests/acceptance/features/coreApiSharePublicLink3/allowGroupToCreatePublicLinks.feature b/tests/acceptance/features/coreApiSharePublicLink3/allowGroupToCreatePublicLinks.feature deleted file mode 100644 index 6133ba57fb1..00000000000 --- a/tests/acceptance/features/coreApiSharePublicLink3/allowGroupToCreatePublicLinks.feature +++ /dev/null @@ -1,110 +0,0 @@ -@api @files_sharing-app-required @notToImplementOnOcis -Feature: public share sharers groups setting - As an admin - I should be able to allow only certain groups to create public links - So that random links are not generated on my file system - - Background: - Given group "grp1" has been created - And user "Alice" has been created with default attributes and without skeleton files - And user "Alice" has uploaded file with content "file to share with user" to "/fileToShare.txt" - - - Scenario: users present in public share shares groups can create new public link shares - Given parameter "public_share_sharers_groups_allowlist_enabled" of app "files_sharing" has been set to "yes" - And parameter "public_share_sharers_groups_allowlist" of app "files_sharing" has been set to '["grp1"]' - And user "Alice" has been added to group "grp1" - When user "Alice" creates a public link share using the sharing API with settings - | path | fileToShare.txt | - Then the OCS status code should be "100" - And the HTTP status code should be "200" - And the fields of the last response to user "Alice" should include - | item_type | file | - | mimetype | text/plain | - | file_target | /fileToShare.txt | - | path | /fileToShare.txt | - | permissions | read | - | share_type | public_link | - | displayname_file_owner | %displayname% | - | displayname_owner | %displayname% | - | uid_file_owner | %username% | - | uid_owner | %username% | - | name | | - - - Scenario: users not present in public share shares groups cannot create a new public link share - Given parameter "public_share_sharers_groups_allowlist_enabled" of app "files_sharing" has been set to "yes" - And parameter "public_share_sharers_groups_allowlist" of app "files_sharing" has been set to '["grp1"]' - When user "Alice" creates a public link share using the sharing API with settings - | path | fileToShare.txt | - Then the OCS status code should be "403" - And the HTTP status code should be "200" - And the OCS status message should be "Public link creation is only possible for certain groups" - - - Scenario: existing links can still be updated by sharers even if they are not present in public share sharers groups - Given user "Alice" has created a public link share with settings - | path | /fileToShare.txt | - | permissions | read | - And parameter "public_share_sharers_groups_allowlist_enabled" of app "files_sharing" has been set to "yes" - And parameter "public_share_sharers_groups_allowlist" of app "files_sharing" has been set to '["grp1"]' - When user "Alice" updates the last public link share using the sharing API with - | expireDate | 2040-01-01T23:59:59+0100 | - Then the HTTP status code should be "200" - And the OCS status code should be "100" - And the fields of the last response to user "Alice" should include - | expiration | 2040-01-01 22:59:59 | - - - Scenario: existing links can still be deleted by sharers even if they are not present in public share sharers groups - Given user "Alice" has created a public link share with settings - | path | /fileToShare.txt | - | permissions | read | - | name | shared-link | - And parameter "public_share_sharers_groups_allowlist_enabled" of app "files_sharing" has been set to "yes" - And parameter "public_share_sharers_groups_allowlist" of app "files_sharing" has been set to '["grp1"]' - When user "Alice" deletes public link share named "shared-link" in file "fileToShare.txt" using the sharing API - Then the HTTP status code should be "200" - And the OCS status code should be "100" - And as user "Alice" the file "fileToShare.txt" should not have any shares - - - Scenario: creating a new link share is not restricted if no groups are inside the allowed public share sharers groups even if allowlist is enabled - Given parameter "public_share_sharers_groups_allowlist_enabled" of app "files_sharing" has been set to "yes" - When user "Alice" creates a public link share using the sharing API with settings - | path | fileToShare.txt | - Then the OCS status code should be "100" - And the HTTP status code should be "200" - And the fields of the last response to user "Alice" should include - | item_type | file | - | mimetype | text/plain | - | file_target | /fileToShare.txt | - | path | /fileToShare.txt | - | permissions | read | - | share_type | public_link | - | displayname_file_owner | %displayname% | - | displayname_owner | %displayname% | - | uid_file_owner | %username% | - | uid_owner | %username% | - | name | | - - - Scenario: multiple groups can be added to public share sharers groups allow list - Given parameter "public_share_sharers_groups_allowlist_enabled" of app "files_sharing" has been set to "yes" - And user "Brian" has been created with default attributes and without skeleton files - And user "Carol" has been created with default attributes and without skeleton files - And user "Brian" has uploaded file with content "file to share with user" to "/fileToShare.txt" - And user "Carol" has uploaded file with content "file to share with user" to "/fileToShare.txt" - And group "grp2" has been created - And user "Alice" has been added to group "grp1" - And user "Brian" has been added to group "grp2" - And parameter "public_share_sharers_groups_allowlist" of app "files_sharing" has been set to '["grp1", "grp2"]' - When user "Alice" creates a public link share using the sharing API with settings - | path | fileToShare.txt | - And user "Brian" creates a public link share using the sharing API with settings - | path | fileToShare.txt | - And user "Carol" creates a public link share using the sharing API with settings - | path | fileToShare.txt | - Then the HTTP status code of responses on all endpoints should be "200" - And the OCS status code of responses on each endpoint should be "100, 100, 403" respectively - And the OCS status message should be "Public link creation is only possible for certain groups" diff --git a/tests/acceptance/features/coreApiSharePublicLink3/updatePublicLinkShareOc10Issue37653.feature b/tests/acceptance/features/coreApiSharePublicLink3/updatePublicLinkShareOc10Issue37653.feature deleted file mode 100644 index 139a6938931..00000000000 --- a/tests/acceptance/features/coreApiSharePublicLink3/updatePublicLinkShareOc10Issue37653.feature +++ /dev/null @@ -1,47 +0,0 @@ -@api @files_sharing-app-required @public_link_share-feature-required @notToImplementOnOCIS -Feature: update a public link share - - Background: - Given using OCS API version "1" - And user "Alice" has been created with default attributes and without skeleton files - - @issue-37653 - Scenario Outline: API responds with a full set of parameters when owner changes the expireDate of a public share - Given using OCS API version "" - And user "Alice" has created folder "FOLDER" - And user "Alice" has created a public link share with settings - | path | FOLDER | - 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 "" - And the OCS status message should be "" - #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 | | - | additional_info_file_owner | | - | 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 |