Passwords for files

This commit is contained in:
Q
2023-08-20 22:23:42 +03:00
parent 80bce10987
commit 9af21b5f58
7 changed files with 103 additions and 16 deletions

View File

@@ -192,8 +192,6 @@ function t08-file-details() {
"$FLASK_PUBLIC_URL"/details/"$token_name"
}
function t09-file-delete() {
download_url=$( curl -fL -w "\n" \
-H "Secret: $FLASK_ACCESS_TOKEN" \
"$FLASK_PUBLIC_URL"/ls | grep "$BIGS" | tail -n 1 | sed s,.*http,http, )
@@ -271,8 +269,38 @@ function t14-mfl-upload() {
cat mfl | ./mfl w mfl
./mfl w . "folder with spaces"
./mfl w "$SMALL"
./mfl w -p "passwordprotected" "$IMAGE"
}
function t15-upload-password() {
cat "$IMAGE" | \
curl -fL -w "\n" -F file="@-" -X POST \
-H "Name: $IMAGE" \
-H "Password: password" \
-H "Secret: $FLASK_ACCESS_TOKEN" \
"$FLASK_PUBLIC_URL"/upload
}
function t16-download-password() {
download_url=$( curl -fL -w "\n" \
-H "Secret: $FLASK_ACCESS_TOKEN" \
"$FLASK_PUBLIC_URL"/ls | grep "$IMAGE" | tail -n 1 | sed s,.*http,http, )
token_name=$( echo $download_url | sed s,.*/d/,, )
curl -fL -w "\n" \
-H "Secret: $FLASK_ACCESS_TOKEN" \
-H "Password: password" \
"$FLASK_PUBLIC_URL"/d/"$token_name" > downloaded
file downloaded
curl -fL -w "\n" \
-H "Secret: $FLASK_ACCESS_TOKEN" \
-H "Password: wrongpassword" \
"$FLASK_PUBLIC_URL"/d/"$token_name" > downloaded
file downloaded
}
_getlist() {