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

Support for temp urls #4

Open
carlhoerberg opened this issue Oct 20, 2014 · 3 comments
Open

Support for temp urls #4

carlhoerberg opened this issue Oct 20, 2014 · 3 comments

Comments

@carlhoerberg
Copy link

http://docs.openstack.org/api/openstack-object-storage/1.0/content/tempurl.html

@carlhoerberg
Copy link
Author

doing this now:

expires = Time.now.utc.to_i + (60 * 60) # 1 hour
account = ENV.fetch 'SOFTLAYER_OS_ACCOUNT'
path = "/v1/#{account}/#{container}/#{file}"
hmac_body = ['GET', expires, path].join("\n")
key = ENV.fetch 'SOFTLAYER_OS_TEMP_URL_KEY'
sig = Digest::HMAC.hexdigest(hmac_body, key, Digest::SHA1)
"https://#{region}.objectstorage.softlayer.net#{path}?temp_url_sig=#{sig}&temp_url_expires=#{expires}"

@cphrmky
Copy link
Member

cphrmky commented Mar 20, 2015

@carlhoerberg have you checked out fog-softlayer ?

It has support for temp urls, check the examples for documentation.

@sio4
Copy link

sio4 commented Mar 21, 2016

I did pull request for it. (#10)

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

3 participants