diff options
Diffstat (limited to 'build/integration/sharing_features')
6 files changed, 419 insertions, 508 deletions
diff --git a/build/integration/sharing_features/sharing-activity.feature b/build/integration/sharing_features/sharing-activity.feature new file mode 100644 index 00000000000..016b376488b --- /dev/null +++ b/build/integration/sharing_features/sharing-activity.feature @@ -0,0 +1,46 @@ +# SPDX-FileCopyrightText: 2025 Nextcloud GmbH and Nextcloud contributors +# SPDX-License-Identifier: AGPL-3.0-or-later +Feature: sharing + Background: + Given using api version "1" + Given using new dav path + Given invoking occ with "app:enable --force activity" + Given the command was successful + Given user "user0" exists + And Logging in using web as "user0" + And Sending a "POST" to "/apps/activity/settings" with requesttoken + | public_links_notification | 1 | + | public_links_upload_notification | 1 | + | notify_setting_batchtime | 0 | + | activity_digest | 0 | + + Scenario: Creating a new mail share and check activity + Given dummy mail server is listening + And As an "user0" + When creating a share with + | path | welcome.txt | + | shareType | 4 | + | shareWith | dumy@test.com | + Then the OCS status code should be "100" + And the HTTP status code should be "200" + And last share can be downloaded + Then last activity should be + | app | files_sharing | + | type | public_links | + | object_type | files | + | object_name | /welcome.txt | + + Scenario: Creating a new public share and check activity + Given user "user0" exists + And As an "user0" + When creating a share with + | path | welcome.txt | + | shareType | 3 | + Then the OCS status code should be "100" + And the HTTP status code should be "200" + And last link share can be downloaded + Then last activity should be + | app | files_sharing | + | type | public_links | + | object_type | files | + | object_name | /welcome.txt | diff --git a/build/integration/sharing_features/sharing-v1-part2.feature b/build/integration/sharing_features/sharing-v1-part2.feature index a9e2e50ce02..a6e4c67165a 100644 --- a/build/integration/sharing_features/sharing-v1-part2.feature +++ b/build/integration/sharing_features/sharing-v1-part2.feature @@ -1,3 +1,5 @@ +# SPDX-FileCopyrightText: 2019 Nextcloud GmbH and Nextcloud contributors +# SPDX-License-Identifier: AGPL-3.0-or-later Feature: sharing Background: Given using api version "1" @@ -541,6 +543,29 @@ Feature: sharing And the HTTP status code should be "200" And last share_id is included in the answer + Scenario: Group shares are deleted when the group is deleted + Given As an "admin" + And user "user0" exists + And user "user1" exists + And group "group0" exists + And user "user0" belongs to group "group0" + And file "textfile0.txt" of user "user1" is shared with group "group0" + And As an "user0" + When sending "GET" to "/apps/files_sharing/api/v1/shares?shared_with_me=true" + Then the OCS status code should be "100" + And the HTTP status code should be "200" + And last share_id is included in the answer + When group "group0" does not exist + Then sending "GET" to "/apps/files_sharing/api/v1/shares?shared_with_me=true" + And the OCS status code should be "100" + And the HTTP status code should be "200" + And last share_id is not included in the answer + When group "group0" exists + Then sending "GET" to "/apps/files_sharing/api/v1/shares?shared_with_me=true" + And the OCS status code should be "100" + And the HTTP status code should be "200" + And last share_id is not included in the answer + Scenario: User is not allowed to reshare file As an "admin" Given user "user0" exists @@ -699,6 +724,79 @@ Feature: sharing Then the OCS status code should be "404" And the HTTP status code should be "200" + Scenario: download restrictions can not be dropped + As an "admin" + Given user "user0" exists + And user "user1" exists + And user "user2" exists + And User "user0" uploads file with content "foo" to "/tmp.txt" + And As an "user0" + And creating a share with + | path | /tmp.txt | + | shareType | 0 | + | shareWith | user1 | + | permissions | 17 | + | attributes | [{"scope":"permissions","key":"download","value":false}] | + And As an "user1" + And accepting last share + When Getting info of last share + Then Share fields of last share match with + | uid_owner | user0 | + | uid_file_owner | user0 | + | permissions | 17 | + | attributes | [{"scope":"permissions","key":"download","value":false}] | + When creating a share with + | path | /tmp.txt | + | shareType | 0 | + | shareWith | user2 | + | permissions | 1 | + Then the OCS status code should be "100" + And the HTTP status code should be "200" + When As an "user2" + And accepting last share + And Getting info of last share + Then Share fields of last share match with + | share_type | 0 | + | permissions | 1 | + | uid_owner | user1 | + | uid_file_owner | user0 | + | attributes | [{"scope":"permissions","key":"download","value":false}] | + + Scenario: download restrictions can not be dropped when re-sharing even on link shares + As an "admin" + Given user "user0" exists + And user "user1" exists + And User "user0" uploads file with content "foo" to "/tmp.txt" + And As an "user0" + And creating a share with + | path | /tmp.txt | + | shareType | 0 | + | shareWith | user1 | + | permissions | 17 | + | attributes | [{"scope":"permissions","key":"download","value":false}] | + And As an "user1" + And accepting last share + When Getting info of last share + Then Share fields of last share match with + | uid_owner | user0 | + | attributes | [{"scope":"permissions","key":"download","value":false}] | + When creating a share with + | path | /tmp.txt | + | shareType | 3 | + | permissions | 1 | + And Getting info of last share + And Updating last share with + | hideDownload | false | + Then the OCS status code should be "100" + And the HTTP status code should be "200" + When Getting info of last share + Then Share fields of last share match with + | share_type | 3 | + | uid_owner | user1 | + | uid_file_owner | user0 | + | hide_download | 1 | + | attributes | [{"scope":"permissions","key":"download","value":false}] | + Scenario: User is not allowed to reshare file with additional delete permissions As an "admin" Given user "user0" exists @@ -1167,7 +1265,9 @@ Feature: sharing |{http://open-collaboration-services.org/ns}share-permissions | Then the single response should contain a property "{http://open-collaboration-services.org/ns}share-permissions" with value "19" - Scenario: Cannot download a file when it's shared view-only + Scenario: Cannot download a file when it's shared view-only without shareapi_allow_view_without_download + Given As an "admin" + And parameter "shareapi_allow_view_without_download" of app "core" is set to "no" Given user "user0" exists And user "user1" exists And User "user0" moves file "/textfile0.txt" to "/document.odt" @@ -1176,8 +1276,15 @@ Feature: sharing When As an "user1" And Downloading file "/document.odt" Then the HTTP status code should be "403" + Then As an "admin" + And parameter "shareapi_allow_view_without_download" of app "core" is set to "yes" + Then As an "user1" + And Downloading file "/document.odt" + Then the HTTP status code should be "200" - Scenario: Cannot download a file when its parent is shared view-only + Scenario: Cannot download a file when its parent is shared view-only without shareapi_allow_view_without_download + Given As an "admin" + And parameter "shareapi_allow_view_without_download" of app "core" is set to "no" Given user "user0" exists And user "user1" exists And User "user0" created a folder "/sharedviewonly" @@ -1187,8 +1294,15 @@ Feature: sharing When As an "user1" And Downloading file "/sharedviewonly/document.odt" Then the HTTP status code should be "403" + Then As an "admin" + And parameter "shareapi_allow_view_without_download" of app "core" is set to "yes" + Then As an "user1" + And Downloading file "/sharedviewonly/document.odt" + Then the HTTP status code should be "200" - Scenario: Cannot copy a file when it's shared view-only + Scenario: Cannot copy a file when it's shared view-only even with shareapi_allow_view_without_download enabled + Given As an "admin" + And parameter "shareapi_allow_view_without_download" of app "core" is set to "no" Given user "user0" exists And user "user1" exists And User "user0" moves file "/textfile0.txt" to "/document.odt" @@ -1196,8 +1310,15 @@ Feature: sharing And user "user1" accepts last share When User "user1" copies file "/document.odt" to "/copyforbidden.odt" Then the HTTP status code should be "403" + Then As an "admin" + And parameter "shareapi_allow_view_without_download" of app "core" is set to "yes" + Then As an "user1" + And User "user1" copies file "/document.odt" to "/copyforbidden.odt" + Then the HTTP status code should be "403" Scenario: Cannot copy a file when its parent is shared view-only + Given As an "admin" + And parameter "shareapi_allow_view_without_download" of app "core" is set to "no" Given user "user0" exists And user "user1" exists And User "user0" created a folder "/sharedviewonly" @@ -1206,5 +1327,10 @@ Feature: sharing And user "user1" accepts last share When User "user1" copies file "/sharedviewonly/document.odt" to "/copyforbidden.odt" Then the HTTP status code should be "403" + Then As an "admin" + And parameter "shareapi_allow_view_without_download" of app "core" is set to "yes" + Then As an "user1" + And User "user1" copies file "/sharedviewonly/document.odt" to "/copyforbidden.odt" + Then the HTTP status code should be "403" # See sharing-v1-part3.feature diff --git a/build/integration/sharing_features/sharing-v1-part3.feature b/build/integration/sharing_features/sharing-v1-part3.feature index 1331d5b2ba6..3c2945e3ad4 100644 --- a/build/integration/sharing_features/sharing-v1-part3.feature +++ b/build/integration/sharing_features/sharing-v1-part3.feature @@ -1,3 +1,5 @@ +# SPDX-FileCopyrightText: 20198 Nextcloud GmbH and Nextcloud contributors +# SPDX-License-Identifier: AGPL-3.0-or-later Feature: sharing Background: Given using api version "1" diff --git a/build/integration/sharing_features/sharing-v1-part4.feature b/build/integration/sharing_features/sharing-v1-part4.feature new file mode 100644 index 00000000000..d138f0a1769 --- /dev/null +++ b/build/integration/sharing_features/sharing-v1-part4.feature @@ -0,0 +1,184 @@ +# SPDX-FileCopyrightText: 2023 Nextcloud GmbH and Nextcloud contributors +# SPDX-License-Identifier: AGPL-3.0-or-later +Feature: sharing + Background: + Given using api version "1" + Given using new dav path + +# See sharing-v1-part3.feature + +Scenario: Creating a new share of a file shows size and mtime + Given user "user0" exists + And user "user1" exists + And As an "user0" + And parameter "shareapi_default_permissions" of app "core" is set to "7" + When creating a share with + | path | welcome.txt | + | shareWith | user1 | + | shareType | 0 | + And the OCS status code should be "100" + And the HTTP status code should be "200" + And Getting info of last share + Then the OCS status code should be "100" + And the HTTP status code should be "200" + And Share fields of last share match with + | item_size | A_NUMBER | + | item_mtime | A_NUMBER | + +Scenario: Creating a new share of a file you own shows the file permissions + Given user "user0" exists + And user "user1" exists + And As an "user0" + And parameter "shareapi_default_permissions" of app "core" is set to "7" + When creating a share with + | path | welcome.txt | + | shareWith | user1 | + | shareType | 0 | + And the OCS status code should be "100" + And the HTTP status code should be "200" + And Getting info of last share + Then the OCS status code should be "100" + And the HTTP status code should be "200" + And Share fields of last share match with + | item_permissions | 27 | + +Scenario: Receiving a share of a file gives no create permission + Given user "user0" exists + And user "user1" exists + And As an "user0" + And parameter "shareapi_default_permissions" of app "core" is set to "31" + And file "welcome.txt" of user "user0" is shared with user "user1" + And sending "GET" to "/apps/files_sharing/api/v1/shares" + And share 0 is returned with + | path | /welcome.txt | + | permissions | 19 | + | item_permissions | 27 | + When As an "user1" + And user "user1" accepts last share + And sending "GET" to "/apps/files_sharing/api/v1/shares?shared_with_me=true" + Then the list of returned shares has 1 shares + And share 0 is returned with + | path | /welcome (2).txt | + | permissions | 19 | + | item_permissions | 27 | + +Scenario: Receiving a share of a folder gives create permission + Given user "user0" exists + And user "user1" exists + And As an "user0" + And parameter "shareapi_default_permissions" of app "core" is set to "31" + And file "PARENT/CHILD" of user "user0" is shared with user "user1" + And sending "GET" to "/apps/files_sharing/api/v1/shares" + And share 0 is returned with + | path | /PARENT/CHILD | + | permissions | 31 | + | item_permissions | 31 | + When As an "user1" + And user "user1" accepts last share + And sending "GET" to "/apps/files_sharing/api/v1/shares?shared_with_me=true" + Then the list of returned shares has 1 shares + And share 0 is returned with + | path | /CHILD | + | permissions | 31 | + | item_permissions | 31 | + +# User can remove itself from a share +Scenario: Receiving a share of a file without delete permission gives delete permission anyway + Given user "user0" exists + And user "user1" exists + And As an "user0" + And parameter "shareapi_default_permissions" of app "core" is set to "23" + And file "welcome.txt" of user "user0" is shared with user "user1" + And sending "GET" to "/apps/files_sharing/api/v1/shares" + And share 0 is returned with + | path | /welcome.txt | + | permissions | 19 | + | item_permissions | 27 | + When As an "user1" + And user "user1" accepts last share + And sending "GET" to "/apps/files_sharing/api/v1/shares?shared_with_me=true" + Then the list of returned shares has 1 shares + And share 0 is returned with + | path | /welcome (2).txt | + | permissions | 19 | + | item_permissions | 27 | + +Scenario: Receiving a share of a file without delete permission gives delete permission anyway + Given user "user0" exists + And user "user1" exists + And As an "user0" + And group "group1" exists + And user "user1" belongs to group "group1" + And parameter "shareapi_default_permissions" of app "core" is set to "23" + And file "welcome.txt" of user "user0" is shared with group "group1" + And sending "GET" to "/apps/files_sharing/api/v1/shares" + And share 0 is returned with + | path | /welcome.txt | + | permissions | 19 | + | item_permissions | 27 | + When As an "user1" + And user "user1" accepts last share + And sending "GET" to "/apps/files_sharing/api/v1/shares?shared_with_me=true" + Then the list of returned shares has 1 shares + And share 0 is returned with + | path | /welcome (2).txt | + | permissions | 19 | + | item_permissions | 27 | + +# This is a regression test as in the past creating a file drop required creating with permissions=5 +# and then afterwards update the share to permissions=4 +Scenario: Directly create link share with CREATE only permissions (file drop) + Given user "user0" exists + And As an "user0" + And user "user0" created a folder "/TMP" + When creating a share with + | path | TMP | + | shareType | 3 | + | permissions | 4 | + And Getting info of last share + Then Share fields of last share match with + | uid_file_owner | user0 | + | share_type | 3 | + | permissions | 4 | + +Scenario: Directly create email share with CREATE only permissions (file drop) + Given user "user0" exists + And As an "user0" + And user "user0" created a folder "/TMP" + When creating a share with + | path | TMP | + | shareType | 4 | + | shareWith | j.doe@example.com | + | permissions | 4 | + And Getting info of last share + Then Share fields of last share match with + | uid_file_owner | user0 | + | share_type | 4 | + | permissions | 4 | + +# This ensures the legacy behavior of sharing v1 is kept +Scenario: publicUpload overrides permissions + Given user "user0" exists + And As an "user0" + And parameter "outgoing_server2server_share_enabled" of app "files_sharing" is set to "no" + And user "user0" created a folder "/TMP" + When creating a share with + | path | TMP | + | shareType | 3 | + | permissions | 4 | + | publicUpload | true | + And Getting info of last share + Then Share fields of last share match with + | uid_file_owner | user0 | + | share_type | 3 | + | permissions | 15 | + When creating a share with + | path | TMP | + | shareType | 3 | + | permissions | 4 | + | publicUpload | false | + And Getting info of last share + Then Share fields of last share match with + | uid_file_owner | user0 | + | share_type | 3 | + | permissions | 1 | diff --git a/build/integration/sharing_features/sharing-v1-video-verification.feature b/build/integration/sharing_features/sharing-v1-video-verification.feature deleted file mode 100644 index cc4be425aab..00000000000 --- a/build/integration/sharing_features/sharing-v1-video-verification.feature +++ /dev/null @@ -1,505 +0,0 @@ -@Talk -Feature: sharing - Background: - Given using api version "1" - Given using old dav path - Given invoking occ with "app:enable --force spreed" - Given the command was successful - - Scenario: Creating a link share with send password by Talk - Given user "user0" exists - And As an "user0" - When creating a share with - | path | welcome.txt | - | shareType | 3 | - | password | secret | - | sendPasswordByTalk | true | - Then the OCS status code should be "100" - And the HTTP status code should be "200" - And last share with password "secret" can be downloaded - - Scenario: Enabling send password by Talk in a link share - Given user "user0" exists - And As an "user0" - When creating a share with - | path | welcome.txt | - | shareType | 3 | - And Updating last share with - | password | secret | - | sendPasswordByTalk | true | - Then the OCS status code should be "100" - And the HTTP status code should be "200" - And last share with password "secret" can be downloaded - - Scenario: Enabling send password by Talk with different password in a link share - Given user "user0" exists - And As an "user0" - When creating a share with - | path | welcome.txt | - | shareType | 3 | - | password | secret | - And Updating last share with - | password | another secret | - | sendPasswordByTalk | true | - Then the OCS status code should be "100" - And the HTTP status code should be "200" - And last share with password "another secret" can be downloaded - - Scenario: Enabling send password by Talk with different password set after creation in a link share - Given user "user0" exists - And As an "user0" - When creating a share with - | path | welcome.txt | - | shareType | 3 | - And Updating last share with - | password | secret | - And Updating last share with - | password | another secret | - | sendPasswordByTalk | true | - Then the OCS status code should be "100" - And the HTTP status code should be "200" - And last share with password "another secret" can be downloaded - - Scenario: Enabling send password by Talk with same password in a link share - Given user "user0" exists - And As an "user0" - When creating a share with - | path | welcome.txt | - | shareType | 3 | - | password | secret | - And Updating last share with - | password | secret | - | sendPasswordByTalk | true | - Then the OCS status code should be "100" - And the HTTP status code should be "200" - And last share with password "secret" can be downloaded - - Scenario: Enabling send password by Talk with same password set after creation in a link share - Given user "user0" exists - And As an "user0" - When creating a share with - | path | welcome.txt | - | shareType | 3 | - And Updating last share with - | password | secret | - And Updating last share with - | password | secret | - | sendPasswordByTalk | true | - Then the OCS status code should be "100" - And the HTTP status code should be "200" - And last share with password "secret" can be downloaded - - Scenario: Enabling send password by Talk without updating password in a link share - Given user "user0" exists - And As an "user0" - When creating a share with - | path | welcome.txt | - | shareType | 3 | - | password | secret | - And Updating last share with - | sendPasswordByTalk | true | - Then the OCS status code should be "100" - And the HTTP status code should be "200" - And last share with password "secret" can be downloaded - - Scenario: Enabling send password by Talk without updating password set after creation in a link share - Given user "user0" exists - And As an "user0" - When creating a share with - | path | welcome.txt | - | shareType | 3 | - And Updating last share with - | password | secret | - And Updating last share with - | sendPasswordByTalk | true | - Then the OCS status code should be "100" - And the HTTP status code should be "200" - And last share with password "secret" can be downloaded - - Scenario: Enabling send password by Talk with no password in a link share - Given user "user0" exists - And As an "user0" - When creating a share with - | path | welcome.txt | - | shareType | 3 | - And Updating last share with - | sendPasswordByTalk | true | - Then the OCS status code should be "400" - And the HTTP status code should be "200" - And last share can be downloaded - - Scenario: Enabling send password by Talk with no password removed after creation in a link share - Given user "user0" exists - And As an "user0" - When creating a share with - | path | welcome.txt | - | shareType | 3 | - | password | secret | - And Updating last share with - | password | | - And Updating last share with - | sendPasswordByTalk | true | - Then the OCS status code should be "400" - And the HTTP status code should be "200" - And last share can be downloaded - - Scenario: Disabling send password by Talk without setting new password in a link share - Given dummy mail server is listening - And user "user0" exists - And As an "user0" - When creating a share with - | path | welcome.txt | - | shareType | 3 | - | password | secret | - | sendPasswordByTalk | true | - And Updating last share with - | sendPasswordByTalk | false | - Then the OCS status code should be "100" - And the HTTP status code should be "200" - And last share with password "secret" can be downloaded - - Scenario: Disabling send password by Talk without setting new password set after creation in a link share - Given dummy mail server is listening - And user "user0" exists - And As an "user0" - When creating a share with - | path | welcome.txt | - | shareType | 3 | - And Updating last share with - | password | secret | - | sendPasswordByTalk | true | - And Updating last share with - | sendPasswordByTalk | false | - Then the OCS status code should be "100" - And the HTTP status code should be "200" - And last share with password "secret" can be downloaded - - Scenario: Disabling send password by Talk setting same password in a link share - Given dummy mail server is listening - And user "user0" exists - And As an "user0" - When creating a share with - | path | welcome.txt | - | shareType | 3 | - | password | secret | - | sendPasswordByTalk | true | - And Updating last share with - | password | secret | - | sendPasswordByTalk | false | - Then the OCS status code should be "100" - And the HTTP status code should be "200" - And last share with password "secret" can be downloaded - - Scenario: Disabling send password by Talk setting same password set after creation in a link share - Given dummy mail server is listening - And user "user0" exists - And As an "user0" - When creating a share with - | path | welcome.txt | - | shareType | 3 | - And Updating last share with - | password | secret | - | sendPasswordByTalk | true | - And Updating last share with - | password | secret | - | sendPasswordByTalk | false | - Then the OCS status code should be "100" - And the HTTP status code should be "200" - And last share with password "secret" can be downloaded - - Scenario: Disabling send password by Talk setting new password in a link share - Given dummy mail server is listening - And user "user0" exists - And As an "user0" - When creating a share with - | path | welcome.txt | - | shareType | 3 | - | password | secret | - | sendPasswordByTalk | true | - And Updating last share with - | password | another secret | - | sendPasswordByTalk | false | - Then the OCS status code should be "100" - And the HTTP status code should be "200" - And last share with password "another secret" can be downloaded - - Scenario: Disabling send password by Talk setting new password set after creation in a link share - Given dummy mail server is listening - And user "user0" exists - And As an "user0" - When creating a share with - | path | welcome.txt | - | shareType | 3 | - And Updating last share with - | password | secret | - | sendPasswordByTalk | true | - And Updating last share with - | password | another secret | - | sendPasswordByTalk | false | - Then the OCS status code should be "100" - And the HTTP status code should be "200" - And last share with password "another secret" can be downloaded - - - - - - Scenario: Creating a mail share with send password by Talk - Given dummy mail server is listening - And user "user0" exists - And As an "user0" - When creating a share with - | path | welcome.txt | - | shareType | 4 | - | shareWith | dummy@test.com | - | password | secret | - | sendPasswordByTalk | true | - Then the OCS status code should be "100" - And the HTTP status code should be "200" - And last share with password "secret" can be downloaded - - Scenario: Enabling send password by Talk in a mail share - Given dummy mail server is listening - And user "user0" exists - And As an "user0" - When creating a share with - | path | welcome.txt | - | shareType | 4 | - | shareWith | dummy@test.com | - And Updating last share with - | password | secret | - | sendPasswordByTalk | true | - Then the OCS status code should be "100" - And the HTTP status code should be "200" - And last share with password "secret" can be downloaded - - Scenario: Enabling send password by Talk with different password in a mail share - Given dummy mail server is listening - And user "user0" exists - And As an "user0" - When creating a share with - | path | welcome.txt | - | shareType | 4 | - | shareWith | dummy@test.com | - | password | secret | - And Updating last share with - | password | another secret | - | sendPasswordByTalk | true | - Then the OCS status code should be "100" - And the HTTP status code should be "200" - And last share with password "another secret" can be downloaded - - Scenario: Enabling send password by Talk with different password set after creation in a mail share - Given dummy mail server is listening - And user "user0" exists - And As an "user0" - When creating a share with - | path | welcome.txt | - | shareType | 4 | - | shareWith | dummy@test.com | - And Updating last share with - | password | secret | - And Updating last share with - | password | another secret | - | sendPasswordByTalk | true | - Then the OCS status code should be "100" - And the HTTP status code should be "200" - And last share with password "another secret" can be downloaded - - Scenario: Enabling send password by Talk with same password in a mail share - Given dummy mail server is listening - And user "user0" exists - And As an "user0" - When creating a share with - | path | welcome.txt | - | shareType | 4 | - | shareWith | dummy@test.com | - | password | secret | - And Updating last share with - | password | secret | - | sendPasswordByTalk | true | - Then the OCS status code should be "400" - And the HTTP status code should be "200" - And last share with password "secret" can be downloaded - - Scenario: Enabling send password by Talk with same password set after creation in a mail share - Given dummy mail server is listening - And user "user0" exists - And As an "user0" - When creating a share with - | path | welcome.txt | - | shareType | 4 | - | shareWith | dummy@test.com | - And Updating last share with - | password | secret | - And Updating last share with - | password | secret | - | sendPasswordByTalk | true | - Then the OCS status code should be "400" - And the HTTP status code should be "200" - And last share with password "secret" can be downloaded - - Scenario: Enabling send password by Talk without updating password in a mail share - Given dummy mail server is listening - And user "user0" exists - And As an "user0" - When creating a share with - | path | welcome.txt | - | shareType | 4 | - | shareWith | dummy@test.com | - | password | secret | - And Updating last share with - | sendPasswordByTalk | true | - Then the OCS status code should be "400" - And the HTTP status code should be "200" - And last share with password "secret" can be downloaded - - Scenario: Enabling send password by Talk without updating password set after creation in a mail share - Given dummy mail server is listening - And user "user0" exists - And As an "user0" - When creating a share with - | path | welcome.txt | - | shareType | 4 | - | shareWith | dummy@test.com | - And Updating last share with - | password | secret | - And Updating last share with - | sendPasswordByTalk | true | - Then the OCS status code should be "400" - And the HTTP status code should be "200" - And last share with password "secret" can be downloaded - - Scenario: Enabling send password by Talk with no password in a mail share - Given dummy mail server is listening - And user "user0" exists - And As an "user0" - When creating a share with - | path | welcome.txt | - | shareType | 4 | - | shareWith | dummy@test.com | - And Updating last share with - | sendPasswordByTalk | true | - Then the OCS status code should be "400" - And the HTTP status code should be "200" - And last share can be downloaded - - Scenario: Enabling send password by Talk with no password removed after creation in a mail share - Given dummy mail server is listening - And user "user0" exists - And As an "user0" - When creating a share with - | path | welcome.txt | - | shareType | 4 | - | shareWith | dummy@test.com | - | password | secret | - And Updating last share with - | password | | - And Updating last share with - | sendPasswordByTalk | true | - Then the OCS status code should be "400" - And the HTTP status code should be "200" - And last share can be downloaded - - Scenario: Disabling send password by Talk without setting new password in a mail share - Given dummy mail server is listening - And user "user0" exists - And As an "user0" - When creating a share with - | path | welcome.txt | - | shareType | 4 | - | shareWith | dummy@test.com | - | password | secret | - | sendPasswordByTalk | true | - And Updating last share with - | sendPasswordByTalk | false | - Then the OCS status code should be "400" - And the HTTP status code should be "200" - And last share with password "secret" can be downloaded - - Scenario: Disabling send password by Talk without setting new password set after creation in a mail share - Given dummy mail server is listening - And user "user0" exists - And As an "user0" - When creating a share with - | path | welcome.txt | - | shareType | 4 | - | shareWith | dummy@test.com | - And Updating last share with - | password | secret | - | sendPasswordByTalk | true | - And Updating last share with - | sendPasswordByTalk | false | - Then the OCS status code should be "400" - And the HTTP status code should be "200" - And last share with password "secret" can be downloaded - - Scenario: Disabling send password by Talk setting same password in a mail share - Given dummy mail server is listening - And user "user0" exists - And As an "user0" - When creating a share with - | path | welcome.txt | - | shareType | 4 | - | shareWith | dummy@test.com | - | password | secret | - | sendPasswordByTalk | true | - And Updating last share with - | password | secret | - | sendPasswordByTalk | false | - Then the OCS status code should be "400" - And the HTTP status code should be "200" - And last share with password "secret" can be downloaded - - Scenario: Disabling send password by Talk setting same password set after creation in a mail share - Given dummy mail server is listening - And user "user0" exists - And As an "user0" - When creating a share with - | path | welcome.txt | - | shareType | 4 | - | shareWith | dummy@test.com | - And Updating last share with - | password | secret | - | sendPasswordByTalk | true | - And Updating last share with - | password | secret | - | sendPasswordByTalk | false | - Then the OCS status code should be "400" - And the HTTP status code should be "200" - And last share with password "secret" can be downloaded - - Scenario: Disabling send password by Talk setting new password in a mail share - Given dummy mail server is listening - And user "user0" exists - And As an "user0" - When creating a share with - | path | welcome.txt | - | shareType | 4 | - | shareWith | dummy@test.com | - | password | secret | - | sendPasswordByTalk | true | - And Updating last share with - | password | another secret | - | sendPasswordByTalk | false | - Then the OCS status code should be "100" - And the HTTP status code should be "200" - And last share with password "another secret" can be downloaded - - Scenario: Disabling send password by Talk setting new password set after creation in a mail share - Given dummy mail server is listening - And user "user0" exists - And As an "user0" - When creating a share with - | path | welcome.txt | - | shareType | 4 | - | shareWith | dummy@test.com | - And Updating last share with - | password | secret | - | sendPasswordByTalk | true | - And Updating last share with - | password | another secret | - | sendPasswordByTalk | false | - Then the OCS status code should be "100" - And the HTTP status code should be "200" - And last share with password "another secret" can be downloaded diff --git a/build/integration/sharing_features/sharing-v1.feature b/build/integration/sharing_features/sharing-v1.feature index ca030bd3a31..25f168db2e7 100644 --- a/build/integration/sharing_features/sharing-v1.feature +++ b/build/integration/sharing_features/sharing-v1.feature @@ -1,3 +1,5 @@ +# SPDX-FileCopyrightText: 2019 Nextcloud GmbH and Nextcloud contributors +# SPDX-License-Identifier: AGPL-3.0-or-later Feature: sharing Background: Given using api version "1" @@ -229,6 +231,62 @@ Feature: sharing | url | AN_URL | | mimetype | httpd/unix-directory | + Scenario: Creating a new share with expiration date empty, when default expiration is set + Given user "user0" exists + And user "user1" exists + And parameter "shareapi_default_internal_expire_date" of app "core" is set to "yes" + And parameter "shareapi_internal_expire_after_n_days" of app "core" is set to "3" + And As an "user0" + When creating a share with + | path | welcome.txt | + | shareWith | user1 | + | shareType | 0 | + | expireDate | | + Then the OCS status code should be "100" + And the HTTP status code should be "200" + And Getting info of last share + Then the OCS status code should be "100" + And the HTTP status code should be "200" + And Share fields of last share match with + | expiration || + + Scenario: Creating a new share with expiration date removed, when default expiration is set + Given user "user0" exists + And user "user1" exists + And parameter "shareapi_default_internal_expire_date" of app "core" is set to "yes" + And parameter "shareapi_internal_expire_after_n_days" of app "core" is set to "3" + And As an "user0" + When creating a share with + | path | welcome.txt | + | shareWith | user1 | + | shareType | 0 | + Then the OCS status code should be "100" + And the HTTP status code should be "200" + And Getting info of last share + Then the OCS status code should be "100" + And the HTTP status code should be "200" + And Share fields of last share match with + | expiration | +3 days | + + Scenario: Creating a new share with expiration date null, when default expiration is set + Given user "user0" exists + And user "user1" exists + And parameter "shareapi_default_internal_expire_date" of app "core" is set to "yes" + And parameter "shareapi_internal_expire_after_n_days" of app "core" is set to "3" + And As an "user0" + When creating a share with + | path | welcome.txt | + | shareWith | user1 | + | shareType | 0 | + | expireDate | null | + Then the OCS status code should be "100" + And the HTTP status code should be "200" + And Getting info of last share + Then the OCS status code should be "100" + And the HTTP status code should be "200" + And Share fields of last share match with + | expiration | +3 days | + Scenario: Creating a new public share, updating its password and getting its info Given user "user0" exists And As an "user0" |