-
Notifications
You must be signed in to change notification settings - Fork 16
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
base: master
Are you sure you want to change the base?
Conversation
@@ -21,7 +23,10 @@ | |||
define s3file ( | |||
$source, | |||
$ensure = 'latest', | |||
$s3_domain = 's3.amazonaws.com', | |||
$s3_url = 'https://s3.amazonaws.com', |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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.
@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-%>") |
There was a problem hiding this comment.
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
@branan any chance you will take this? |
Bump! Will this be merged? |
+1 |
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.