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

allow s3file to use ec2 keys #7

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Conversation

lindenle
Copy link

We needed to be able to use the Authorization header for our OpenStack swift instance so i added some capabilities to this module. Let me know if there is anything you dislike or want cleaned up.

@@ -21,7 +23,10 @@
define s3file (
$source,
$ensure = 'latest',
$s3_domain = 's3.amazonaws.com',
$s3_url = 'https://s3.amazonaws.com',
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

s3_domain to s3_url is a breaking change. The name may suck, but I'm stuck with it

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK, I can change this back.

@lindenle
Copy link
Author

@branan - I tried to address all the concerns you had. I changed back the parameter name and got rid of the gem install by switching to a core ruby hmac-sha1 encoding method.

$date = inline_template("<%= Time.now.to_s %>")
$payload = inline_template("GET\n\n\n<%=@date%>\n/<%= @source -%>")
$signature = inline_template("<% require 'base64' -%><% require 'openssl' -%><%= Base64.encode64( OpenSSL::HMAC.digest(OpenSSL::Digest::Digest.new('sha1'), @s3_secret_key, @payload.encode(Encoding::UTF_8) ) ).strip.to_s-%>")
$header = inline_template("Authorization: AWS <%=@s3_access_key-%>:<%=@signature-%>")
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Build the auth header for s3

@lindenle
Copy link
Author

lindenle commented May 6, 2014

@branan any chance you will take this?

@xaptronic
Copy link

Bump!

Will this be merged?

@JamieCressey
Copy link

+1

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

Successfully merging this pull request may close these issues.

4 participants