Last active
February 13, 2021 14:54
-
-
Save righettod/ee42e6bdba605c09cf2364ef9d61ad54 to your computer and use it in GitHub Desktop.
VENOM sample security tests suite
This file contains hidden or 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
name: Security authorization test suites | |
# HOME: https://github.com/ovh/venom | |
# TEST API: https://gorest.co.in/ | |
vars: | |
target_host: "" | |
testcases: | |
- name: GetUserFromCollection | |
steps: | |
- type: http | |
method: GET | |
url: https://{{.target_host}}/public-api/users | |
timeout: 20 | |
vars: | |
test_user_uid: | |
from: result.bodyjson.data.data3.id | |
assertions: | |
- result.statuscode ShouldEqual 200 | |
- result.bodyjson.code ShouldEqual 200 | |
- name: TestAccessDeniedForAnonymous | |
steps: | |
- type: http | |
method: DELETE | |
url: https://{{.target_host}}/public-api/users/{{.GetUserFromCollection.test_user_uid}} | |
timeout: 20 | |
assertions: | |
- result.statuscode ShouldEqual 200 | |
- result.bodyjson.code ShouldEqual 401 | |
- result.bodyjson.data.message ShouldEqual "Authentication failed" | |
- type: http | |
method: PATCH | |
url: https://{{.target_host}}/public-api/users/{{.GetUserFromCollection.test_user_uid}} | |
headers: {"Content-Type": "application/json"} | |
body: | | |
{ | |
"name":"TEST", | |
"gender":"Male", | |
"email":"[email protected]", | |
"status":"Active" | |
} | |
timeout: 20 | |
assertions: | |
- result.statuscode ShouldEqual 200 | |
- result.bodyjson.code ShouldEqual 401 | |
- result.bodyjson.data.message ShouldEqual "Authentication failed" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Execution:
$ venom run --var="target_host=gorest.co.in" venom_security_tests_suite.yml