From 4c919439400bdc8e0427d82747cf82c9ffd0dddf Mon Sep 17 00:00:00 2001 From: Evan Martin Date: Thu, 4 Nov 2010 22:08:17 -0700 Subject: [PATCH 1/2] include username in upload post --- blobserver/appengine/app.yaml | 3 +++ clients/curl/example.sh | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/blobserver/appengine/app.yaml b/blobserver/appengine/app.yaml index 1e0510d69..02ec0e968 100644 --- a/blobserver/appengine/app.yaml +++ b/blobserver/appengine/app.yaml @@ -14,6 +14,9 @@ handlers: login: admin script: main.py +- url: /js + static_dir: ../../clients/js + - url: .* secure: always script: main.py diff --git a/clients/curl/example.sh b/clients/curl/example.sh index eb7670349..df5c50ddb 100755 --- a/clients/curl/example.sh +++ b/clients/curl/example.sh @@ -9,7 +9,7 @@ BSPASS=foo curl -u user:$BSPASS -d camliversion=1 http://$BSHOST/camli/preupload # Upload -- 200 response -curl -v -L \ +curl -u user:$BSPASS -v -L \ -F sha1-126249fd8c18cbb5312a5705746a2af87fba9538=@./test_data.txt \ # From 680d496b5c807592ae90a7b7c1d5dd2f3d7a9d91 Mon Sep 17 00:00:00 2001 From: Evan Martin Date: Thu, 4 Nov 2010 22:10:20 -0700 Subject: [PATCH 2/2] shorten curl examples --- clients/curl/example.sh | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/clients/curl/example.sh b/clients/curl/example.sh index df5c50ddb..7c71cb958 100755 --- a/clients/curl/example.sh +++ b/clients/curl/example.sh @@ -2,14 +2,19 @@ # Example client accesses to blob server using curl. +# Configuration variables here: BSHOST=localhost:8080 +BSUSER=user BSPASS=foo +# Shorter name for curl auth param: +AUTH=$BSUSER:$BSPASS + # Preupload -- 200 response -curl -u user:$BSPASS -d camliversion=1 http://$BSHOST/camli/preupload +curl -u $AUTH -d camliversion=1 http://$BSHOST/camli/preupload # Upload -- 200 response -curl -u user:$BSPASS -v -L \ +curl -u $AUTH -v -L \ -F sha1-126249fd8c18cbb5312a5705746a2af87fba9538=@./test_data.txt \ # @@ -19,19 +24,19 @@ curl -v -L \ # # Get present -- the blob -curl -u user:$BSPASS -v http://$BSHOST/camli/sha1-126249fd8c18cbb5312a5705746a2af87fba9538 +curl -u $AUTH -v http://$BSHOST/camli/sha1-126249fd8c18cbb5312a5705746a2af87fba9538 # Get missing -- 404 -curl -u user:$BSPASS -v http://$BSHOST/camli/sha1-22a7fdd575f4c3e7caa3a55cc83db8b8a6714f0f +curl -u $AUTH -v http://$BSHOST/camli/sha1-22a7fdd575f4c3e7caa3a55cc83db8b8a6714f0f # Check present -- 200 with only headers -curl -u user:$BSPASS -I http://$BSHOST/camli/sha1-126249fd8c18cbb5312a5705746a2af87fba9538 +curl -u $AUTH -I http://$BSHOST/camli/sha1-126249fd8c18cbb5312a5705746a2af87fba9538 # Check missing -- 404 with empty list response curl -I http://$BSHOST/camli/sha1-22a7fdd575f4c3e7caa3a55cc83db8b8a6714f0f # List -- 200 with list of blobs (just one) -curl -v -u user:$BSPASS http://$BSHOST/camli/enumerate-blobs?limit=1 +curl -v -u $AUTH http://$BSHOST/camli/enumerate-blobs?limit=1 # List offset -- 200 with list of no blobs -curl -v -u user:$BSPASS http://$BSHOST/camli/enumerate-blobs?after=sha1-126249fd8c18cbb5312a5705746a2af87fba9538 +curl -v -u $AUTH http://$BSHOST/camli/enumerate-blobs?after=sha1-126249fd8c18cbb5312a5705746a2af87fba9538