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

[AWS] S3 and public non signed urls #3263

Closed
10io opened this issue Nov 12, 2014 · 3 comments
Closed

[AWS] S3 and public non signed urls #3263

10io opened this issue Nov 12, 2014 · 3 comments

Comments

@10io
Copy link

10io commented Nov 12, 2014

This issue comes from this post on the mailing list.

In a nutshell: how to get the public (non signed) url of a public s3 object? (By public object, I mean created with the option :public => true).

Right now, there isn't a straightforward way to do that. You can either build the url using something like "https://#{bucket_name}.s3.amazonaws.com/#{object_name}" or use the underlying service object with something like service.request_url(:bucket_name => "foo", :object_name => "bar").

The idea is to have a more convenient way to do this.

From the linked post, we have two suggestions:

  • the "direct" way: a method get_public_http_url on Fog::Storage::AWS::Files (see the existing methods get_http_url and get_https_url)
  • Enhance the existing get_http_url and get_https_url methods to support a :public => true option.

Thoughts?

@geemus
Copy link
Member

geemus commented Nov 13, 2014

Thanks for the detailed summary.

I suspect that the method signature may tie our hands, in particular it looks like:

def get_http_url(key, expires, options = {})

In the public case, expires wouldn't make any sense, so perhaps it would be better to stick to a new method that just takes the key and returns the constructed value. What do you think?

@10io
Copy link
Author

10io commented Nov 18, 2014

@geemus Ah yes, you're right: the expires parameter doesn't make any sense for a public url.

I'd say, let's go with two new methods get_public_http_url and get_public_https_url. I'll have a shot at creating a PR for this 🔧

Thanks!

@geemus
Copy link
Member

geemus commented Nov 18, 2014

@10io great, sounds like a plan. I'm going to close this for now then and await the pull. Thanks!

@geemus geemus closed this as completed Nov 18, 2014
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

2 participants