github.com/mmatczuk/gohan@v0.0.0-20170206152520-30e45d9bdb69/examples/noauth/curl_test.sh (about) 1 #!/bin/bash 2 3 # 1 4 echo -e "\e[35m\e[1m" 5 echo "[1] test a non-existing path '/v0.1/missing'" 6 echo " expected result: (401) Unauthorized" 7 echo -e "\e[0m" 8 curl -v 127.0.0.1:9091/v0.1/missing 9 10 # 2i 11 echo -e "\e[35m\e[1m" 12 echo "[2] test an existing and NOT whitelisted path '/v0.1/admin_only_resources'" 13 echo " expected result: (401) Unauthorized" 14 echo -e "\e[0m" 15 curl -v 127.0.0.1:9091/v0.1/admin_only_resources 16 17 # 3 18 echo -e "\e[35m\e[1m" 19 echo "[1] testing an existing and whitelisted path '/v0.1/member_resources'" 20 echo " expected result: (200) OK" 21 echo -e "\e[0m" 22 curl -v 127.0.0.1:9091/v0.1/member_resources