mirror of
https://github.com/dutchcoders/transfer.sh.git
synced 2026-02-06 07:22:17 +00:00
Support for AWS Signature Version 4 #247
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @computeralex92 on GitHub.
It would be great if a new version of transfer.sh support the AWS Signature Version 4 to host the S3 Bucket in a region where only this signature is available.
Currently this error appears when trying to upload a file to such a S3 Bucket:
@paolafrancesca commented on GitHub:
please @computeralex92 can you test #243 ?
@computeralex92 commented on GitHub:
The issue is related to the switch from Version 2 of the signature to Version 4 happen step by step from AWS.
Every newer region (e.g. eu-central-1 or ap-east-1) is only accessable with version 4, all other "older" regions of AWS supports both versions.
As far as I can see in the code the problem is that the S3 Lib transfer.sh is using does not support V4 and since the lib is unmaintained, from my perspective only a switch of the lib is solving this issue.
I found a old pull request which was never merged to master, maybe it is helpful in this case:
https://github.com/dutchcoders/transfer.sh/pull/49
@paolafrancesca commented on GitHub:
@computeralex92 can you point to some documentation about the topic?
the S3 storage backend was done by @nl5887 and I never worked on it (neither I have the possibility to test against it at the moment).
I can check if I can just override the AWS Signature to use from the AWS SDK, is Version 4 supported in every region?
@paolafrancesca commented on GitHub:
I see @computeralex92. as I said I don't use S3 and I didn't developed that part.
I think the whole code has to be moved to use official AWS SDK, unlikely I don't know when I'll have time for that and I cannot test.
in case I will create a branch for are you available to test it?
@computeralex92 commented on GitHub:
I will try it and give you a result as soon as possible.
@paolafrancesca commented on GitHub:
how do you fixed these?
for the region, as long as you pass the endpoint it seems to be used only for signing, and I assumed you could use a signing region different than the one the bucket is. evidently my assumption was wrong :)
for 0 byte file size and the runtime error: I used the wrong method in
HeadandGet, can you please test now?@computeralex92 commented on GitHub:
OK, looks good so far, but I need to fix some issues to get it work:
I already fixed this bugs locally and it works now with a bucket located in Frankfurt (eu-central-1).
To things are on my ToDo list for now:
@paolafrancesca commented on GitHub:
#244 merged to the branch, just refactored the order of the param to be a little cleaner.
if you give me the go that all tests are fine I will merge this to master
@computeralex92 commented on GitHub:
Good message: It is working as expected with Minio and other providers like Digitalocean and Scaleway.
Bad message:
When testing the download of a file, the following error appears in the browser:
I think it's related to the 0 byte file size bug in the download page.
@aspacca Maybe you can see the issue with that; I will also try to find the problem.
@computeralex92 commented on GitHub:
Now it's working perfectly.
I add the pull request #244 to this branch with the fixed I added.
@computeralex92 commented on GitHub:
From my side everything is fine; upload and download is working as expected