-
Notifications
You must be signed in to change notification settings - Fork 31
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
presignedGetObjectUrl url is not accepted by S3 (permanentRedirect) #160
Comments
Make sure you allow us to do GetBucketLocation() to get the region or please set the right region to generate correct presigned URL |
I was under the impression that I did set the region, for context this is my code s3signUrl :: Text -> IO (Maybe Text)
s3signUrl url = do
awsConn <- awsCI
|> setRegion Config.awsRegion
|> setCredsFrom [fromAWSEnv]
res <- runMinio awsConn $ do
presignedGetObjectUrl Config.awsS3Bucket url (3600*2) [] []
pure case res of
Left _ -> Nothing
Right signedUrl -> Just (cs signedUrl) |
I've just verified by running the aws cli |
Thanks for your report @themmes - we will send a fix for it. The presign URL code does not do anything special for AWS at this time, but we will fix this. |
@donatello Thanks for getting back to me this quickly! So there is some bug causing this? Let me know if I can help. Is there any temporary fix I could use on my end to work around it? I've tried hacking the URL to match the expected format, but S3 seems to reject the signature, so I might have broken it by changing the url. |
The main thing is we need to use the region to generate the pre-signed URL for AWS because buckets cannot be referenced with https://s3.amazonaws.com they need to be put into virtual bucket DNS style. So this looks like a bug in minio-hs at this point. |
- Also update standard S3 endpoints - Unify code that determines if path style or virtual style must be used for regular and presigned requests Fixes minio#160
Hi,
First of all thanks for making this library, I've successfully used it to push data to S3.
Problem I have is with
presignedGetObjectUrl
, it generates an URL like this:https://s3.amazonaws.com/<bucket>/<path>?<auth>
But I’m getting a permanent redirect from AWS saying it should be
https://<bucket>.s3.amazonaws.com/<path>?<auth>
Am I using it wrong or is this a bug?
Thanks in advance!
The text was updated successfully, but these errors were encountered: