[full-ci]Enforce pass by default. changed api tests (#7706)

* set enforce pass by default. change tests

* fix tests

* fix test
This commit is contained in:
Viktor Scharf
2023-11-13 23:37:12 +01:00
committed by GitHub
parent ef1b18aeac
commit 91ae5172f6
42 changed files with 564 additions and 493 deletions
@@ -1,11 +1,23 @@
@env-config
Feature: enforce password on public link
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
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 |
| FRONTEND_PASSWORD_POLICY_MIN_CHARACTERS | 8 |
| FRONTEND_PASSWORD_POLICY_MIN_LOWERCASE_CHARACTERS | 1 |
| FRONTEND_PASSWORD_POLICY_MIN_UPPERCASE_CHARACTERS | 1 |
| FRONTEND_PASSWORD_POLICY_MIN_DIGITS | 1 |
| FRONTEND_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 config "OCIS_SHARING_PUBLIC_WRITEABLE_SHARE_MUST_HAVE_PASSWORD" has been set to "true"
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 |
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>"
@@ -21,65 +33,30 @@ Feature: enforce password on public link
| 2 | 400 |
Scenario Outline: update a public link to edit permission without a password
Given the config "OCIS_SHARING_PUBLIC_WRITEABLE_SHARE_MUST_HAVE_PASSWORD" has been set to "true"
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 |
Then the HTTP status code should be "<http-code>"
And the OCS status code should be "400"
And the OCS status message should be "missing required password"
Examples:
| ocs-api-version | http-code |
| 1 | 200 |
| 2 | 400 |
Scenario Outline: create a public link with view permission without a password
Given the config "OCIS_SHARING_PUBLIC_SHARE_MUST_HAVE_PASSWORD" has been set to "true"
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 |
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 |
Then the HTTP status code should be "<http-code>"
And the OCS status code should be "400"
And the OCS status message should be "missing required password"
Then the OCS status code should be "<ocs_status_code>"
And the HTTP status code should be "200"
Examples:
| ocs-api-version | http-code |
| 1 | 200 |
| 2 | 400 |
Scenario Outline: updates a public link to edit permission without a password
Given the config "OCIS_SHARING_PUBLIC_SHARE_MUST_HAVE_PASSWORD" has been set to "true"
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 |
| password | test12GD!sdf |
When user "Alice" updates the last public link share using the sharing API with
| permissions | 3 |
| password | |
Then the HTTP status code should be "<http-code>"
And the OCS status code should be "400"
And the OCS status message should be "missing required password"
Examples:
| ocs-api-version | http-code |
| 1 | 200 |
| 2 | 400 |
| ocs-api-version | ocs_status_code |
| 1 | 100 |
| 2 | 200 |
Scenario Outline: updates a public link to edit permission with a password
Given the config "OCIS_SHARING_PUBLIC_WRITEABLE_SHARE_MUST_HAVE_PASSWORD" has been set to "true"
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 |
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>"
@@ -87,14 +64,14 @@ Feature: enforce password on public link
| path | /testfile.txt |
| permissions | 1 |
When user "Alice" updates the last public link share using the sharing API with
| permissions | 3 |
| password | testpassword |
| permissions | 3 |
| password | %public% |
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 "testpassword"
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%"
Examples:
| ocs-api-version | ocs-code |
| 1 | 100 |
@@ -131,13 +108,12 @@ 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
Given the following configs have been set:
| config | value |
| OCIS_SHARING_PUBLIC_WRITEABLE_SHARE_MUST_HAVE_PASSWORD | true |
| FRONTEND_PASSWORD_POLICY_MIN_CHARACTERS | 13 |
| FRONTEND_PASSWORD_POLICY_MIN_LOWERCASE_CHARACTERS | 3 |
| FRONTEND_PASSWORD_POLICY_MIN_UPPERCASE_CHARACTERS | 2 |
| FRONTEND_PASSWORD_POLICY_MIN_DIGITS | 2 |
| FRONTEND_PASSWORD_POLICY_MIN_SPECIAL_CHARACTERS | 2 |
| config | value |
| FRONTEND_PASSWORD_POLICY_MIN_CHARACTERS | 13 |
| FRONTEND_PASSWORD_POLICY_MIN_LOWERCASE_CHARACTERS | 3 |
| FRONTEND_PASSWORD_POLICY_MIN_UPPERCASE_CHARACTERS | 2 |
| FRONTEND_PASSWORD_POLICY_MIN_DIGITS | 2 |
| FRONTEND_PASSWORD_POLICY_MIN_SPECIAL_CHARACTERS | 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"
And using OCS API version "<ocs-api-version>"
@@ -164,6 +140,7 @@ Feature: enforce password on public link
Scenario Outline: update a public link with a password in accordance with the password policy
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 |
| FRONTEND_PASSWORD_POLICY_MIN_CHARACTERS | 13 |
| FRONTEND_PASSWORD_POLICY_MIN_LOWERCASE_CHARACTERS | 3 |
@@ -194,6 +171,7 @@ Feature: enforce password on public link
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 |
| OCIS_SHARING_PUBLIC_SHARE_MUST_HAVE_PASSWORD | false |
| OCIS_SHARING_PUBLIC_WRITEABLE_SHARE_MUST_HAVE_PASSWORD | true |
| FRONTEND_PASSWORD_POLICY_MIN_CHARACTERS | 13 |
| FRONTEND_PASSWORD_POLICY_MIN_LOWERCASE_CHARACTERS | 3 |
@@ -225,20 +203,15 @@ Feature: enforce password on public link
| 2 | 400 |
Scenario Outline: update a public link with a password in accordance with the password policy (valid cases)
Given the following configs have been set:
| config | value |
| OCIS_SHARING_PUBLIC_WRITEABLE_SHARE_MUST_HAVE_PASSWORD | true |
| <config> | <config-value> |
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>"
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"
And user "Alice" has created a public link share with settings
When user "Alice" creates a public link share using the sharing API with settings
| path | /testfile.txt |
| permissions | 1 |
When user "Alice" updates the last public link share using the sharing API with
| permissions | 3 |
| password | <password> |
| password | <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"
@@ -246,40 +219,34 @@ Feature: enforce password on public link
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:
| config | config-value | password |
| FRONTEND_PASSWORD_POLICY_MIN_CHARACTERS | 5 | 12345 |
| FRONTEND_PASSWORD_POLICY_MIN_CHARACTERS | 10 | with space |
| FRONTEND_PASSWORD_POLICY_MIN_LOWERCASE_CHARACTERS | 3 | Test |
| FRONTEND_PASSWORD_POLICY_MIN_UPPERCASE_CHARACTERS | 3 | TeST |
| FRONTEND_PASSWORD_POLICY_MIN_DIGITS | 1 | test1 |
| FRONTEND_PASSWORD_POLICY_MIN_SPECIAL_CHARACTERS | 1 | test pass |
| FRONTEND_PASSWORD_POLICY_MIN_SPECIAL_CHARACTERS | 33 | ! #$%&'()*+,-./:;<=>?@[\]^_`{ }~ |
| FRONTEND_PASSWORD_POLICY_MIN_SPECIAL_CHARACTERS | 5 | sameCharacterShouldWork!!!!! |
| config | config-value | password |
| FRONTEND_PASSWORD_POLICY_MIN_CHARACTERS | 4 | Ps-1 |
| FRONTEND_PASSWORD_POLICY_MIN_CHARACTERS | 14 | Ps1:with space |
| FRONTEND_PASSWORD_POLICY_MIN_LOWERCASE_CHARACTERS | 4 | PS1:test |
| FRONTEND_PASSWORD_POLICY_MIN_UPPERCASE_CHARACTERS | 3 | PS1:TeƒsT |
| FRONTEND_PASSWORD_POLICY_MIN_DIGITS | 2 | PS1:test2 |
| FRONTEND_PASSWORD_POLICY_MIN_SPECIAL_CHARACTERS | 2 | PS1:test pass |
| FRONTEND_PASSWORD_POLICY_MIN_SPECIAL_CHARACTERS | 33 | pS1! #$%&'()*+,-./:;<=>?@[\]^_`{ }~ |
| FRONTEND_PASSWORD_POLICY_MIN_SPECIAL_CHARACTERS | 5 | 1sameCharacterShouldWork!!!!! |
Scenario Outline: try to update a public link with a password that does not comply with the password policy (invalid cases)
Given the following configs have been set:
| config | value |
| OCIS_SHARING_PUBLIC_WRITEABLE_SHARE_MUST_HAVE_PASSWORD | true |
| <config> | <config-value> |
And using OCS API version "2"
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 without skeleton files
And user "Alice" has uploaded file with content "test file" to "/testfile.txt"
And user "Alice" has created a public link share with settings
When user "Alice" creates a public link share using the sharing API with settings
| path | /testfile.txt |
| permissions | 1 |
When user "Alice" updates the last public link share using the sharing API with
| permissions | 3 |
| password | <password> |
| permissions | 3 |
| password | <password> |
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:
| config | config-value | password | message |
| FRONTEND_PASSWORD_POLICY_MIN_CHARACTERS | 5 | 1234 | At least 5 characters are required |
| FRONTEND_PASSWORD_POLICY_MIN_LOWERCASE_CHARACTERS | 3 | TesT | At least 3 lowercase letters are required |
| FRONTEND_PASSWORD_POLICY_MIN_UPPERCASE_CHARACTERS | 3 | TesT | At least 3 uppercase letters are required |
| FRONTEND_PASSWORD_POLICY_MIN_DIGITS | 2 | test1 | At least 2 numbers are required |
| 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 |
Scenario Outline: update a public link with a password that is listed in the Banned-Password-List
@@ -289,7 +256,7 @@ Feature: enforce password on public link
And user "Alice" has uploaded file with content "test file" to "/testfile.txt"
And user "Alice" has created a public link share with settings
| path | /testfile.txt |
| permissions | 1 |
| permissions | 0 |
When user "Alice" updates the last public link share using the sharing API with
| permissions | 3 |
| password | <password> |
@@ -301,10 +268,7 @@ Feature: enforce password on public link
| 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 |
| 1234 | 200 | 200 | OK |
| OwnCloud | 200 | 200 | OK |
| p@ssword | 200 | 200 | OK |
Scenario Outline: create a public link with a password that is listed in the Banned-Password-List
Given the config "FRONTEND_PASSWORD_POLICY_BANNED_PASSWORDS_LIST" has been set to path "config/drone/banned-password-list.txt"
@@ -323,6 +287,4 @@ Feature: enforce password on public link
| 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 |
| 1234 | 200 | 200 | OK |
| OwnCloud | 200 | 200 | OK |
| p@ssword | 200 | 200 | OK |
@@ -713,8 +713,9 @@ Feature: user GDPR (General Data Protection Regulation) report
Given user "Brian" has been created with default attributes and without skeleton files
And user "Alice" has created folder "/folderMain"
And user "Alice" has created a public link share with settings
| path | /folderMain |
| name | sharedlink |
| path | /folderMain |
| name | sharedlink |
| password | %public% |
When user "Alice" exports her GDPR report to "/.personal_data_export.json" using the Graph API
And user "Alice" downloads the content of GDPR report ".personal_data_export.json"
Then the HTTP status code of responses on each endpoint should be "201, 200" respectively
@@ -751,7 +752,7 @@ Feature: user GDPR (General Data Protection Regulation) report
},
"PasswordProtected": {
"type": "boolean",
"enum": [false]
"enum": [true]
},
"Permissions": {
"type": "object",