Removed system config setting steps

This commit is contained in:
Prarup Gurung
2023-02-28 11:21:06 +05:45
parent 145577ebbd
commit 8541081d76
11 changed files with 6 additions and 212 deletions
@@ -11,16 +11,12 @@ Feature: users cannot upload a file to a blacklisted name using old chunking
Scenario: Upload a file to a banned filename using old chunking
Given the administrator has updated system config key "blacklisted_files" with value '["blacklisted-file.txt",".htaccess"]' and type "json"
When user "Alice" uploads file "filesForUpload/textfile.txt" to "blacklisted-file.txt" in 3 chunks using the WebDAV API
Then the HTTP status code should be "403"
And as "Alice" file "blacklisted-file.txt" should not exist
Scenario Outline: upload a file to a filename that matches blacklisted_files_regex using old chunking
# Note: we have to write JSON for the value, and to get a backslash in the double-quotes we have to escape it
# The actual regular expressions end up being .*\.ext$ and ^bannedfilename\..+
Given the administrator has updated system config key "blacklisted_files_regex" with value '[".*\\.ext$","^bannedfilename\\..+","containsbannedstring"]' and type "json"
When user "Alice" uploads file "filesForUpload/textfile.txt" to "<filename>" in 3 chunks using the WebDAV API
Then the HTTP status code should be "<http-status>"
And as "Alice" file "<filename>" should not exist
@@ -32,9 +28,6 @@ Feature: users cannot upload a file to a blacklisted name using old chunking
Scenario: upload a file to a filename that does not match blacklisted_files_regex using old chunking
# Note: we have to write JSON for the value, and to get a backslash in the double-quotes we have to escape it
# The actual regular expressions end up being .*\.ext$ and ^bannedfilename\..+
Given the administrator has updated system config key "blacklisted_files_regex" with value '[".*\\.ext$","^bannedfilename\\..+","containsbannedstring"]' and type "json"
When user "Alice" uploads file "filesForUpload/textfile.txt" to "not-contains-banned-string.txt" in 3 chunks using the WebDAV API
Then the HTTP status code should be "201"
And as "Alice" file "not-contains-banned-string.txt" should exist
@@ -11,7 +11,6 @@ Feature: users cannot upload a file to or into an excluded directory using old c
Scenario: Upload a file to an excluded directory name using old chunking
Given the administrator has updated system config key "excluded_directories" with value '[".github"]' and type "json"
When user "Alice" uploads file "filesForUpload/textfile.txt" to "/.github" in 3 chunks using the WebDAV API
Then the HTTP status code should be "403"
And as "Alice" file ".github" should not exist
@@ -19,7 +18,6 @@ Feature: users cannot upload a file to or into an excluded directory using old c
Scenario: Upload a file to an excluded directory name inside a parent directory using old chunking
Given user "Alice" has created folder "FOLDER"
And the administrator has updated system config key "excluded_directories" with value '[".github"]' and type "json"
When user "Alice" uploads file "filesForUpload/textfile.txt" to "/FOLDER/.github" in 3 chunks using the WebDAV API
Then the HTTP status code should be "403"
And as "Alice" folder "/FOLDER" should exist
@@ -27,9 +25,6 @@ Feature: users cannot upload a file to or into an excluded directory using old c
Scenario Outline: upload a file to a filename that matches excluded_directories_regex using old chunking
# Note: we have to write JSON for the value, and to get a backslash in the double-quotes we have to escape it
# The actual regular expressions end up being endswith\.bad$ and ^\.git
Given the administrator has updated system config key "excluded_directories_regex" with value '["endswith\\.bad$","^\\.git","containsvirusinthename"]' and type "json"
When user "Alice" uploads file "filesForUpload/textfile.txt" to "<filename>" in 3 chunks using the WebDAV API
Then the HTTP status code should be "<http-status>"
And as "Alice" file "<filename>" should not exist
@@ -41,9 +36,6 @@ Feature: users cannot upload a file to or into an excluded directory using old c
Scenario: upload a file to a filename that does not match excluded_directories_regex using old chunking
# Note: we have to write JSON for the value, and to get a backslash in the double-quotes we have to escape it
# The actual regular expressions end up being endswith\.bad$ and ^\.git
Given the administrator has updated system config key "excluded_directories_regex" with value '["endswith\\.bad$","^\\.git","containsvirusinthename"]' and type "json"
When user "Alice" uploads file "filesForUpload/textfile.txt" to "not-contains-virus-in-the-name.txt" in 3 chunks using the WebDAV API
Then the HTTP status code should be "201"
And as "Alice" file "not-contains-virus-in-the-name.txt" should exist