(PUP-1068) Add basic auth to HTTP Connection and HTTP Reports#2219
Merged
jpartlow merged 2 commits intopuppetlabs:masterfrom Jan 4, 2014
Merged
Conversation
…ppet. Does the following: * Add logic in Puppet::Reports::Http to properly handle HTTP basic auth using the form http://username:password@host/path * Add a unit test to make sure HTTP basic auth is done if it is given in the url
Sometimes a request needs to perform authentication. We can support this with basic auth readily enough. This commit moves the basic auth support from the report processor and makes it a capability of the network connection code. As part of this it needed to move away from using the #get, #post, etc calls on the connection object and instead construct the Net::HTTP request objects. This might present a slight change in behavior, but not one that users will normally notice. The most noticable change is that the #request method can no longer be used for calling arbitrary methods on the underlying connection, instead it can only be used to call to the appropriate request method (get, head, delete, post, put) In order to make this work more clearly, this also adds actual parameters to the connection class's #get, #post, etc methods. The defaults are taken from the Net::HTTP defaults, which is what would have been used before.
|
CLA signed by all contributors. |
jpartlow
added a commit
that referenced
this pull request
Jan 4, 2014
…-reports-with-basic-auth (PUP-1068) Add basic auth to HTTP Connection and HTTP Reports
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This adds logic in Puppet::Reports::Http to properly handle HTTP basic auth
using the form http://username:password@host/path
In order to make this work more clearly, this also adds actual parameters
to the connection class's #get, #post, etc methods. The defaults are taken
from the Net::HTTP defaults, which is what would have been used before.