ghomem / overloop-101

0 stars 0 forks source link

Check overall app robustness #4

Closed ghomem closed 4 years ago

ghomem commented 4 years ago

Original requirement:

"The app should be robust and you should make sure that everything works as specified."

ghomem commented 4 years ago

Stuff to be checked:

ghomem commented 4 years ago

Transaction added for the only situation where the db update is in two steps:

https://github.com/ghomem/overloop-101/commit/7fac7279592f6b6d686ab9d8481aabf3f406b8c5

ghomem commented 4 years ago

nginx is in front of gunicorn for extra security (including SSL + specific selection of ciphers, reasonable default buffer sizes, etc)

ghomem commented 4 years ago

Quick test sequence:

MYUSER=XXX
MYPASSWORD=ZZZ
MYHOSTNAME=XXX.YYY.ZZZ

curl https://${MYHOSTNAME}/articles
curl https://${MYHOSTNAME}/regions
curl https://${MYHOSTNAME}/authors
curl https://${MYHOSTNAME}/article/1
curl https://${MYHOSTNAME}/region/1
curl https://${MYHOSTNAME}/author/1

curl -X POST https://${MYHOSTNAME}/add_author  --form username=$MYUSER --form password="$MYPASSWORD"  --form 'content={"first_name":"Al","last_name":"Packa"}'
curl -X POST https://${MYHOSTNAME}/edit_author --form username=$MYUSER --form password="$MYPASSWORD"  --form 'content={"id":"5", "first_name":"Al","last_name":"Pacone"}'

curl -X POST https://${MYHOSTNAME}/add_article    --form username=$MYUSER --form password="$MYPASSWORD"  --form 'content={"title":"2020 A Space Odissey","content":"Once upon a time..."}'
curl -X POST https://${MYHOSTNAME}/edit_article   --form username=$MYUSER --form password="$MYPASSWORD"  --form 'content={"id":"3", "title":"2020 A Space Odissey","content":"Twice upon a time..."}'
curl -X POST https://${MYHOSTNAME}/delete_article --form username=$MYUSER --form password="$MYPASSWORD"  --form 'content={"id":"3"}'
ghomem commented 4 years ago

Added extra checks on some parameters and beter error messages when the input is not considered valid.

ghomem commented 4 years ago

Fixed via

https://github.com/ghomem/overloop-101/pull/8