Compare commits
No commits in common. "9f4e097e2722f5534fe0637db623a74a6230a632" and "d168b0c87ea84adcb290a62b8a644f8bc24ce6f3" have entirely different histories.
9f4e097e27
...
d168b0c87e
2 changed files with 5 additions and 13 deletions
|
@ -113,7 +113,7 @@ def refresh():
|
||||||
$ curl http://localhost:5000/api/refresh -X GET \
|
$ curl http://localhost:5000/api/refresh -X GET \
|
||||||
-H "Authorization: Bearer <your_token>"
|
-H "Authorization: Bearer <your_token>"
|
||||||
"""
|
"""
|
||||||
old_token = flask.request.get_data()
|
old_token = request.get_data()
|
||||||
new_token = guard.refresh_jwt_token(old_token)
|
new_token = guard.refresh_jwt_token(old_token)
|
||||||
ret = {'access_token': new_token}
|
ret = {'access_token': new_token}
|
||||||
return ret, 200
|
return ret, 200
|
||||||
|
|
16
requests.sh
16
requests.sh
|
@ -1,11 +1,11 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
ACTION=$1
|
ACTION=$1
|
||||||
VALUE=$2
|
TOKEN=$2
|
||||||
ACTIONS=(login register rcvpw username data csv)
|
ACTIONS=(login register rcvpw username)
|
||||||
|
|
||||||
print_help(){
|
print_help(){
|
||||||
echo "Usage: $0 ACTION [TOKEN|INPUT_TYPE]"
|
echo "Usage: $0 ACTION [TOKEN]"
|
||||||
echo
|
echo
|
||||||
echo "available actions:"
|
echo "available actions:"
|
||||||
for el in "${ACTIONS[@]}"; do
|
for el in "${ACTIONS[@]}"; do
|
||||||
|
@ -34,15 +34,7 @@ case $ACTION in
|
||||||
;;
|
;;
|
||||||
"${ACTIONS[3]}") # get current username
|
"${ACTIONS[3]}") # get current username
|
||||||
echo "get username action"
|
echo "get username action"
|
||||||
curl localhost:5050/api/username -X GET -H "Authorization: Bearer $VALUE"
|
curl localhost:5050/api/username -X GET -H "Authorization: Bearer $TOKEN"
|
||||||
;;
|
|
||||||
"${ACTIONS[4]}") # get all data from behametricsserver
|
|
||||||
echo "get data action"
|
|
||||||
curl localhost:5000/data
|
|
||||||
;;
|
|
||||||
"${ACTIONS[5]}") # get all data from behametricsserver
|
|
||||||
echo "get data action"
|
|
||||||
curl localhost:5000/data/csv/"${VALUE}"
|
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
echo "Error: Action not available"
|
echo "Error: Action not available"
|
||||||
|
|
Loading…
Reference in a new issue