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

Endpoint isn't used in presigned post #1012

Closed
hakunin opened this issue Nov 23, 2015 · 8 comments
Closed

Endpoint isn't used in presigned post #1012

hakunin opened this issue Nov 23, 2015 · 8 comments
Assignees

Comments

@hakunin
Copy link

hakunin commented Nov 23, 2015

Hi,
I am using the fake-s3 gem and it advises to use endpoint config to point aws-sdk-ruby to localhost.

What I found though is that the presigned post class isn't aware of endpoints and seems to always return s3 url no matter what.

@awood45
Copy link
Member

awood45 commented Nov 23, 2015

How are you trying to do this with the fake-s3 gem? The presigned post method is primarily constructing headers, and does have a url parameter you can set.

@awood45 awood45 self-assigned this Nov 23, 2015
@trevorrowe
Copy link
Member

@hakunin You should be able to simply Ignore the presigned-post #url and use localhost in your form. Is this not working?

@hakunin
Copy link
Author

hakunin commented Nov 24, 2015

I am using shrine and request the url with ajax. Shrine which asks the bucket to pre-sign a post, which results in the bucket url not using the endpoint.

Since the idea is to use fakes3 not if statements to let the code go completely different path based on the environment, it would be good if setting the endpoint in aws-sdk-ruby would simply return the endpoint path.

Btw I am using version 2.

@800a7b32
Copy link

800a7b32 commented Dec 2, 2015

Experiencing a potentially related issue with the ruby aws-sdk (v2) whereby we're using a Ceph endpoint rather than S3 itself (ala similar setup to fake-s3) and when we include 'endpoint' in our config (alongside force_path_style), the gem always returns an error:

Aws::S3::Errors::InvalidArgument

@awood45
Copy link
Member

awood45 commented Dec 5, 2015

@andretanguy Could you please open a separate issue for that? That looks like a possible separate bug.

awood45 added a commit that referenced this issue Dec 5, 2015
Apply :endpoint option to Bucket#presigned_post

Related to #1012
@awood45
Copy link
Member

awood45 commented Dec 5, 2015

@hakunin - I just merged pull request #1020 which plumbs endpoints through presigned posts created via S3 Objects as well as S3 Buckets within the resource interface.

If you're using our S3 resource abstraction, this should be all you need. If you're creating presigned post object directly, you should use the :url parameter provided.

Going to close this now, feel free to reach out if this isn't clear or doesn't fully cover what you need to do.

@andretanguy I'd still like to dive in to what you're seeing as a separate issue.

@awood45 awood45 closed this as completed Dec 5, 2015
@hakunin
Copy link
Author

hakunin commented Dec 5, 2015

Thanks alex!

@800a7b32
Copy link

800a7b32 commented Dec 5, 2015

@awood45 all done for you: #1021

trevorrowe added a commit that referenced this issue Dec 9, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants