|
27 | 27 | echo -e "${RED}Secure test without jwt fail ${TEST_SECURE_EXPECT_302}${NONE}";
|
28 | 28 | fi
|
29 | 29 |
|
30 |
| -TEST_SECURE_EXPECT_200=`curl -X GET -o /dev/null --silent --head --write-out '%{http_code}\n' http://${MACHINE_IP}:8000/secure/index.html -H 'cache-control: no-cache' --cookie "rampartjwt=${VALIDJWT}"` |
31 |
| -if [ "$TEST_SECURE_EXPECT_200" -eq "200" ];then |
32 |
| - echo -e "${GREEN}Secure test with jwt pass ${TEST_SECURE_EXPECT_200}${NONE}"; |
| 30 | +TEST_SECURE_COOKIE_EXPECT_200=`curl -X GET -o /dev/null --silent --head --write-out '%{http_code}\n' http://${MACHINE_IP}:8000/secure/index.html -H 'cache-control: no-cache' --cookie "rampartjwt=${VALIDJWT}"` |
| 31 | +if [ "$TEST_SECURE_COOKIE_EXPECT_200" -eq "200" ];then |
| 32 | + echo -e "${GREEN}Secure test with jwt pass ${TEST_SECURE_COOKIE_EXPECT_200}${NONE}"; |
33 | 33 | else
|
34 |
| - echo -e "${RED}Secure test with jwt fail ${TEST_SECURE_EXPECT_200}${NONE}"; |
| 34 | + echo -e "${RED}Secure test with jwt fail ${TEST_SECURE_COOKIE_EXPECT_200}${NONE}"; |
35 | 35 | fi
|
36 | 36 |
|
37 |
| -TEST_SECURE_EXPECT_200=`curl -X GET -o /dev/null --silent --head --write-out '%{http_code}\n' http://${MACHINE_IP}:8000/secure/index.html -H 'cache-control: no-cache' --header "Authorization: Bearer ${VALIDJWT}" --cookie "rampartjwt=${VALIDJWT}"` |
38 |
| -if [ "$TEST_SECURE_EXPECT_200" -eq "200" ];then |
39 |
| - echo -e "${GREEN}Secure test with jwt and auth header pass ${TEST_SECURE_EXPECT_200}${NONE}"; |
| 37 | +TEST_SECURE_HEADER_EXPECT_200=`curl -X GET -o /dev/null --silent --head --write-out '%{http_code}\n' http://${MACHINE_IP}:8000/secure/index.html -H 'cache-control: no-cache' --header "Authorization: Bearer ${VALIDJWT}" --cookie "rampartjwt=${VALIDJWT}"` |
| 38 | +if [ "$TEST_SECURE_HEADER_EXPECT_200" -eq "200" ];then |
| 39 | + echo -e "${GREEN}Secure test with jwt and auth header pass ${TEST_SECURE_HEADER_EXPECT_200}${NONE}"; |
40 | 40 | else
|
41 |
| - echo -e "${RED}Secure test with jwt and auth header fail ${TEST_SECURE_EXPECT_200}${NONE}"; |
| 41 | + echo -e "${RED}Secure test with jwt and auth header fail ${TEST_SECURE_HEADER_EXPECT_200}${NONE}"; |
| 42 | +fi |
| 43 | + |
| 44 | +TEST_SECURE_NO_REDIRECT_EXPECT_401=`curl -X GET -o /dev/null --silent --head --write-out '%{http_code}\n' http://${MACHINE_IP}:8000/secure-no-redirect/index.html` |
| 45 | +if [ "$TEST_SECURE_NO_REDIRECT_EXPECT_401" -eq "401" ];then |
| 46 | + echo -e "${GREEN}Secure test with jwt and auth header pass ${TEST_SECURE_NO_REDIRECT_EXPECT_401}${NONE}"; |
| 47 | +else |
| 48 | + echo -e "${RED}Secure test with jwt and auth header fail ${TEST_SECURE_NO_REDIRECT_EXPECT_401}${NONE}"; |
42 | 49 | fi
|
0 commit comments