Skip to content

Commit

Permalink
Refactor done for apiAuthOCS
Browse files Browse the repository at this point in the history
  • Loading branch information
kiranparajuli589 committed Jul 15, 2020
1 parent 90d380c commit d05b03e
Show file tree
Hide file tree
Showing 8 changed files with 493 additions and 347 deletions.
79 changes: 41 additions & 38 deletions tests/acceptance/features/apiAuthOcs/ocsDELETEAuth.feature
Original file line number Diff line number Diff line change
Expand Up @@ -8,45 +8,48 @@ Feature: auth
@smokeTest @issue-32068 @skipOnOcis @issue-ocis-reva-30 @issue-ocis-reva-65
@skipOnBruteForceProtection @issue-brute_force_protection-112
Scenario: send DELETE requests to OCS endpoints as admin with wrong password
When user "another-admin" requests these endpoints with "DELETE" using password "invalid" then the status codes about user "Alice" should be as listed
| endpoint | ocs-code | http-code |
| /ocs/v1.php/apps/files_sharing/api/v1/remote_shares/pending/123 | 997 | 401 |
| /ocs/v2.php/apps/files_sharing/api/v1/remote_shares/pending/123 | 997 | 401 |
| /ocs/v1.php/apps/files_sharing/api/v1/remote_shares/123 | 997 | 401 |
| /ocs/v2.php/apps/files_sharing/api/v1/remote_shares/123 | 997 | 401 |
| /ocs/v2.php/apps/files_sharing/api/v1/shares/123 | 997 | 401 |
| /ocs/v1.php/apps/files_sharing/api/v1/shares/pending/123 | 997 | 401 |
| /ocs/v2.php/apps/files_sharing/api/v1/shares/pending/123 | 997 | 401 |
| /ocs/v1.php/cloud/apps/testing | 997 | 401 |
| /ocs/v2.php/cloud/apps/testing | 997 | 401 |
| /ocs/v1.php/cloud/groups/group1 | 997 | 401 |
| /ocs/v2.php/cloud/groups/group1 | 997 | 401 |
| /ocs/v1.php/cloud/users/%username% | 997 | 401 |
| /ocs/v2.php/cloud/users/%username% | 997 | 401 |
| /ocs/v1.php/cloud/users/%username%/groups | 997 | 401 |
| /ocs/v2.php/cloud/users/%username%/groups | 997 | 401 |
| /ocs/v1.php/cloud/users/%username%/subadmins | 997 | 401 |
| /ocs/v2.php/cloud/users/%username%/subadmins | 997 | 401 |
When user "another-admin" requests these endpoints with "DELETE" using password "invalid" about user "Alice"
| endpoint |
| /ocs/v1.php/apps/files_sharing/api/v1/remote_shares/pending/123 |
| /ocs/v2.php/apps/files_sharing/api/v1/remote_shares/pending/123 |
| /ocs/v1.php/apps/files_sharing/api/v1/remote_shares/123 |
| /ocs/v2.php/apps/files_sharing/api/v1/remote_shares/123 |
| /ocs/v2.php/apps/files_sharing/api/v1/shares/123 |
| /ocs/v1.php/apps/files_sharing/api/v1/shares/pending/123 |
| /ocs/v2.php/apps/files_sharing/api/v1/shares/pending/123 |
| /ocs/v1.php/cloud/apps/testing |
| /ocs/v2.php/cloud/apps/testing |
| /ocs/v1.php/cloud/groups/group1 |
| /ocs/v2.php/cloud/groups/group1 |
| /ocs/v1.php/cloud/users/%username% |
| /ocs/v2.php/cloud/users/%username% |
| /ocs/v1.php/cloud/users/%username%/groups |
| /ocs/v2.php/cloud/users/%username%/groups |
| /ocs/v1.php/cloud/users/%username%/subadmins |
| /ocs/v2.php/cloud/users/%username%/subadmins |
Then the HTTP status code of responses on all endpoints should be "401"
Then the OCS status code of responses on all endpoints should be "997"

@smokeTest @skipOnOcV10 @issue-ocis-reva-30 @issue-ocis-reva-65
#after fixing all issues delete this Scenario and use the one above
Scenario: send DELETE requests to OCS endpoints as admin with wrong password
When user "another-admin" requests these endpoints with "DELETE" using password "invalid" then the status codes about user "Alice" should be as listed
| endpoint | http-code |
| /ocs/v1.php/apps/files_sharing/api/v1/remote_shares/pending/123 | 401 |
| /ocs/v2.php/apps/files_sharing/api/v1/remote_shares/pending/123 | 401 |
| /ocs/v1.php/apps/files_sharing/api/v1/remote_shares/123 | 401 |
| /ocs/v2.php/apps/files_sharing/api/v1/remote_shares/123 | 401 |
| /ocs/v2.php/apps/files_sharing/api/v1/shares/123 | 401 |
| /ocs/v1.php/apps/files_sharing/api/v1/shares/pending/123 | 401 |
| /ocs/v2.php/apps/files_sharing/api/v1/shares/pending/123 | 401 |
| /ocs/v1.php/cloud/apps/testing | 401 |
| /ocs/v2.php/cloud/apps/testing | 401 |
| /ocs/v1.php/cloud/groups/group1 | 401 |
| /ocs/v2.php/cloud/groups/group1 | 401 |
| /ocs/v1.php/cloud/users/%username% | 401 |
| /ocs/v2.php/cloud/users/%username% | 401 |
| /ocs/v1.php/cloud/users/%username%/groups | 401 |
| /ocs/v2.php/cloud/users/%username%/groups | 401 |
| /ocs/v1.php/cloud/users/%username%/subadmins | 401 |
| /ocs/v2.php/cloud/users/%username%/subadmins | 401 |
When user "another-admin" requests these endpoints with "DELETE" using password "invalid" about user "Alice"
| endpoint |
| /ocs/v1.php/apps/files_sharing/api/v1/remote_shares/pending/123 |
| /ocs/v2.php/apps/files_sharing/api/v1/remote_shares/pending/123 |
| /ocs/v1.php/apps/files_sharing/api/v1/remote_shares/123 |
| /ocs/v2.php/apps/files_sharing/api/v1/remote_shares/123 |
| /ocs/v2.php/apps/files_sharing/api/v1/shares/123 |
| /ocs/v1.php/apps/files_sharing/api/v1/shares/pending/123 |
| /ocs/v2.php/apps/files_sharing/api/v1/shares/pending/123 |
| /ocs/v1.php/cloud/apps/testing |
| /ocs/v2.php/cloud/apps/testing |
| /ocs/v1.php/cloud/groups/group1 |
| /ocs/v2.php/cloud/groups/group1 |
| /ocs/v1.php/cloud/users/%username% |
| /ocs/v2.php/cloud/users/%username% |
| /ocs/v1.php/cloud/users/%username%/groups |
| /ocs/v2.php/cloud/users/%username%/groups |
| /ocs/v1.php/cloud/users/%username%/subadmins |
| /ocs/v2.php/cloud/users/%username%/subadmins |
Then the HTTP status code of responses on all endpoints should be "401"
Loading

0 comments on commit d05b03e

Please sign in to comment.