Skip to content

Commit

Permalink
more adjustements to the ocs endpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
individual-it committed Jul 31, 2020
1 parent 9ff1bc4 commit 7372407
Show file tree
Hide file tree
Showing 2 changed files with 87 additions and 5 deletions.
51 changes: 51 additions & 0 deletions tests/acceptance/features/apiAuthOcs/ocsGETAuth.feature
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,7 @@ Feature: auth
@skipOnOcV10
@issue-ocis-reva-29
@issue-ocis-reva-30
@issue-ocis-accounts-73
@smokeTest
#after fixing all issues delete this Scenario and use the one above
Scenario: using OCS as normal user with wrong password
Expand All @@ -246,6 +247,56 @@ Feature: auth
Then the HTTP status code of responses on all endpoints should be "401"
And the OCS status code of responses on all endpoints should be "notset"

@skipOnOcV10
@issue-ocis-reva-29
@issue-ocis-reva-30
@issue-ocis-accounts-73
@issue-ocis-ocs-26
@smokeTest
#after fixing all issues delete this Scenario and use the one above
Scenario: using OCS as normal user (username does not have a capital letter) with wrong password
Given user "brian" has been created with default attributes and skeleton files
When user "brian" requests these endpoints with "GET" using password "invalid"
| endpoint |
| /ocs/v1.php/apps/files_external/api/v1/mounts |
| /ocs/v2.php/apps/files_external/api/v1/mounts |
| /ocs/v1.php/apps/files_sharing/api/v1/remote_shares |
| /ocs/v2.php/apps/files_sharing/api/v1/remote_shares |
| /ocs/v1.php/apps/files_sharing/api/v1/remote_shares/pending |
| /ocs/v2.php/apps/files_sharing/api/v1/remote_shares/pending |
| /ocs/v1.php/apps/files_sharing/api/v1/shares |
| /ocs/v2.php/apps/files_sharing/api/v1/shares |
| /ocs/v1.php/cloud/apps |
| /ocs/v2.php/cloud/apps |
| /ocs/v1.php/cloud/groups |
| /ocs/v2.php/cloud/groups |
| /ocs/v1.php/config |
| /ocs/v2.php/config |
| /ocs/v1.php/privatedata/getattribute |
| /ocs/v2.php/privatedata/getattribute |
Then the HTTP status code of responses on all endpoints should be "401"
And the OCS status code of responses on all endpoints should be "notset"

@skipOnOcV10
@issue-ocis-reva-29
@issue-ocis-reva-30
@issue-ocis-accounts-73
@issue-ocis-ocs-26
@smokeTest
#after fixing all issues delete this Scenario and use the one above
Scenario: using OCS as normal user (username does not have a capital letter) with wrong password
Given user "brian" has been created with default attributes and skeleton files
When user "brian" requests these endpoints with "GET" using password "invalid"
| endpoint |
| /ocs/v1.php/cloud/users |
Then the HTTP status code of responses on all endpoints should be "200"
And the OCS status code of responses on all endpoints should be "100"
When user "brian" requests these endpoints with "GET" using password "invalid"
| endpoint |
| /ocs/v2.php/cloud/users |
Then the HTTP status code of responses on all endpoints should be "200"
And the OCS status code of responses on all endpoints should be "200"

@skipOnOcis
@issue-ocis-reva-65
Scenario:using OCS with admin basic auth
Expand Down
41 changes: 36 additions & 5 deletions tests/acceptance/features/apiAuthOcs/ocsPUTAuth.feature
Original file line number Diff line number Diff line change
Expand Up @@ -25,18 +25,49 @@ Feature: auth

@skipOnOcV10
@issue-ocis-reva-30
@issue-ocis-ocs-26
@smokeTest
#after fixing all issues delete this Scenario and use the one above
Scenario: send PUT request to OCS endpoints as admin with wrong password
When the administrator requests these endpoints with "PUT" with body "doesnotmatter" using password "invalid" about user "Alice"
| endpoint |
| /ocs/v1.php/apps/files_sharing/api/v1/shares/123 |
| /ocs/v2.php/apps/files_sharing/api/v1/shares/123 |
Then the HTTP status code of responses on all endpoints should be "401"
And the OCS status code of responses on all endpoints should be "notset"

@skipOnOcV10
@issue-ocis-reva-30
@issue-ocis-ocs-26
@smokeTest
#after fixing all issues delete this Scenario and use the one above
Scenario: send PUT request to OCS endpoints as admin with wrong password
When the administrator requests these endpoints with "PUT" with body "doesnotmatter" using password "invalid" about user "Alice"
| endpoint |
| /ocs/v1.php/cloud/users/%username% |
Then the HTTP status code of responses on all endpoints should be "200"
And the OCS status code of responses on all endpoints should be "103"
When the administrator requests these endpoints with "PUT" with body "doesnotmatter" using password "invalid" about user "Alice"
| endpoint |
| /ocs/v2.php/cloud/users/%username% |
Then the HTTP status code of responses on all endpoints should be "400"
And the OCS status code of responses on all endpoints should be "103"

@skipOnOcV10
@issue-ocis-reva-30
@issue-ocis-ocs-28
@smokeTest
#after fixing all issues delete this Scenario and use the one above
Scenario: send PUT request to OCS endpoints as admin with wrong password
When the administrator requests these endpoints with "PUT" with body "doesnotmatter" using password "invalid" about user "Alice"
| endpoint |
| /ocs/v1.php/cloud/users/%username%/disable |
| /ocs/v2.php/cloud/users/%username%/disable |
| /ocs/v1.php/cloud/users/%username%/enable |
Then the HTTP status code of responses on all endpoints should be "200"
And the OCS status code of responses on all endpoints should be "998"
When the administrator requests these endpoints with "PUT" with body "doesnotmatter" using password "invalid" about user "Alice"
| endpoint |
| /ocs/v2.php/cloud/users/%username%/disable |
| /ocs/v2.php/cloud/users/%username%/enable |
| /ocs/v1.php/apps/files_sharing/api/v1/shares/123 |
| /ocs/v2.php/apps/files_sharing/api/v1/shares/123 |
Then the HTTP status code of responses on all endpoints should be "401"
And the OCS status code of responses on all endpoints should be "notset"
Then the HTTP status code of responses on all endpoints should be "404"
And the OCS status code of responses on all endpoints should be "998"

0 comments on commit 7372407

Please sign in to comment.