From 9b62a9785711e8912e08ddd5f994e4db6b15c268 Mon Sep 17 00:00:00 2001 From: Viktor Scharf Date: Thu, 18 Dec 2025 14:05:52 +0100 Subject: [PATCH] [full-ci] use graph api in the enforcePasswordPublicLink.feature (#2050) * use graph api in the enforcePasswordPublicLink.feature * delete from expected failures file --- .../acceptance/bootstrap/SharingNgContext.php | 3 + .../expected-failures-without-remotephp.md | 14 - .../enforcePasswordPublicLink.feature | 468 +++++++++++------- .../createPublicLinkShareToShares.feature | 33 -- 4 files changed, 291 insertions(+), 227 deletions(-) delete mode 100644 tests/acceptance/features/coreApiSharePublicLink1/createPublicLinkShareToShares.feature diff --git a/tests/acceptance/bootstrap/SharingNgContext.php b/tests/acceptance/bootstrap/SharingNgContext.php index 6555a27026..7f9be3b011 100644 --- a/tests/acceptance/bootstrap/SharingNgContext.php +++ b/tests/acceptance/bootstrap/SharingNgContext.php @@ -731,6 +731,7 @@ class SharingNgContext implements Context { /** * @When /^user "([^"]*)" creates the following resource link share using the Graph API:$/ + * @When /^user "([^"]*)" tries to create the following resource link share using the Graph API:$/ * * @param string $user * @param TableNode $body @@ -821,6 +822,7 @@ class SharingNgContext implements Context { /** * @When user :user updates the last public link share using the permissions endpoint of the Graph API: + * @When user :user tries to update the last public link share using the permissions endpoint of the Graph API: * * @param string $user * @param TableNode $body @@ -944,6 +946,7 @@ class SharingNgContext implements Context { /** * @When user :user sets the following password for the last link share using the Graph API: + * @When user :user tries to set the following password for the last link share using the Graph API: * * @param string $user * @param TableNode $body diff --git a/tests/acceptance/expected-failures-without-remotephp.md b/tests/acceptance/expected-failures-without-remotephp.md index 6543d63779..f95ac80d79 100644 --- a/tests/acceptance/expected-failures-without-remotephp.md +++ b/tests/acceptance/expected-failures-without-remotephp.md @@ -124,20 +124,6 @@ #### [Downloading public files without remote.php returns 401 unauthorized error](https://github.com/owncloud/ocis/issues/9724) -- [apiGraph/enforcePasswordPublicLink.feature:79](https://github.com/opencloud-eu/opencloud/blob/main/tests/acceptance/features/apiGraph/enforcePasswordPublicLink.feature#L79) -- [apiGraph/enforcePasswordPublicLink.feature:80](https://github.com/opencloud-eu/opencloud/blob/main/tests/acceptance/features/apiGraph/enforcePasswordPublicLink.feature#L80) -- [apiGraph/enforcePasswordPublicLink.feature:107](https://github.com/opencloud-eu/opencloud/blob/main/tests/acceptance/features/apiGraph/enforcePasswordPublicLink.feature#L107) -- [apiGraph/enforcePasswordPublicLink.feature:108](https://github.com/opencloud-eu/opencloud/blob/main/tests/acceptance/features/apiGraph/enforcePasswordPublicLink.feature#L108) -- [apiGraph/enforcePasswordPublicLink.feature:171](https://github.com/opencloud-eu/opencloud/blob/main/tests/acceptance/features/apiGraph/enforcePasswordPublicLink.feature#L171) -- [apiGraph/enforcePasswordPublicLink.feature:172](https://github.com/opencloud-eu/opencloud/blob/main/tests/acceptance/features/apiGraph/enforcePasswordPublicLink.feature#L172) -- [apiGraph/enforcePasswordPublicLink.feature:229](https://github.com/opencloud-eu/opencloud/blob/main/tests/acceptance/features/apiGraph/enforcePasswordPublicLink.feature#L229) -- [apiGraph/enforcePasswordPublicLink.feature:230](https://github.com/opencloud-eu/opencloud/blob/main/tests/acceptance/features/apiGraph/enforcePasswordPublicLink.feature#L230) -- [apiGraph/enforcePasswordPublicLink.feature:231](https://github.com/opencloud-eu/opencloud/blob/main/tests/acceptance/features/apiGraph/enforcePasswordPublicLink.feature#L231) -- [apiGraph/enforcePasswordPublicLink.feature:232](https://github.com/opencloud-eu/opencloud/blob/main/tests/acceptance/features/apiGraph/enforcePasswordPublicLink.feature#L232) -- [apiGraph/enforcePasswordPublicLink.feature:233](https://github.com/opencloud-eu/opencloud/blob/main/tests/acceptance/features/apiGraph/enforcePasswordPublicLink.feature#L233) -- [apiGraph/enforcePasswordPublicLink.feature:234](https://github.com/opencloud-eu/opencloud/blob/main/tests/acceptance/features/apiGraph/enforcePasswordPublicLink.feature#L234) -- [apiGraph/enforcePasswordPublicLink.feature:235](https://github.com/opencloud-eu/opencloud/blob/main/tests/acceptance/features/apiGraph/enforcePasswordPublicLink.feature#L235) -- [apiGraph/enforcePasswordPublicLink.feature:236](https://github.com/opencloud-eu/opencloud/blob/main/tests/acceptance/features/apiGraph/enforcePasswordPublicLink.feature#L236) - [apiSpaces/editPublicLinkOfSpace.feature:48](https://github.com/opencloud-eu/opencloud/blob/main/tests/acceptance/features/apiSpaces/editPublicLinkOfSpace.feature#L48) - [apiSpaces/editPublicLinkOfSpace.feature:49](https://github.com/opencloud-eu/opencloud/blob/main/tests/acceptance/features/apiSpaces/editPublicLinkOfSpace.feature#L49) - [apiSpacesShares/publicLinkDownload.feature:16](https://github.com/opencloud-eu/opencloud/blob/main/tests/acceptance/features/apiSpacesShares/publicLinkDownload.feature#L16) diff --git a/tests/acceptance/features/apiGraph/enforcePasswordPublicLink.feature b/tests/acceptance/features/apiGraph/enforcePasswordPublicLink.feature index 078523f134..349d6ae25c 100644 --- a/tests/acceptance/features/apiGraph/enforcePasswordPublicLink.feature +++ b/tests/acceptance/features/apiGraph/enforcePasswordPublicLink.feature @@ -12,136 +12,207 @@ Feature: enforce password on public link | OC_PASSWORD_POLICY_MIN_DIGITS | 1 | | OC_PASSWORD_POLICY_MIN_SPECIAL_CHARACTERS | 1 | - - Scenario Outline: create a public link with edit permission without a password when enforce-password is enabled - Given the following configs have been set: - | config | value | - | OC_SHARING_PUBLIC_SHARE_MUST_HAVE_PASSWORD | false | - | OC_SHARING_PUBLIC_WRITEABLE_SHARE_MUST_HAVE_PASSWORD | true | + Background: And user "Alice" has been created with default attributes And user "Alice" has uploaded file with content "test file" to "/testfile.txt" - And using OCS API version "" - When user "Alice" creates a public link share using the sharing API with settings - | path | /testfile.txt | - | permissions | 3 | - Then the HTTP status code should be "" - And the OCS status code should be "400" - And the OCS status message should be "missing required password" + + + Scenario Outline: create a public link without a password when enforce-password for writable share is enabled + Given the following configs have been set: + | config | value | + | OC_SHARING_PUBLIC_SHARE_MUST_HAVE_PASSWORD | false | + | OC_SHARING_PUBLIC_WRITEABLE_SHARE_MUST_HAVE_PASSWORD | true | + When user "Alice" creates the following resource link share using the Graph API: + | resource | testfile.txt | + | space | Personal | + | permissionsRole | | + Then the HTTP status code should be "" Examples: - | ocs-api-version | http-status-code | - | 1 | 200 | - | 2 | 400 | + | permissions-role | status-code | + | view | 200 | + | edit | 400 | - Scenario Outline: create a public link with viewer permission without a password when enforce-password is enabled + Scenario: try to update a public link to edit permission without a password Given the following configs have been set: - | config | value | + | config | value | | OC_SHARING_PUBLIC_SHARE_MUST_HAVE_PASSWORD | false | | OC_SHARING_PUBLIC_WRITEABLE_SHARE_MUST_HAVE_PASSWORD | true | - And user "Alice" has been created with default attributes - And user "Alice" has uploaded file with content "test file" to "/testfile.txt" - And using OCS API version "" - When user "Alice" creates a public link share using the sharing API with settings - | path | /testfile.txt | - | permissions | 1 | - Then the OCS status code should be "" - And the HTTP status code should be "200" - Examples: - | ocs-api-version | ocs-status-code | - | 1 | 100 | - | 2 | 200 | - - @issue-9724 @issue-10331 - Scenario Outline: updates a public link to edit permission with a password - Given the following configs have been set: - | config | value | - | OC_SHARING_PUBLIC_SHARE_MUST_HAVE_PASSWORD | false | - | OC_SHARING_PUBLIC_WRITEABLE_SHARE_MUST_HAVE_PASSWORD | true | - And user "Alice" has been created with default attributes - And user "Alice" has uploaded file with content "test file" to "/testfile.txt" - And using OCS API version "" - And using SharingNG And user "Alice" has created the following resource link share: | resource | testfile.txt | | space | Personal | | permissionsRole | view | - When user "Alice" updates the last public link share using the sharing API with - | permissions | 3 | - | password | %public% | + When user "Alice" tries to update the last public link share using the permissions endpoint of the Graph API: + | resource | testfile.txt | + | space | Personal | + | permissionsRole | edit | + Then the HTTP status code should be "400" + And the JSON data of the response should match + """ + { + "type": "object", + "required": [ + "error" + ], + "properties": { + "error": { + "type": "object", + "required": [ + "code", + "message" + ], + "properties": { + "code": { + "type": "string", + "pattern": "invalidRequest" + }, + "message": { + "const": "password protection is enforced" + } + } + } + } + } + """ + + @issue-2048 + Scenario: update a public link to edit permission. Need set pasword first + Given the following configs have been set: + | config | value | + | OC_SHARING_PUBLIC_SHARE_MUST_HAVE_PASSWORD | false | + | OC_SHARING_PUBLIC_WRITEABLE_SHARE_MUST_HAVE_PASSWORD | true | + And user "Alice" has created the following resource link share: + | resource | testfile.txt | + | space | Personal | + | permissionsRole | view | + When user "Alice" sets the following password for the last link share using the Graph API: + | resource | testfile.txt | + | space | Personal | + | password | %public% | Then the HTTP status code should be "200" - And the OCS status code should be "" - And the OCS status message should be "OK" - And the public should not be able to download file "/testfile.txt" from inside the last public link shared folder using the public WebDAV API without a password - And the public should not be able to download file "/testfile.txt" from inside the last public link shared folder using the public WebDAV API with password "wrong pass" - But the public should be able to download file "/testfile.txt" from inside the last public link shared folder using the public WebDAV API with password "%public%" - Examples: - | ocs-api-version | ocs-status-code | - | 1 | 100 | - | 2 | 200 | + And user "Alice" updates the last public link share using the permissions endpoint of the Graph API: + | resource | testfile.txt | + | space | Personal | + | permissionsRole | edit | + And the HTTP status code should be "200" + And the JSON data of the response should match + """ + { + "type": "object", + "required": [ + "hasPassword", + "link" + ], + "properties": { + "hasPassword": { "const": true }, + "link": { + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { "const": "edit" } + } + } + } + } + """ @issue-9724 @issue-10331 - Scenario Outline: create a public link with a password in accordance with the password policy + Scenario: create a public link with a password in accordance with the password policy Given the following configs have been set: - | config | value | + | config | value | | OC_SHARING_PUBLIC_WRITEABLE_SHARE_MUST_HAVE_PASSWORD | true | | OC_PASSWORD_POLICY_MIN_CHARACTERS | 13 | | OC_PASSWORD_POLICY_MIN_LOWERCASE_CHARACTERS | 3 | | OC_PASSWORD_POLICY_MIN_UPPERCASE_CHARACTERS | 2 | | OC_PASSWORD_POLICY_MIN_DIGITS | 2 | | OC_PASSWORD_POLICY_MIN_SPECIAL_CHARACTERS | 2 | - And user "Alice" has been created with default attributes - And user "Alice" has uploaded file with content "test file" to "/testfile.txt" - And using OCS API version "" - When user "Alice" creates a public link share using the sharing API with settings - | path | /testfile.txt | - | permissions | 3 | - | password | 3s:5WW9uE5h=A | + When user "Alice" creates the following resource link share using the Graph API: + | resource | testfile.txt | + | space | Personal | + | permissionsRole | edit | + | password | 3s:5WW9uE5h=A | Then the HTTP status code should be "200" - And the OCS status code should be "" - And the OCS status message should be "OK" - And the public should not be able to download file "/testfile.txt" from inside the last public link shared folder using the public WebDAV API without a password - And the public should not be able to download file "/testfile.txt" from inside the last public link shared folder using the public WebDAV API with password "wrong pass" - But the public should be able to download file "/testfile.txt" from inside the last public link shared folder using the public WebDAV API with password "3s:5WW9uE5h=A" - Examples: - | ocs-api-version | ocs-status-code | - | 1 | 100 | - | 2 | 200 | + And the JSON data of the response should match + """ + { + "type": "object", + "required": [ + "hasPassword", + "id", + "link" + ], + "properties": { + "hasPassword": { "const": true }, + "id": { + "type": "string", + "pattern": "^[a-zA-Z]{15}$" + }, + "link": { + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { "const": "edit" } + } + } + } + } + """ - Scenario Outline: try to create a public link with a password that does not comply with the password policy + Scenario: try to create a public link with a password that does not comply with the password policy Given the following configs have been set: - | config | value | + | config | value | | OC_PASSWORD_POLICY_MIN_CHARACTERS | 13 | | OC_PASSWORD_POLICY_MIN_LOWERCASE_CHARACTERS | 3 | | OC_PASSWORD_POLICY_MIN_UPPERCASE_CHARACTERS | 2 | | OC_PASSWORD_POLICY_MIN_DIGITS | 2 | | OC_PASSWORD_POLICY_MIN_SPECIAL_CHARACTERS | 2 | - And user "Alice" has been created with default attributes - And user "Alice" has uploaded file with content "test file" to "/testfile.txt" - And using OCS API version "" - When user "Alice" creates a public link share using the sharing API with settings - | path | /testfile.txt | - | permissions | 3 | - | password | Pas1 | - Then the HTTP status code should be "" - And the OCS status code should be "400" - And the OCS status message should be: + When user "Alice" tries to create the following resource link share using the Graph API: + | space | Personal | + | resource | testfile.txt | + | permissionsRole | edit | + | password | Pas1 | + Then the HTTP status code should be "400" + And the JSON data of the response should match """ - At least 13 characters are required - at least 3 lowercase letters are required - at least 2 uppercase letters are required - at least 2 numbers are required - at least 2 special characters are required !"#$%&'()*+,-./:;<=>?@[\]^_`{|}~ + { + "type": "object", + "required": ["error"], + "properties": { + "error": { + "type": "object", + "required": [ + "code", + "innererror", + "message" + ], + "properties": { + "code": { "const": "invalidRequest" }, + "innererror": { + "type": "object", + "required": [ + "date", + "request-id" + ] + }, + "message": { + "type": "string", + "pattern": "at least 13 characters are required\\s+at least 3 lowercase letters are required\\s+at least 2 uppercase letters are required\\s+at least 2 numbers are required\\s+at least 2 special characters are required\\s+[!\"#$%&'()*+,\\-./:;<=>?@\\[\\\\\\]^_`{|}~]+" + } + } + } + } + } """ - Examples: - | ocs-api-version | http-status-code | - | 1 | 200 | - | 2 | 400 | @issue-9724 @issue-10331 - Scenario Outline: update a public link with a password in accordance with the password policy + Scenario: update a public link with a password in accordance with the password policy Given the following configs have been set: - | config | value | + | config | value | | OC_SHARING_PUBLIC_SHARE_MUST_HAVE_PASSWORD | false | | OC_SHARING_PUBLIC_WRITEABLE_SHARE_MUST_HAVE_PASSWORD | true | | OC_PASSWORD_POLICY_MIN_CHARACTERS | 13 | @@ -149,32 +220,30 @@ Feature: enforce password on public link | OC_PASSWORD_POLICY_MIN_UPPERCASE_CHARACTERS | 2 | | OC_PASSWORD_POLICY_MIN_DIGITS | 1 | | OC_PASSWORD_POLICY_MIN_SPECIAL_CHARACTERS | 2 | - And user "Alice" has been created with default attributes - And user "Alice" has uploaded file with content "test file" to "/testfile.txt" - And using OCS API version "" - And using SharingNG And user "Alice" has created the following resource link share: | resource | testfile.txt | | space | Personal | | permissionsRole | view | - When user "Alice" updates the last public link share using the sharing API with - | permissions | 3 | - | password | 6a0Q;A3 +i^m[ | + When user "Alice" sets the following password for the last link share using the Graph API: + | resource | testfile.txt | + | space | Personal | + | password | 6a0Q;A3 +i^m[ | Then the HTTP status code should be "200" - And the OCS status code should be "" - And the OCS status message should be "OK" - And the public should not be able to download file "/testfile.txt" from inside the last public link shared folder using the public WebDAV API without a password - And the public should not be able to download file "/testfile.txt" from inside the last public link shared folder using the public WebDAV API with password "wrong pass" - But the public should be able to download file "/testfile.txt" from inside the last public link shared folder using the public WebDAV API with password "6a0Q;A3 +i^m[" - Examples: - | ocs-api-version | ocs-status-code | - | 1 | 100 | - | 2 | 200 | + And the JSON data of the response should match + """ + { + "type": "object", + "required": [ "hasPassword" ], + "properties": { + "hasPassword": { "const": true } + } + } + """ Scenario Outline: try to update a public link with a password that does not comply with the password policy Given the following configs have been set: - | config | value | + | config | value | | OC_SHARING_PUBLIC_SHARE_MUST_HAVE_PASSWORD | false | | OC_SHARING_PUBLIC_WRITEABLE_SHARE_MUST_HAVE_PASSWORD | true | | OC_PASSWORD_POLICY_MIN_CHARACTERS | 13 | @@ -182,8 +251,6 @@ Feature: enforce password on public link | OC_PASSWORD_POLICY_MIN_UPPERCASE_CHARACTERS | 2 | | OC_PASSWORD_POLICY_MIN_DIGITS | 1 | | OC_PASSWORD_POLICY_MIN_SPECIAL_CHARACTERS | 2 | - And user "Alice" has been created with default attributes - And user "Alice" has uploaded file with content "test file" to "/testfile.txt" And using OCS API version "" And using SharingNG And user "Alice" has created the following resource link share: @@ -193,39 +260,42 @@ Feature: enforce password on public link When user "Alice" updates the last public link share using the sharing API with | permissions | 3 | | password | Pws^ | - Then the HTTP status code should be "" - And the OCS status code should be "400" - And the OCS status message should be: + And user "Alice" tries to set the following password for the last link share using the Graph API: + | resource | testfile.txt | + | space | Personal | + | password | Pws^ | + Then the HTTP status code should be "400" + And the JSON data of the response should match """ - At least 13 characters are required - at least 3 lowercase letters are required - at least 2 uppercase letters are required - at least 1 numbers are required - at least 2 special characters are required !"#$%&'()*+,-./:;<=>?@[\]^_`{|}~ + { + "type": "object", + "required": [ "error" ], + "properties": { + "error": { + "type": "object", + "required": [ "message" ], + "properties": { + "message": { + "type": "string", + "pattern": "at least 13 characters are required\\s+at least 3 lowercase letters are required\\s+at least 2 uppercase letters are required\\s+at least 1 numbers are required\\s+at least 2 special characters are required\\s+[!\"#$%&'()*+,\\-./:;<=>?@\\[\\\\\\]^_`{|}~]+" + } + } + } + } + } """ - Examples: - | ocs-api-version | http-status-code | - | 1 | 200 | - | 2 | 400 | @issue-9724 @issue-10331 Scenario Outline: create a public link with a password in accordance with the password policy (valid cases) Given the config "" has been set to "" - And using OCS API version "2" - And user "Alice" has been created with default attributes - And user "Alice" has uploaded file with content "test file" to "/testfile.txt" - When user "Alice" creates a public link share using the sharing API with settings - | path | /testfile.txt | - | permissions | 1 | - | password | | + When user "Alice" creates the following resource link share using the Graph API: + | space | Personal | + | resource | testfile.txt | + | permissionsRole | view | + | password | | Then the HTTP status code should be "200" - And the OCS status code should be "200" - And the OCS status message should be "OK" - And the public should not be able to download file "/testfile.txt" from inside the last public link shared folder using the public WebDAV API without a password - And the public should not be able to download file "/testfile.txt" from inside the last public link shared folder using the public WebDAV API with password "wrong pass" - But the public should be able to download file "/testfile.txt" from inside the last public link shared folder using the public WebDAV API with password "" Examples: - | config | config-value | password | + | config | config-value | password | | OC_PASSWORD_POLICY_MIN_CHARACTERS | 4 | Ps-1 | | OC_PASSWORD_POLICY_MIN_CHARACTERS | 14 | Ps1:with space | | OC_PASSWORD_POLICY_MIN_LOWERCASE_CHARACTERS | 4 | PS1:test | @@ -237,61 +307,99 @@ Feature: enforce password on public link Scenario Outline: try to create a public link with a password that does not comply with the password policy (invalid cases) - Given using OCS API version "2" - And user "Alice" has been created with default attributes - And user "Alice" has uploaded file with content "test file" to "/testfile.txt" - When user "Alice" creates a public link share using the sharing API with settings - | path | /testfile.txt | - | permissions | 3 | - | password | | + When user "Alice" tries to create the following resource link share using the Graph API: + | space | Personal | + | resource | testfile.txt | + | permissionsRole | view | + | password | | Then the HTTP status code should be "400" - And the OCS status code should be "400" - And the OCS status message should be "" + And the JSON data of the response should match + """ + { + "type": "object", + "required": [ "error" ], + "properties": { + "error": { + "type": "object", + "required": [ "message" ], + "properties": { + "message": { + "const": "" + } + } + } + } + } + """ Examples: | password | message | - | 1Pw: | At least 8 characters are required | - | 1P:12345 | At least 1 lowercase letters are required | - | test-123 | At least 1 uppercase letters are required | - | Test-psw | At least 1 numbers are required | + | 1Pw: | at least 8 characters are required | + | 1P:12345 | at least 1 lowercase letters are required | + | test-123 | at least 1 uppercase letters are required | + | Test-psw | at least 1 numbers are required | Scenario Outline: update a public link with a password that is listed in the Banned-Password-List Given the config "OC_PASSWORD_POLICY_BANNED_PASSWORDS_LIST" has been set to path "config/woodpecker/banned-password-list.txt" - And using OCS API version "2" - And user "Alice" has been created with default attributes - And user "Alice" has uploaded file with content "test file" to "/testfile.txt" - And using SharingNG And user "Alice" has created the following resource link share: | resource | testfile.txt | | space | Personal | - | permissionsRole | internal | - When user "Alice" updates the last public link share using the sharing API with - | permissions | 3 | - | password | | - Then the HTTP status code should be "" - And the OCS status code should be "" - And the OCS status message should be "" + | permissionsRole | view | + | password | %public% | + And user "Alice" tries to set the following password for the last link share using the Graph API: + | resource | testfile.txt | + | space | Personal | + | password | | + Then the HTTP status code should be "400" + And the JSON data of the response should match + """ + { + "type": "object", + "required": [ "error" ], + "properties": { + "error": { + "type": "object", + "required": [ "message" ], + "properties": { + "message": { "const": "" } + } + } + } + } + """ Examples: - | password | http-status-code | ocs-status-code | message | - | 123 | 400 | 400 | Unfortunately, your password is commonly used. please pick a harder-to-guess password for your safety | - | password | 400 | 400 | Unfortunately, your password is commonly used. please pick a harder-to-guess password for your safety | - | OpenCloud | 400 | 400 | Unfortunately, your password is commonly used. please pick a harder-to-guess password for your safety | + | password | message | + | 123 | unfortunately, your password is commonly used. please pick a harder-to-guess password for your safety | + | password | unfortunately, your password is commonly used. please pick a harder-to-guess password for your safety | + | OpenCloud | unfortunately, your password is commonly used. please pick a harder-to-guess password for your safety | Scenario Outline: create a public link with a password that is listed in the Banned-Password-List Given the config "OC_PASSWORD_POLICY_BANNED_PASSWORDS_LIST" has been set to path "config/woodpecker/banned-password-list.txt" - And using OCS API version "2" - And user "Alice" has been created with default attributes - And user "Alice" has uploaded file with content "test file" to "/testfile.txt" - When user "Alice" creates a public link share using the sharing API with settings - | path | /testfile.txt | - | permissions | 3 | - | password | | - Then the HTTP status code should be "" - And the OCS status code should be "" - And the OCS status message should be "" + When user "Alice" tries to create the following resource link share using the Graph API: + | space | Personal | + | resource | testfile.txt | + | permissionsRole | view | + | password | | + Then the HTTP status code should be "400" + And the JSON data of the response should match + """ + { + "type": "object", + "required": [ "error" ], + "properties": { + "error": { + "type": "object", + "required": [ "message" ], + "properties": { + "message": { "const": "" } + } + } + } + } + """ Examples: - | password | http-status-code | ocs-status-code | message | - | 123 | 400 | 400 | Unfortunately, your password is commonly used. please pick a harder-to-guess password for your safety | - | password | 400 | 400 | Unfortunately, your password is commonly used. please pick a harder-to-guess password for your safety | - | OpenCloud | 400 | 400 | Unfortunately, your password is commonly used. please pick a harder-to-guess password for your safety | + | password | message | + | 123 | unfortunately, your password is commonly used. please pick a harder-to-guess password for your safety | + | password | unfortunately, your password is commonly used. please pick a harder-to-guess password for your safety | + | OpenCloud | unfortunately, your password is commonly used. please pick a harder-to-guess password for your safety | diff --git a/tests/acceptance/features/coreApiSharePublicLink1/createPublicLinkShareToShares.feature b/tests/acceptance/features/coreApiSharePublicLink1/createPublicLinkShareToShares.feature deleted file mode 100644 index 415809dc3e..0000000000 --- a/tests/acceptance/features/coreApiSharePublicLink1/createPublicLinkShareToShares.feature +++ /dev/null @@ -1,33 +0,0 @@ -Feature: create a public link share when share_folder is set to Shares - As a user - I want to create public links - So that I can share resources to people who aren't OpenCloud users - - Background: - Given user "Alice" has been created with default attributes - - - Scenario Outline: creating a new public link share of a file gives the correct response - Given using OCS API version "" - And user "Alice" has uploaded file with content "Random data" to "/randomfile.txt" - When user "Alice" creates a public link share using the sharing API with settings - | path | randomfile.txt | - | password | %public% | - Then the OCS status code should be "" - 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 | /randomfile.txt | - | path | /randomfile.txt | - | permissions | read | - | share_type | public_link | - | displayname_file_owner | %displayname% | - | displayname_owner | %displayname% | - | uid_file_owner | %username% | - | uid_owner | %username% | - | name | | - Examples: - | ocs-api-version | ocs-status-code | - | 1 | 100 | - | 2 | 200 |