Skip to content

Commit

Permalink
added steps for update public link with password with password enforc…
Browse files Browse the repository at this point in the history
…e enabled
  • Loading branch information
PrajwolAmatya committed Jun 14, 2023
1 parent d2dc2f6 commit 24f36bc
Showing 1 changed file with 20 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,32 +5,44 @@ Feature: enforce password on public link
So that the password is required to access the contents of the link

Background:
Given using OCS API version "2"
Given the config "OCIS_SHARING_PUBLIC_WRITEABLE_SHARE_MUST_HAVE_PASSWORD" has been set to "true"
And these users have been created with default attributes and without skeleton files:
| username |
| Alice |
And user "Alice" has uploaded file with content "test file" to "/testfile.txt"


Scenario: user tries to update a public link to edit permission without a password when enforce-password is enabled
Given user "Alice" has created a public link share with settings
Scenario Outline: user tries to update a public link to edit permission without a password
Given using OCS API version "<ocs-api-version>"
And user "Alice" has created a public link share with settings
| path | /testfile.txt |
| permissions | 1 |
When user "Alice" updates the last public link share using the sharing API with
| permissions | 3 |
Then the HTTP status code should be "200"
Then the OCS status code should be "996"
Then the HTTP status code should be "<http-code>"
Then the OCS status code should be "<ocs-code>"
And the OCS status message should be "Error sending update request to public link provider: the public share needs to have a password"
Examples:
| ocs-api-version | ocs-code | http-code |
| 1 | 996 | 200 |
| 2 | 996 | 500 |


Scenario: user tries to update a public link to edit permission with a password when enforce-password is enabled
Given user "Alice" has created a public link share with settings
Scenario Outline: user updates a public link to edit permission with a password
Given using OCS API version "<ocs-api-version>"
And user "Alice" has created a public link share with settings
| path | /testfile.txt |
| permissions | 1 |
When user "Alice" updates the last public link share using the sharing API with
| permissions | 3 |
| password | testpassword |
Then the HTTP status code should be "200"
And the OCS status code should be "100"
And the OCS status code should be "<ocs-code>"
And the OCS status message should be "OK"
And the public should not be able to download file "/textfile.txt" from inside the last public link shared folder using the new public WebDAV API without a password
And the public should not be able to download file "/textfile.txt" from inside the last public link shared folder using the new public WebDAV API with password "wrong pass"
But the public should be able to download file "/textfile.txt" from inside the last public link shared folder using the new public WebDAV API with password "testpassword"
Examples:
| ocs-api-version | ocs-code |
| 1 | 100 |
| 2 | 200 |

0 comments on commit 24f36bc

Please sign in to comment.