shareable upload tokens

This commit is contained in:
Q
2023-08-28 22:13:22 +03:00
parent 4629bf2976
commit 3b69ce7ae1
6 changed files with 145 additions and 8 deletions

View File

@@ -298,11 +298,26 @@ function t16-download-password() {
-H "Password: wrongpassword" \
"$FLASK_PUBLIC_URL"/d/"$token_name" > downloaded
file downloaded
}
function t17-new-upload_token() {
token=$( curl -fL -w "\n" \
-H "Secret: $FLASK_ACCESS_TOKEN" \
-H "Expiry-days: 1" \
"$FLASK_PUBLIC_URL"/new_token )
echo $token
cat "$IMAGE" | \
curl -fL -w "\n" -F file="@-" -X POST \
-H "Name: $IMAGE" \
-H "Token: $token" \
"$FLASK_PUBLIC_URL"/upload
}
_getlist() {
declare -F | awk '{ print $3 }' | grep -v ^_
echo exit