-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #36594 from owncloud/api-webdav-auth
Api webdav authAdd API acceptance tests for checking webdav operations with invalid auth
- Loading branch information
Showing
7 changed files
with
308 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
40 changes: 40 additions & 0 deletions
40
tests/acceptance/features/apiAuthWebDav/webDavDELETEAuth.feature
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
@api @TestAlsoOnExternalUserBackend | ||
Feature: delete file/folder | ||
|
||
Background: | ||
Given user "user0" has been created with default attributes and skeleton files | ||
And user "user1" has been created with default attributes and without skeleton files | ||
|
||
Scenario: send DELETE requests to webDav endpoints as normal user with wrong password | ||
When user "user0" requests these endpoints with "DELETE" including body using password "invalid" then the status codes should be as listed | ||
| endpoint | http-code | body | | ||
| /remote.php/webdav/textfile0.txt | 401 | doesnotmatter | | ||
| /remote.php/dav/files/user0/textfile0.txt | 401 | doesnotmatter | | ||
| /remote.php/webdav/PARENT | 401 | doesnotmatter | | ||
| /remote.php/dav/files/user0/PARENT | 401 | doesnotmatter | | ||
| /remote.php/dav/files/user0/PARENT/parent.txt | 401 | doesnotmatter | | ||
|
||
Scenario: send DELETE requests to webDav endpoints as normal user with no password | ||
When user "user0" requests these endpoints with "DELETE" including body using password "" then the status codes should be as listed | ||
| endpoint | http-code | body | | ||
| /remote.php/webdav/textfile0.txt | 401 | doesnotmatter | | ||
| /remote.php/dav/files/user0/textfile0.txt | 401 | doesnotmatter | | ||
| /remote.php/webdav/PARENT | 401 | doesnotmatter | | ||
| /remote.php/dav/files/user0/PARENT | 401 | doesnotmatter | | ||
| /remote.php/dav/files/user0/PARENT/parent.txt | 401 | doesnotmatter | | ||
|
||
Scenario: send DELETE requests to another user's webDav endpoints as normal user | ||
When user "user1" requests these endpoints with "DELETE" including body then the status codes should be as listed | ||
| endpoint | http-code | body | | ||
| /remote.php/dav/files/user0/textfile0.txt | 404 | doesnotmatter | | ||
| /remote.php/dav/files/user0/PARENT | 404 | doesnotmatter | | ||
| /remote.php/dav/files/user0/PARENT/parent.txt | 404 | doesnotmatter | | ||
|
||
Scenario: send DELETE requests to webDav endpoints using invalid username but correct password | ||
When user "usero" requests these endpoints with "DELETE" including body using the password of user "user0" then the status codes should be as listed | ||
| endpoint | http-code | body | | ||
| /remote.php/webdav/textfile0.txt | 401 | doesnotmatter | | ||
| /remote.php/dav/files/user0/textfile0.txt | 401 | doesnotmatter | | ||
| /remote.php/webdav/PARENT | 401 | doesnotmatter | | ||
| /remote.php/dav/files/user0/PARENT | 401 | doesnotmatter | | ||
| /remote.php/dav/files/user0/PARENT/parent.txt | 401 | doesnotmatter | |
40 changes: 40 additions & 0 deletions
40
tests/acceptance/features/apiAuthWebDav/webDavMOVEAuth.feature
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
@api @TestAlsoOnExternalUserBackend | ||
Feature: MOVE file/folder | ||
|
||
Background: | ||
Given user "user0" has been created with default attributes and skeleton files | ||
And user "user1" has been created with default attributes and without skeleton files | ||
|
||
Scenario: send MOVE requests to webDav endpoints as normal user with wrong password | ||
When user "user0" requests these endpoints with "MOVE" including body using password "invalid" then the status codes should be as listed | ||
| endpoint | http-code | body | | ||
| /remote.php/webdav/textfile0.txt | 401 | doesnotmatter | | ||
| /remote.php/dav/files/user0/textfile0.txt | 401 | doesnotmatter | | ||
| /remote.php/webdav/PARENT | 401 | doesnotmatter | | ||
| /remote.php/dav/files/user0/PARENT | 401 | doesnotmatter | | ||
| /remote.php/dav/files/user0/PARENT/parent.txt | 401 | doesnotmatter | | ||
|
||
Scenario: send MOVE requests to webDav endpoints as normal user with no password | ||
When user "user0" requests these endpoints with "MOVE" including body using password "" then the status codes should be as listed | ||
| endpoint | http-code | body | | ||
| /remote.php/webdav/textfile0.txt | 401 | doesnotmatter | | ||
| /remote.php/dav/files/user0/textfile0.txt | 401 | doesnotmatter | | ||
| /remote.php/webdav/PARENT | 401 | doesnotmatter | | ||
| /remote.php/dav/files/user0/PARENT | 401 | doesnotmatter | | ||
| /remote.php/dav/files/user0/PARENT/parent.txt | 401 | doesnotmatter | | ||
|
||
Scenario: send MOVE requests to another user's webDav endpoints as normal user | ||
When user "user1" requests these endpoints with "MOVE" including body then the status codes should be as listed | ||
| endpoint | http-code | body | | ||
| /remote.php/dav/files/user0/textfile0.txt | 403 | doesnotmatter | | ||
| /remote.php/dav/files/user0/PARENT | 403 | doesnotmatter | | ||
| /remote.php/dav/files/user0/PARENT/parent.txt | 403 | doesnotmatter | | ||
|
||
Scenario: send MOVE requests to webDav endpoints using invalid username but correct password | ||
When user "usero" requests these endpoints with "MOVE" including body using the password of user "user0" then the status codes should be as listed | ||
| endpoint | http-code | body | | ||
| /remote.php/webdav/textfile0.txt | 401 | doesnotmatter | | ||
| /remote.php/dav/files/user0/textfile0.txt | 401 | doesnotmatter | | ||
| /remote.php/webdav/PARENT | 401 | doesnotmatter | | ||
| /remote.php/dav/files/user0/PARENT | 401 | doesnotmatter | | ||
| /remote.php/dav/files/user0/PARENT/parent.txt | 401 | doesnotmatter | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters