Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(object): mc: change generated Signature Version from v2 to v4 #1522

Merged
merged 2 commits into from
Nov 12, 2020

Conversation

gmile
Copy link
Contributor

@gmile gmile commented Nov 12, 2020

Before this change, using "mc" to generate a pre-sign URL using for uploading an object would not work. After manually updating the config from S3v2 to S3v4 all good now.

Command I used is:

mc share upload scaleway/my-bucket/test.png

Before the change it would generate a URL like this, and it doesn't work:

$ mc share upload scaleway/my-test-bucket/test.png
URL: https://s3.fr-par.scw.cloud/my-test-bucket/test.png
Expire: 7 days 0 hours 0 minutes 0 seconds
Share: curl https://s3.fr-par.scw.cloud/my-test-bucket/ -F signature=jE27Ptr/IkDJcP60ZqA7jJD7RnE= -F bucket=my-test-bucket -F policy=eyJleHBpcmF0aW9uIjoiMxAyMC0xMS0xOVQxMTo0OTo1Mi4xMloi2CJjb25kaXRpb25zIjpbWyJlcSIsIiRidWNrZXQiLCJkYW5sb24tc3RhZ2luZy1sb2dvLXVwbG9hZHMiXSxbImVxIiwiJGtleSIsInRlc3QucG5nIl1dfQ== -F AWSAccessKeyId=SCW3BBT57A1CZEXJD2T5 -F key=test.png -F file=@<FILE>
$

After the change it would generate a URL like this, and it works:

$ mc share upload scaleway/my-test-bucket/test.png
URL: https://s3.fr-par.scw.cloud/my-test-bucket/test.png
Expire: 7 days 0 hours 0 minutes 0 seconds
Share: curl https://s3.fr-par.scw.cloud/my-test-bucket/ -F bucket=my-test-bucket -F policy=eyJleHBpcmF0aW9uIjoiMjAyMC0xMS0xOVQxMTo1MzowMC42NzJaIiwiY29uZGl0aW9ucyI6W1siZXEiLCIkYnVja2V0IiwiZGFubG9uLXN0YWdpbmctbG9nby11cGxvYWRzIl0sWyJlcSIsIiRrZXkiLCJ0ZXN0LnBuZyJdLFsiZXEiLCIkeC1hbXotZGF0ZSIsIjIwMjAxMTEyVDxxNTMwMVoiXSxbImVxIiwiJHgtYW16LWFsZ29yaXRobSIsIkFXUzQtSE1BQy1TSEEyNTYiXSxbImVxIiwiJHgtYW16LWNyZWRlbnRpYWwiLCJTQ1dOQkJUNTdBRUNaRVhKRDJUWi8yMDIwMTExMi9mci1wYXIvczMvYXdzNF9yZXF1ZXN0Il1dfQ== -F x-amz-algorithm=AWS4-HMAC-SHA256 -F x-amz-credential=SCWXBBT51AECZEXJD2TZ/20201112/fr-par/s3/aws4_request -F x-amz-date=20201112T115301Z -F x-amz-signature=2eed2818b8fa1e833b12fab3b09c88987c6ba6be81786f9e94fac1c464b342f2 -F key=test.png -F file=@<FILE>
$

Release note for CHANGELOG:

Update generated mc config to have Signature Version v4

gmile and others added 2 commits November 12, 2020 13:58
Before this change, using "mc" to generate a pre-sign URL using for uploading an object would not work. After manually updating the config from S3v2 to S3v4 all good now.
@remyleone remyleone changed the title mc: change generated Signature Version from v2 to v4 fix(object): mc: change generated Signature Version from v2 to v4 Nov 12, 2020
@remyleone remyleone merged commit 7ca297a into scaleway:master Nov 12, 2020
@remyleone
Copy link
Member

@gmile Thanks a lot for your contribution :)

@gmile gmile deleted the patch-1 branch November 12, 2020 15:46
@remyleone remyleone added the object Object storage issues, bugs and feature requests label Jul 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
object Object storage issues, bugs and feature requests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants