Signature not matching for using presigned url of CompleteMultipartUpload for s3

108 Views Asked by At

I am currently creating a S3 multipartupload program where the client side ideally only makes one request to the server side to complete this. This means the server side

  1. Creates the MultipartUpload
  2. creates the upload IDs as presigned urls
  3. creates the CompleteMultipartUpload/AbortMultipartUpload as presigned urls
  4. returns all those URLs to the client side for the client to make all those requests.

Currently I have everything working but getting the CompleteMutlipartUpload/Abort presigned URL working. I get the error: <Response [403]> The request signature we calculated does not match the signature you provided. Check your key and signing method.

My code looks something like this

Server side in Go:

completeInput := &s3.CompleteMultipartUploadInput{
    Bucket:   aws.String(BUCKET),
    Key:      aws.String(FILE),
    UploadId: uploadId,
    MultipartUpload: &s3.CompletedMultipartUpload{
        Parts: completedParts,
    },
}

resp, _ := svc.CompleteMultipartUploadRequest(completeInput)
// Note that calling resp.Send() works and uploads the file correctly
completeUrl, _ := resp.Presign(15 * time.Minute)

Then I call the Client side code in Python:

// Note I also upload code from this environment so I believe my credentials are good to go
def complete(completeUrl):
    complete = requests.put(completeUrl)
0

There are 0 best solutions below