I am writing a client for a service that provides a signed download URL. This works great for small downloads, but is not suitable for large downloads, which can be useful when using multi-page downloads.
In authorization documents, it is proposed to use the provided signature and key to access the key in both the URL and the authorization header. I am trying to use the header approach to start a multi-page download, but I am being denied access. When I use the query string approach, I get the method invalid (POST in this case).
I use boto to create a url. For instance:
import boto
c = boto.connect_s3()
bucket = c.get_bucket('my-bucket')
key = boto.s3.key.Key(bucket, 'my-big-file.gz')
signed_url = key.generate_url(60 * 60, 'POST')
Then, trying to start a multi-page download using a signed URL, I do the following:
import requests
url = signed_url + '&uploads'
resp = requests.post(url)
This returns a method that is not allowed.
Is this strategy possible? Is there a better way to provide limited credentials for a specific resource to allow large multi-page downloads?
Update
I managed to find a slightly more specific error that makes me think that this is impossible. Unfortunately, I get a 403 message that the signature does not match the request.
<?xml version="1.0" encoding="UTF-8"?>
<Error>
<Code>SignatureDoesNotMatch</Code>
<Message>The request signature we calculated does not match the signature you
provided. Check your key and signing method.</Message>
<StringToSignBytes>.../StringToSignBytes>
<RequestId>...</RequestId>
<HostId>...</HostId>
<SignatureProvided>...</SignatureProvided>
<StringToSign>POST
1402941975
/my-sandbox/test-mp-upload.txt?uploads</StringToSign>
<AWSAccessKeyId>...</AWSAccessKeyId>
</Error>
This makes me think that I will not be able to use the signed URL because the signature will not match.
UPDATE
, URL- . , , . , URL- , URL-, , . , ( ) , URL- .
, , , / . , boto, .