Coder Social home page Coder Social logo

Comments (6)

harshavardhana avatar harshavardhana commented on May 26, 2024 1

Make sure you allow us to do GetBucketLocation() to get the region or please set the right region to generate correct presigned URL

from minio-hs.

harshavardhana avatar harshavardhana commented on May 26, 2024 1

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.

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.

from minio-hs.

themmes avatar themmes commented on May 26, 2024

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)

from minio-hs.

themmes avatar themmes commented on May 26, 2024

I've just verified by running the aws cli aws s3api get-bucket-location --bucket <bucket_name> that returns the bucket location. Is that what you mean with allowing you to do GetBucketLocation()? I've also set the environment variable AWS_DEFAULT_REGION to the right region. Is there still something I'm missing?

from minio-hs.

donatello avatar donatello commented on May 26, 2024

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.

from minio-hs.

themmes avatar themmes commented on May 26, 2024

@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.

from minio-hs.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.