2023-08-16 09:29:00 +05:45
@env-config
2023-06-22 14:25:45 +05:45
Feature: enforce password on public link
2023-11-13 23:37:12 +01:00
As a user
I want to enforce passwords on public links shared with upload, edit, or contribute permission
So that the password is required to access the contents of the link
Password requirements. set by default:
| OCIS_SHARING_PUBLIC_SHARE_MUST_HAVE_PASSWORD | true |
2023-12-06 10:35:25 +01:00
| OCIS_PASSWORD_POLICY_MIN_CHARACTERS | 8 |
| OCIS_PASSWORD_POLICY_MIN_LOWERCASE_CHARACTERS | 1 |
| OCIS_PASSWORD_POLICY_MIN_UPPERCASE_CHARACTERS | 1 |
| OCIS_PASSWORD_POLICY_MIN_DIGITS | 1 |
| OCIS_PASSWORD_POLICY_MIN_SPECIAL_CHARACTERS | 1 |
2023-11-13 23:37:12 +01:00
2023-06-22 14:25:45 +05:45
2023-09-18 10:21:35 +02:00
Scenario Outline: create a public link with edit permission without a password when enforce-password is enabled
2023-11-13 23:37:12 +01:00
Given the following configs have been set:
| config | value |
| OCIS_SHARING_PUBLIC_SHARE_MUST_HAVE_PASSWORD | false |
| OCIS_SHARING_PUBLIC_WRITEABLE_SHARE_MUST_HAVE_PASSWORD | true |
2023-09-18 10:21:35 +02:00
And user " Alice " has been created with default attributes and without skeleton files
2023-06-22 14:25:45 +05:45
And user " Alice " has uploaded file with content " test file " to " /testfile.txt "
2023-09-18 10:21:35 +02:00
And using OCS API version " <ocs-api-version> "
2023-06-22 14:25:45 +05:45
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 " <http-code> "
2023-08-22 16:14:36 +05:45
And the OCS status code should be " 400 "
2023-06-22 14:25:45 +05:45
And the OCS status message should be " missing required password "
Examples:
| ocs-api-version | http-code |
| 1 | 200 |
| 2 | 400 |
2023-11-13 23:37:12 +01:00
Scenario Outline: create a public link with viewer permission without a password when enforce-password is enabled
Given the following configs have been set:
| config | value |
| OCIS_SHARING_PUBLIC_SHARE_MUST_HAVE_PASSWORD | false |
| OCIS_SHARING_PUBLIC_WRITEABLE_SHARE_MUST_HAVE_PASSWORD | true |
2023-10-20 17:55:36 +02:00
And user " Alice " has been created with default attributes and without skeleton files
And user " Alice " has uploaded file with content " test file " to " /testfile.txt "
And using OCS API version " <ocs-api-version> "
When user " Alice " creates a public link share using the sharing API with settings
| path | /testfile.txt |
| permissions | 1 |
2023-11-13 23:37:12 +01:00
Then the OCS status code should be " <ocs_status_code> "
And the HTTP status code should be " 200 "
2023-10-20 17:55:36 +02:00
Examples:
2023-11-13 23:37:12 +01:00
| ocs-api-version | ocs_status_code |
| 1 | 100 |
| 2 | 200 |
2023-10-20 17:55:36 +02:00
2023-06-22 14:25:45 +05:45
Scenario Outline: updates a public link to edit permission with a password
2023-11-13 23:37:12 +01:00
Given the following configs have been set:
| config | value |
| OCIS_SHARING_PUBLIC_SHARE_MUST_HAVE_PASSWORD | false |
| OCIS_SHARING_PUBLIC_WRITEABLE_SHARE_MUST_HAVE_PASSWORD | true |
2023-09-18 10:21:35 +02:00
And user " Alice " has been created with default attributes and without skeleton files
And user " Alice " has uploaded file with content " test file " to " /testfile.txt "
And using OCS API version " <ocs-api-version> "
2023-06-22 14:25:45 +05:45
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
2023-11-13 23:37:12 +01:00
| permissions | 3 |
| password | %public% |
2023-06-22 14:25:45 +05:45
Then the HTTP status code should be " 200 "
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 "
2023-11-13 23:37:12 +01:00
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 " %public% "
2023-06-22 14:25:45 +05:45
Examples:
| ocs-api-version | ocs-code |
| 1 | 100 |
| 2 | 200 |
2023-09-18 10:21:35 +02:00
Scenario Outline: create a public link with a password in accordance with the password policy
Given the following configs have been set:
| config | value |
| OCIS_SHARING_PUBLIC_WRITEABLE_SHARE_MUST_HAVE_PASSWORD | true |
2023-12-06 10:35:25 +01:00
| OCIS_PASSWORD_POLICY_MIN_CHARACTERS | 13 |
| OCIS_PASSWORD_POLICY_MIN_LOWERCASE_CHARACTERS | 3 |
| OCIS_PASSWORD_POLICY_MIN_UPPERCASE_CHARACTERS | 2 |
| OCIS_PASSWORD_POLICY_MIN_DIGITS | 2 |
| OCIS_PASSWORD_POLICY_MIN_SPECIAL_CHARACTERS | 2 |
2023-09-18 10:21:35 +02:00
And user " Alice " has been created with default attributes and without skeleton files
And user " Alice " has uploaded file with content " test file " to " /testfile.txt "
And using OCS API version " <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 |
Then the HTTP status code should be " 200 "
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 " 3s:5WW9uE5h=A "
Examples:
| ocs-api-version | ocs-code |
| 1 | 100 |
| 2 | 200 |
Scenario Outline: try to create a public link with a password that does not comply with the password policy
Given the following configs have been set:
2023-11-13 23:37:12 +01:00
| config | value |
2023-12-06 10:35:25 +01:00
| OCIS_PASSWORD_POLICY_MIN_CHARACTERS | 13 |
| OCIS_PASSWORD_POLICY_MIN_LOWERCASE_CHARACTERS | 3 |
| OCIS_PASSWORD_POLICY_MIN_UPPERCASE_CHARACTERS | 2 |
| OCIS_PASSWORD_POLICY_MIN_DIGITS | 2 |
| OCIS_PASSWORD_POLICY_MIN_SPECIAL_CHARACTERS | 2 |
2023-09-18 10:21:35 +02:00
And user " Alice " has been created with default attributes and without skeleton files
And user " Alice " has uploaded file with content " test file " to " /testfile.txt "
And using OCS API version " <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 " <http-code> "
And the OCS status code should be " 400 "
2023-09-21 12:31:48 +02:00
And the OCS status message should be:
2023-09-25 11:50:34 +02:00
"""
2023-09-26 14:11:21 +02:00
At least 13 characters are required
2023-09-26 16:37:44 +02:00
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 !"#$%&'()*+,-./:; <=> ?@[\]^_`{|}~
2023-09-25 11:50:34 +02:00
"""
2023-09-18 10:21:35 +02:00
Examples:
| ocs-api-version | http-code |
| 1 | 200 |
| 2 | 400 |
Scenario Outline: update a public link with a password in accordance with the password policy
Given the following configs have been set:
| config | value |
2023-11-13 23:37:12 +01:00
| OCIS_SHARING_PUBLIC_SHARE_MUST_HAVE_PASSWORD | false |
2023-09-18 10:21:35 +02:00
| OCIS_SHARING_PUBLIC_WRITEABLE_SHARE_MUST_HAVE_PASSWORD | true |
2023-12-06 10:35:25 +01:00
| OCIS_PASSWORD_POLICY_MIN_CHARACTERS | 13 |
| OCIS_PASSWORD_POLICY_MIN_LOWERCASE_CHARACTERS | 3 |
| OCIS_PASSWORD_POLICY_MIN_UPPERCASE_CHARACTERS | 2 |
| OCIS_PASSWORD_POLICY_MIN_DIGITS | 1 |
| OCIS_PASSWORD_POLICY_MIN_SPECIAL_CHARACTERS | 2 |
2023-09-18 10:21:35 +02:00
And user " Alice " has been created with default attributes and without skeleton files
And user " Alice " has uploaded file with content " test file " to " /testfile.txt "
And 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 | 6a0Q;A3 +i^m[ |
Then the HTTP status code should be " 200 "
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 " 6a0Q;A3 +i^m[ "
Examples:
| ocs-api-version | ocs-code |
| 1 | 100 |
| 2 | 200 |
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 |
2023-11-13 23:37:12 +01:00
| OCIS_SHARING_PUBLIC_SHARE_MUST_HAVE_PASSWORD | false |
2023-09-18 10:21:35 +02:00
| OCIS_SHARING_PUBLIC_WRITEABLE_SHARE_MUST_HAVE_PASSWORD | true |
2023-12-06 10:35:25 +01:00
| OCIS_PASSWORD_POLICY_MIN_CHARACTERS | 13 |
| OCIS_PASSWORD_POLICY_MIN_LOWERCASE_CHARACTERS | 3 |
| OCIS_PASSWORD_POLICY_MIN_UPPERCASE_CHARACTERS | 2 |
| OCIS_PASSWORD_POLICY_MIN_DIGITS | 1 |
| OCIS_PASSWORD_POLICY_MIN_SPECIAL_CHARACTERS | 2 |
2023-09-18 10:21:35 +02:00
And user " Alice " has been created with default attributes and without skeleton files
And user " Alice " has uploaded file with content " test file " to " /testfile.txt "
And 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 | Pws^ |
Then the HTTP status code should be " <http-code> "
And the OCS status code should be " 400 "
And the OCS status message should be:
"""
2023-09-26 14:11:21 +02:00
At least 13 characters are required
2023-09-26 16:37:44 +02:00
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 !"#$%&'()*+,-./:; <=> ?@[\]^_`{|}~
2023-09-18 10:21:35 +02:00
"""
Examples:
| ocs-api-version | http-code |
| 1 | 200 |
| 2 | 400 |
2023-11-13 23:37:12 +01:00
Scenario Outline: create a public link with a password in accordance with the password policy (valid cases)
Given the config " <config> " has been set to " <config-value> "
2023-09-18 10:21:35 +02:00
And using OCS API version " 2 "
And user " Alice " has been created with default attributes and without skeleton files
And user " Alice " has uploaded file with content " test file " to " /testfile.txt "
2023-11-13 23:37:12 +01:00
When user " Alice " creates a public link share using the sharing API with settings
2023-09-18 10:21:35 +02:00
| path | /testfile.txt |
| permissions | 1 |
2023-11-13 23:37:12 +01:00
| password | <password> |
2023-09-18 10:21:35 +02:00
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 " /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 " <password> "
Examples:
2023-11-13 23:37:12 +01:00
| config | config-value | password |
2023-12-06 10:35:25 +01:00
| OCIS_PASSWORD_POLICY_MIN_CHARACTERS | 4 | Ps-1 |
| OCIS_PASSWORD_POLICY_MIN_CHARACTERS | 14 | Ps1:with space |
| OCIS_PASSWORD_POLICY_MIN_LOWERCASE_CHARACTERS | 4 | PS1:test |
| OCIS_PASSWORD_POLICY_MIN_UPPERCASE_CHARACTERS | 3 | PS1:TeƒsT |
| OCIS_PASSWORD_POLICY_MIN_DIGITS | 2 | PS1:test2 |
| OCIS_PASSWORD_POLICY_MIN_SPECIAL_CHARACTERS | 2 | PS1:test pass |
| OCIS_PASSWORD_POLICY_MIN_SPECIAL_CHARACTERS | 33 | pS1! #$%&'()*+,-./:;<=>?@[\]^_`{ }~ |
| OCIS_PASSWORD_POLICY_MIN_SPECIAL_CHARACTERS | 5 | 1sameCharacterShouldWork!!!!! |
2023-09-18 10:21:35 +02:00
2023-11-13 23:37:12 +01:00
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 "
2023-09-18 10:21:35 +02:00
And user " Alice " has been created with default attributes and without skeleton files
And user " Alice " has uploaded file with content " test file " to " /testfile.txt "
2023-11-13 23:37:12 +01:00
When user " Alice " creates a public link share using the sharing API with settings
2023-09-18 10:21:35 +02:00
| path | /testfile.txt |
2023-11-13 23:37:12 +01:00
| permissions | 3 |
| password | <password> |
2023-09-18 10:21:35 +02:00
Then the HTTP status code should be " 400 "
And the OCS status code should be " 400 "
And the OCS status message should be " <message> "
Examples:
2023-11-13 23:37:12 +01:00
| 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 |
2023-09-25 11:50:34 +02:00
Scenario Outline: update a public link with a password that is listed in the Banned-Password-List
2023-12-06 10:35:25 +01:00
Given the config " OCIS_PASSWORD_POLICY_BANNED_PASSWORDS_LIST " has been set to path " config/drone/banned-password-list.txt "
2023-09-25 11:50:34 +02:00
And using OCS API version " 2 "
And user " Alice " has been created with default attributes and without skeleton files
And user " Alice " has uploaded file with content " test file " to " /testfile.txt "
2023-10-20 17:55:36 +02:00
And user " Alice " has created a public link share with settings
2023-09-25 11:50:34 +02:00
| path | /testfile.txt |
2023-11-13 23:37:12 +01:00
| permissions | 0 |
2023-09-25 11:50:34 +02:00
When user " Alice " updates the last public link share using the sharing API with
| permissions | 3 |
| password | <password> |
Then the HTTP status code should be " <http-code> "
And the OCS status code should be " <ocs-code> "
And the OCS status message should be " <message> "
Examples:
| password | http-code | ocs-code | message |
2023-09-26 16:37:44 +02:00
| 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 |
| ownCloud | 400 | 400 | Unfortunately, your password is commonly used. please pick a harder-to-guess password for your safety |
2023-12-06 10:35:25 +01:00
2023-09-25 11:50:34 +02:00
Scenario Outline: create a public link with a password that is listed in the Banned-Password-List
2023-12-06 10:35:25 +01:00
Given the config " OCIS_PASSWORD_POLICY_BANNED_PASSWORDS_LIST " has been set to path " config/drone/banned-password-list.txt "
2023-09-25 11:50:34 +02:00
And using OCS API version " 2 "
And user " Alice " has been created with default attributes and without skeleton files
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 | <password> |
Then the HTTP status code should be " <http-code> "
And the OCS status code should be " <ocs-code> "
And the OCS status message should be " <message> "
Examples:
| password | http-code | ocs-code | message |
2023-09-26 16:37:44 +02:00
| 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 |
| ownCloud | 400 | 400 | Unfortunately, your password is commonly used. please pick a harder-to-guess password for your safety |