How to get uppy/examples/aws-presigned-url to work?

Started by alanwilter2 replies1,344 views
alanwilterOriginal post
#1

I’m trying to run npm run example aws-presigned-url, but I don’t the faintest idea of what to write for COMPANION_AWS_ENDPOINT

alanwilter
#2

I’m realising the problem is not there, leaving it empty and trying to debug the PHP (s3-sign.php):

...
$url = (string) $request->getUri();
file_put_contents($file, "+++$url\n", FILE_APPEND);
...

now I see the error when loading the url from the log $file:

>>>FILE base.txt text/plain
+++https://vcf-test.s3.eu-west-2.amazonaws.com/AAAatest2/base.txt?X-Amz-Content-Sha256=UNSIGNED-PAYLOAD&X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=xxxxxxxxxxxxx%2F20201217%2Feu-west-2%2Fs3%2Faws4_request&X-Amz-Date=20201217T100152Z&X-Amz-SignedHeaders=host&X-Amz-Expires=300&X-Amz-Signature=REDACTED
<Error>
<Code>SignatureDoesNotMatch</Code>
<Message>
The request signature we calculated does not match the signature you provided. Check your key and signing method.
</Message>
...

I’m using my own AWS credentials with my own buckets.

aws s3 cp base.txt s3://vcf-test/AAAatest2/

works just fine.