-
Notifications
You must be signed in to change notification settings - Fork 298
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 authenticated HTTP URLs (fixes #851) #852
Support authenticated HTTP URLs (fixes #851) #852
Conversation
6524733
to
248d419
Compare
How can |
@niekrasp We typically pass the credentials in as an environment variable, e.g.
Then it's just up to Jenkins (or whatever CI system) to set the ENV variable when it launches the VM. |
@LeeXGreen thanks ! When this PR can be merged ? |
@lamont-granquist as follow up to #856, can you or someone else review&merge this PR as well ? please :) |
Is there anything I can do to help this get merged? |
Bump -- this seems to be a fairly common case when building omnibus installers in an enterprise environment |
@LeeXGreen thanks for submitting this. This change looks good. Could you get the branch up to date, and add tests to show |
a9d5e17
to
8559c6a
Compare
Software `source` method now supports the `authorization` option. This allows the user to supply an HTTP Authorization header which will be passed to the source URL. For the common case of basic authentication, that looks like this: ``` require 'base64' username = 'XXX' password = 'YYY' credentials = Base64.encode64("#{username}:#{password}") version 'the_version' do source url: 'https://example.com/path/to/the/file', authorization: "Basic #{credentials}", ... end ``` Signed-off-by: Lee Green <[email protected]>
8559c6a
to
55018e8
Compare
Signed-off-by: Lee Green <[email protected]>
c66a474
to
6bf8a0f
Compare
Let me know what you think about this test -- I didn't see any similar test to copy from. I don't love the use of |
Thanks @LeeXGreen . I think the tests are good - using :send is not ideal, but it does the right thing without having to mock internals of things we don't care about - which is 👍 |
Looks like we need one more rebase when you have a chance, otherwise this looks good to go. |
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.
👍
... with a suggestion for updating the documentation for the new option with an example for people with bad memories like me.
@@ -263,6 +263,8 @@ def dependency(val) | |||
# | |||
# @option val [String] :cookie (nil) | |||
# a cookie to set | |||
# @option val [String] :authorization (nil) | |||
# an authorization header to set |
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.
Any chance to update this documentation with the example? I'd have to scrape the barrel of my web header knowledge to remember how to set this. Maybe something like this?
# an authorization header to set | |
# an authorization header to set, e.g. "Basic " + Base64.encode64("#{username}:#{password}") |
@LeeXGreen there's a pile of |
Change appears in v6.0.25. (Arguably should have bumped a minor there, but 🤷♂️.) |
This PR fixes issue #851.
Description
Software
source
method now supports theauthorization
option.This allows the user to supply an HTTP Authorization header which will
be passed to the source URL.
For the common case of basic authentication, that looks like this:
Maintainers
Please ensure that you check for:
serial number
corresponding change is reviewed and there is a release plan
corresponding change is reviewed and there is a release plan